Documentation
¶
Overview ¶
This simple example demonstrates how to get started using lpad to communicate with Launchpad in a console application:
root, err := lpad.Login(lpad.Production, &lpad.ConsoleOAuth{}) if err != nil { panic(err) } me, err := root.Me() if err != nil { panic(err) } fmt.Println(me.DisplayName())
Index ¶
- Variables
- func SetDebug(debug bool)
- type APIBase
- type AnyValue
- type Archive
- type ArchiveList
- type Auth
- type Blueprint
- func (bp *Blueprint) LinkBranch(branch *Branch) error
- func (bp *Blueprint) LinkBug(bug *Bug) error
- func (bp *Blueprint) Name() string
- func (bp *Blueprint) SetName(name string)
- func (bp *Blueprint) SetSummary(summary string)
- func (bp *Blueprint) SetTitle(title string)
- func (bp *Blueprint) SetWhiteboard(whiteboard string)
- func (bp *Blueprint) Summary() string
- func (bp *Blueprint) Title() string
- func (bp *Blueprint) WebPage() string
- func (bp *Blueprint) Whiteboard() string
- type BlueprintTarget
- type Branch
- func (b *Branch) Id() string
- func (b *Branch) LandingCandidates() (*MergeProposalList, error)
- func (b *Branch) LandingTargets() (*MergeProposalList, error)
- func (b *Branch) Owner() (*Person, error)
- func (b *Branch) OwnerName() string
- func (b *Branch) ProjectName() string
- func (b *Branch) ProposeMerge(stub *MergeStub) (mp *MergeProposal, err error)
- func (b *Branch) RevisionCount() int
- func (b *Branch) UniqueName() string
- func (b *Branch) WebPage() string
- type BranchTip
- type Bug
- func (bug *Bug) DateCreated() string
- func (bug *Bug) DateLastMessage() string
- func (bug *Bug) DateLastUpdated() string
- func (bug *Bug) DateLatestPatchUploaded() string
- func (bug *Bug) Description() string
- func (bug *Bug) Heat() int
- func (bug *Bug) Id() int
- func (bug *Bug) IsExpirable() bool
- func (bug *Bug) LinkBranch(branch *Branch) error
- func (bug *Bug) Owner() (*Person, error)
- func (bug *Bug) Private() bool
- func (bug *Bug) SecurityRelated() bool
- func (bug *Bug) SetDescription(description string)
- func (bug *Bug) SetPrivate(private bool)
- func (bug *Bug) SetSecurityRelated(related bool)
- func (bug *Bug) SetTags(tags []string)
- func (bug *Bug) SetTitle(title string)
- func (bug *Bug) Tags() []string
- func (bug *Bug) Tasks() (*BugTaskList, error)
- func (bug *Bug) Title() string
- func (bug *Bug) WebPage() string
- type BugImportance
- type BugStatus
- type BugStub
- type BugTask
- func (task *BugTask) Assignee() (*Person, error)
- func (task *BugTask) BugTargetDisplayName() string
- func (task *BugTask) BugTargetName() string
- func (task *BugTask) DateAssigned() string
- func (task *BugTask) DateClosed() string
- func (task *BugTask) DateConfirmed() string
- func (task *BugTask) DateCreated() string
- func (task *BugTask) DateFixCommitted() string
- func (task *BugTask) DateFixReleased() string
- func (task *BugTask) DateInProgress() string
- func (task *BugTask) DateIncomplete() string
- func (task *BugTask) DateLeftClosed() string
- func (task *BugTask) DateLeftNew() string
- func (task *BugTask) DateTriaged() string
- func (task *BugTask) Importance() BugImportance
- func (task *BugTask) IsComplete() bool
- func (task *BugTask) Milestone() (*Milestone, error)
- func (task *BugTask) Owner() (*Person, error)
- func (task *BugTask) SetAssignee(person *Person)
- func (task *BugTask) SetImportance(importance BugImportance)
- func (task *BugTask) SetMilestone(ms *Milestone)
- func (task *BugTask) SetStatus(status BugStatus)
- func (task *BugTask) Status() BugStatus
- func (task *BugTask) Title() string
- type BugTaskList
- type Build
- func (build *Build) Arch() string
- func (build *Build) BuildLogURL() string
- func (build *Build) Created() string
- func (build *Build) Finished() string
- func (build *Build) Publication() (*Publication, error)
- func (build *Build) Retry() error
- func (build *Build) State() BuildState
- func (build *Build) Title() string
- func (build *Build) UploadLogURL() string
- func (build *Build) WebPage() string
- type BuildList
- type BuildState
- type Builder
- type BuilderList
- type ConsoleOAuth
- type Distro
- func (d *Distro) ActiveMilestones() (*MilestoneList, error)
- func (d *Distro) AllSeries() (*DistroSeriesList, error)
- func (d *Distro) Archive(name string) (*Archive, error)
- func (d *Distro) Archives() (*ArchiveList, error)
- func (p *Distro) BlueprintTarget()
- func (d *Distro) BranchTips(since time.Time) (tips []BranchTip, err error)
- func (d *Distro) Description() string
- func (d *Distro) DisplayName() string
- func (d *Distro) DistroSourcePackage(name string) (*DistroSourcePackage, error)
- func (d *Distro) FocusSeries() (*DistroSeries, error)
- func (d *Distro) Name() string
- func (d *Distro) Series(name string) (*DistroSeries, error)
- func (d *Distro) SetDescription(description string)
- func (d *Distro) SetDisplayName(name string)
- func (d *Distro) SetName(name string)
- func (d *Distro) SetSummary(title string)
- func (d *Distro) SetTitle(title string)
- func (d *Distro) Summary() string
- func (d *Distro) Title() string
- func (d *Distro) WebPage() string
- type DistroList
- type DistroSeries
- func (s *DistroSeries) Active() bool
- func (d DistroSeries) Description() string
- func (d *DistroSeries) DisplayName() string
- func (d *DistroSeries) FullSeriesName() string
- func (s *DistroSeries) Name() string
- func (s *DistroSeries) SetActive(active bool)
- func (s *DistroSeries) SetName(name string)
- func (s *DistroSeries) SetSummary(summary string)
- func (s *DistroSeries) SetTitle(title string)
- func (d *DistroSeries) SourcePackage(name string) (*SourcePackage, error)
- func (s *DistroSeries) Summary() string
- func (s *DistroSeries) Title() string
- func (s *DistroSeries) WebPage() string
- type DistroSeriesList
- type DistroSourcePackage
- type Error
- type IRCNick
- type Member
- type MemberList
- type MergeProposal
- func (mp *MergeProposal) AddComment(subject, message string, vote ProposalVote, reviewType string) error
- func (mp *MergeProposal) CommitMessage() string
- func (mp *MergeProposal) Description() string
- func (mp *MergeProposal) Email() string
- func (mp *MergeProposal) PreReq() (*Branch, error)
- func (mp *MergeProposal) SetCommitMessage(msg string)
- func (mp *MergeProposal) SetDescription(description string)
- func (mp *MergeProposal) SetStatus(status MergeProposalStatus) error
- func (mp *MergeProposal) Source() (*Branch, error)
- func (mp *MergeProposal) Status() MergeProposalStatus
- func (mp *MergeProposal) Target() (*Branch, error)
- func (mp *MergeProposal) WebPage() string
- type MergeProposalList
- type MergeProposalStatus
- type MergeStub
- type Milestone
- func (ms *Milestone) Active() bool
- func (ms *Milestone) CodeName() string
- func (ms *Milestone) Date() string
- func (ms *Milestone) Name() string
- func (ms Milestone) SetActive(active bool)
- func (ms *Milestone) SetCodeName(name string)
- func (ms *Milestone) SetDate(date string)
- func (ms *Milestone) SetName(name string)
- func (ms *Milestone) SetSummary(summary string)
- func (ms *Milestone) SetTitle(title string)
- func (ms *Milestone) Summary() string
- func (ms *Milestone) Title() string
- func (ms *Milestone) WebPage() string
- type MilestoneList
- type OAuth
- type Params
- type Person
- func (person *Person) DisplayName() string
- func (person *Person) IRCNicks() (nicks []*IRCNick, err error)
- func (person *Person) Member()
- func (person *Person) Name() string
- func (person *Person) PreferredEmail() (string, error)
- func (person *Person) SetDisplayName(name string)
- func (person *Person) SetName(name string)
- func (person *Person) WebPage() string
- type PersonList
- type Pocket
- type Project
- func (p *Project) ActiveMilestones() (*MilestoneList, error)
- func (p *Project) AllSeries() (*ProjectSeriesList, error)
- func (p *Project) BlueprintTarget()
- func (p *Project) Description() string
- func (p *Project) DisplayName() string
- func (p *Project) FocusSeries() (*ProjectSeries, error)
- func (p *Project) Name() string
- func (p *Project) SetDescription(description string)
- func (p *Project) SetDisplayName(name string)
- func (p *Project) SetName(name string)
- func (p *Project) SetSummary(title string)
- func (p *Project) SetTitle(title string)
- func (p *Project) Summary() string
- func (p *Project) Title() string
- func (p *Project) WebPage() string
- type ProjectSeries
- func (s *ProjectSeries) Active() bool
- func (s *ProjectSeries) Branch() (*Branch, error)
- func (s *ProjectSeries) Name() string
- func (s *ProjectSeries) SetActive(active bool)
- func (s *ProjectSeries) SetBranch(branch *Branch)
- func (s *ProjectSeries) SetName(name string)
- func (s *ProjectSeries) SetSummary(summary string)
- func (s *ProjectSeries) SetTitle(title string)
- func (s *ProjectSeries) Summary() string
- func (s *ProjectSeries) Title() string
- func (s *ProjectSeries) WebPage() string
- type ProjectSeriesList
- type ProposalVote
- type Publication
- type PublicationList
- type PublishStatus
- type Root
- func (root *Root) Blueprint(target BlueprintTarget, name string) (*Blueprint, error)
- func (root *Root) Branch(burl string) (*Branch, error)
- func (root *Root) Bug(id int) (*Bug, error)
- func (root *Root) Build(distro string, source string, version string, id int) (*Build, error)
- func (root *Root) Builder(name string) (*Builder, error)
- func (root *Root) Builders() (*BuilderList, error)
- func (root *Root) CreateBug(stub *BugStub) (*Bug, error)
- func (root *Root) Distro(name string) (*Distro, error)
- func (root *Root) Distros() (*DistroList, error)
- func (root *Root) FindMembers(text string) (*MemberList, error)
- func (root *Root) FindPeople(text string) (*PersonList, error)
- func (root *Root) FindTeams(text string) (*TeamList, error)
- func (root *Root) Me() (*Person, error)
- func (root *Root) Member(name string) (Member, error)
- func (root *Root) Project(name string) (*Project, error)
- type Session
- type SourcePackage
- type StoredOAuth
- type Team
- type TeamList
- type Value
- func (v *Value) AbsLoc() string
- func (v *Value) BaseLoc() string
- func (v *Value) BoolField(key string) bool
- func (v *Value) FloatField(key string) float64
- func (v *Value) For(f func(*Value) error) (err error)
- func (v *Value) Get(params Params) (same *Value, err error)
- func (v *Value) IntField(key string) int
- func (v *Value) IsValid() bool
- func (v *Value) Link(key string) *Value
- func (v *Value) Location(loc string) *Value
- func (v *Value) Map() map[string]interface{}
- func (v *Value) Patch() error
- func (v *Value) Post(params Params) (other *Value, err error)
- func (v *Value) Session() *Session
- func (v *Value) SetField(key string, value interface{})
- func (v *Value) StartIndex() int
- func (v *Value) StringField(key string) string
- func (v *Value) StringListField(key string) []string
- func (v *Value) TotalSize() int
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("resource not found")
ErrNotFound is returned when the HTTP API returns 404 or a nil value is found in a resulting field or a field being operated on.
Functions ¶
Types ¶
type AnyValue ¶
type AnyValue interface { IsValid() bool Session() *Session BaseLoc() string AbsLoc() string Map() map[string]interface{} StringField(key string) string StringListField(key string) []string IntField(key string) int FloatField(key string) float64 BoolField(key string) bool SetField(key string, value interface{}) Location(loc string) *Value Link(key string) *Value Get(params Params) (*Value, error) Post(params Params) (*Value, error) Patch() error TotalSize() int StartIndex() int For(func(v *Value) error) error }
The AnyValue interface is implemented by *Value and thus by all the more specific value types supported. See the Value type for the meaning of these methods.
type Archive ¶
type Archive struct {
*Value
}
Archive represents a package archive.
func (*Archive) Description ¶
Description returns a description string for this archive.
func (*Archive) DisplayName ¶
DisplayName returns the user friendly name of this archive.
func (*Archive) Publication ¶
func (a *Archive) Publication(sourceName string, status PublishStatus) (*PublicationList, error)
Publication returns the publication history for the sourceName source package in this archive that has the given status.
type ArchiveList ¶
type ArchiveList struct {
*Value
}
ArchiveList represents a list of Archive objects.
type Auth ¶
The Auth interface is implemented by types which are able to Login and authenticate requests made against Launchpad.
type Blueprint ¶
type Blueprint struct {
*Value
}
The Blueprint type represents a blueprint in Launchpad.
func (*Blueprint) LinkBranch ¶
LinkBranch associates a branch with this blueprint.
func (*Blueprint) Name ¶
Name returns the blueprint name. May contain lower-case letters, numbers, and dashes. It will be used in the specification url. Examples: mozilla-type-ahead-find, postgres-smart-serial.
func (*Blueprint) SetName ¶
SetName changes the blueprint name which must consist of lower-case letters, numbers, and dashes. It will be used in the specification url. Examples: mozilla-type-ahead-find, postgres-smart-serial. Patch must be called to commit all changes.
func (*Blueprint) SetSummary ¶
SetSummary changes the blueprint summary which must consist of a single paragraph description of the feature.
func (*Blueprint) SetTitle ¶
SetTitle sets the blueprint title. The title must describe the feature as clearly as possible, in up to 70 characters. This title is displayed in every feature list or report.
func (*Blueprint) SetWhiteboard ¶
SetWhiteboard changes the blueprint whiteboard that may contain any notes on the status of this specification.
func (*Blueprint) Summary ¶
Summary returns the blueprint summary which should consist of a single paragraph description of the feature.
func (*Blueprint) Title ¶
Title returns the blueprint title that should describe the feature as clearly as possible, in up to 70 characters. This title is displayed in every feature list or report.
func (*Blueprint) Whiteboard ¶
Whiteboard returns the blueprint whiteboard which contains any notes on the status of this specification.
type BlueprintTarget ¶
type BlueprintTarget interface { Name() string BlueprintTarget() }
BlueprintTarget is implemented by types that may be used as targets for blueprints, such as *Project and *Distro.
type Branch ¶
type Branch struct {
*Value
}
The Branch type represents a project in Launchpad.
func (*Branch) Id ¶
Id returns the shortest version for the branch name. If the branch is the development focus for a project, a lp:project form will be returned. If it's the development focus for a series, then a lp:project/series is returned. Otherwise, the unique name for the branch in the form lp:~user/project/branch-name is returned.
func (*Branch) LandingCandidates ¶
func (b *Branch) LandingCandidates() (*MergeProposalList, error)
LandingCandidates returns a list of all the merge proposals that have this branch as the target of the proposed change.
func (*Branch) LandingTargets ¶
func (b *Branch) LandingTargets() (*MergeProposalList, error)
LandingTargets returns a list of all the merge proposals that have this branch as the source of the proposed change.
func (*Branch) ProjectName ¶
ProjectName returns the name for the project this branch is part of.
func (*Branch) ProposeMerge ¶
func (b *Branch) ProposeMerge(stub *MergeStub) (mp *MergeProposal, err error)
ProposeMerge proposes this branch for merging on another branch by creating the respective merge proposal.
func (*Branch) RevisionCount ¶
RevisionCount returns the revision number of the tip of the branch
func (*Branch) UniqueName ¶
UniqueName returns the unique branch name, in the form lp:~user/project/branch-name.
type Bug ¶
type Bug struct {
*Value
}
The Bug type represents a bug in Launchpad.
func (*Bug) DateCreated ¶
func (*Bug) DateLastMessage ¶
func (*Bug) DateLastUpdated ¶
func (*Bug) DateLatestPatchUploaded ¶
func (*Bug) Description ¶
Description returns the main bug description.
func (*Bug) IsExpirable ¶
func (*Bug) LinkBranch ¶
LinkBranch associates a branch with this bug.
func (*Bug) SecurityRelated ¶
SecurityRelated returns true if the bug describes sensitive information about a security vulnerability.
func (*Bug) SetDescription ¶
SetDescription changes the bug description. Patch must be called to commit all changes.
func (*Bug) SetPrivate ¶
SetPrivate changes the bug private flag. Patch must be called to commit all changes.
func (*Bug) SetSecurityRelated ¶
SetSecurityRelated sets to related the flag that tells if a bug is security sensitive or not. Patch must be called to commit all changes.
func (*Bug) Tasks ¶
func (bug *Bug) Tasks() (*BugTaskList, error)
Tasks returns the list of bug tasks associated with the bug.
type BugImportance ¶
type BugImportance string
const ( ImUnknown BugImportance = "Unknown" ImCritical BugImportance = "Critical" ImHigh BugImportance = "High" ImMedium BugImportance = "Medium" ImLow BugImportance = "Low" ImWishlist BugImportance = "Wishlist" ImUndecided BugImportance = "Undecided" )
type BugStatus ¶
type BugStatus string
const ( StUnknown BugStatus = "Unknown" StNew BugStatus = "New" StIncomplete BugStatus = "Incomplete" StOpinion BugStatus = "Opinion" StInvalid BugStatus = "Invalid" StWontFix BugStatus = "Won't fix" StExpired BugStatus = "Expired" StConfirmed BugStatus = "Confirmed" StTriaged BugStatus = "Triaged" StInProgress BugStatus = "In Progress" StFixCommitted BugStatus = "Fix Committed" StFixReleased BugStatus = "Fix Released" )
type BugStub ¶
type BugStub struct { Title string // Required Description string // Required Target AnyValue // Project, source package, or distribution Private bool SecurityRelated bool Tags []string }
A BugStub holds details necessary for creating a new bug in Launchpad.
type BugTask ¶
type BugTask struct {
*Value
}
A BugTask represents the association of a bug with a project or source package, and the related information.
func (*BugTask) BugTargetDisplayName ¶
func (*BugTask) BugTargetName ¶
func (*BugTask) DateAssigned ¶
func (*BugTask) DateClosed ¶
func (*BugTask) DateConfirmed ¶
func (*BugTask) DateCreated ¶
func (*BugTask) DateFixCommitted ¶
func (*BugTask) DateFixReleased ¶
func (*BugTask) DateInProgress ¶
func (*BugTask) DateIncomplete ¶
func (*BugTask) DateLeftClosed ¶
func (*BugTask) DateLeftNew ¶
func (*BugTask) DateTriaged ¶
func (*BugTask) Importance ¶
func (task *BugTask) Importance() BugImportance
Importance returns the current importance for the bug task. See the Importance type for supported values.
func (*BugTask) IsComplete ¶
func (*BugTask) SetAssignee ¶
SetAssignee changes the person currently assigned to work on the task.
func (*BugTask) SetImportance ¶
func (task *BugTask) SetImportance(importance BugImportance)
Importance changes the current importance for the bug task. See the Importance type for supported values.
func (*BugTask) SetMilestone ¶
SetMilestone changes the milestone the task is currently targeted at.
func (*BugTask) SetStatus ¶
SetStatus changes the current status for the bug task. See the Status type for supported values.
type BugTaskList ¶
type BugTaskList struct {
*Value
}
BugTaskList represents a list of BugTasks for iteration.
type Build ¶
type Build struct {
*Value
}
The Build type describes a package build.
func (*Build) BuildLogURL ¶
BuildLogURL returns the URL for the build log file.
func (*Build) Publication ¶
func (build *Build) Publication() (*Publication, error)
Publication returns the source publication record corresponding to build.
func (*Build) UploadLogURL ¶
UploadLogURL returns the URL for the upload log if there was an upload failure.
type BuildList ¶
type BuildList struct {
*Value
}
The BuildList type represents a list of package Build objects.
type BuildState ¶
type BuildState string
A BuildState holds the state a package build can be found in.
const ( BSNeedsBuilding BuildState = "Needs building" BSSuccessfullyBuilt BuildState = "Successfully built" BSFailedToBuild BuildState = "Failed to build" BSDependencyWait BuildState = "Dependency wait" BSChrootProblem BuildState = "Chroot problem" BSBuildForSupersededSource BuildState = "Build for superseded source" BSCurrentlyBuilding BuildState = "Currently building" BSFailedToUpload BuildState = "Failed to upload" BSCurrentlyUploading BuildState = "Currently uploading" )
type Builder ¶
type Builder struct {
*Value
}
The Builder type stands for an individual machine that builds packages.
func (*Builder) Virtualized ¶
Virtualized returns whether the builder is virtualized Xen instance.
type BuilderList ¶
type BuilderList struct {
*Value
}
A BuilderList represents a list of Builder objects.
type ConsoleOAuth ¶
type ConsoleOAuth StoredOAuth
The ConsoleOAuth type will cache successful authentications like StoredOAuth and will also open a browser for the user to confirm authentication and wait for confirmation with a console message on standard output.
See the OAuth type for details on how to construct values of this type, and see the Login method for a convenient way to make use of them.
func (*ConsoleOAuth) Login ¶
func (oauth *ConsoleOAuth) Login(baseURL string) error
type Distro ¶
type Distro struct {
*Value
}
The Distro type represents a distribution in Launchpad.
func (*Distro) ActiveMilestones ¶
func (d *Distro) ActiveMilestones() (*MilestoneList, error)
ActiveMilestones returns the list of active milestones associated with the distribution, ordered by the target date.
func (*Distro) AllSeries ¶
func (d *Distro) AllSeries() (*DistroSeriesList, error)
AllSeries returns the list of series associated with the distribution.
func (*Distro) Archives ¶
func (d *Distro) Archives() (*ArchiveList, error)
Archives returns the list of archives associated with the distribution.
func (*Distro) BlueprintTarget ¶
func (p *Distro) BlueprintTarget()
BlueprintTarget marks *Distro as being a target for blueprints.
func (*Distro) BranchTips ¶
BranchTips returns a list of all branches registered under the given distribution changed after the since time. If since is the zero time, all branch tips in the distribution are returned.
func (*Distro) Description ¶
Description returns the distribution description.
func (*Distro) DisplayName ¶
DisplayName returns the distribution name as it would be displayed in a paragraph. For example, a distribution's title might be "The Foo Distro" and its display name could be "Foo".
func (*Distro) DistroSourcePackage ¶
func (d *Distro) DistroSourcePackage(name string) (*DistroSourcePackage, error)
DistroSourcePackage returns the DistroSourcePackage with the given name.
func (*Distro) FocusSeries ¶
func (d *Distro) FocusSeries() (*DistroSeries, error)
FocusDistroSeries returns the distribution series set as the current development focus.
func (*Distro) Name ¶
Name returns the distribution name, which is composed of at least one lowercase letter or number, followed by letters, numbers, dots, hyphens or pluses. This is a short name used in URLs.
func (*Distro) Series ¶
func (d *Distro) Series(name string) (*DistroSeries, error)
Series returns the named Series of this distribution.
func (*Distro) SetDescription ¶
SetDescription changes the distributions's description. Patch must be called to commit all changes.
func (*Distro) SetDisplayName ¶
SetDisplayName changes the distribution name as it would be displayed in a paragraph. For example, a distribution's title might be "The Foo Distro" and its display name could be "Foo". Patch must be called to commit all changes.
func (*Distro) SetName ¶
SetName changes the distribution name, which must be composed of at least one lowercase letter or number, followed by letters, numbers, dots, hyphens or pluses. This is a short name used in URLs. Patch must be called to commit all changes.
func (*Distro) SetSummary ¶
SetSummary changes the distribution summary, which is a short paragraph to introduce the distribution's goals and highlights. Patch must be called to commit all changes.
func (*Distro) SetTitle ¶
SetTitle changes the distribution title as it would be displayed in isolation. For example, the distribution title might be "The Foo Distro" and display name could be "Foo". Patch must be called to commit all changes.
func (*Distro) Summary ¶
Summary returns the distribution summary, which is a short paragraph to introduce the distribution's goals and highlights.
type DistroList ¶
type DistroList struct {
*Value
}
The DistroList type represents a list of Distro objects.
func (*DistroList) For ¶
func (list *DistroList) For(f func(d *Distro) error)
For iterates over the list of distributions and calls f for each one. If f returns a non-nil error, iteration will stop and the error will be returned as the result of For.
type DistroSeries ¶
type DistroSeries struct {
*Value
}
The DistroSeries type represents a series associated with a distribution.
func (*DistroSeries) Active ¶
func (s *DistroSeries) Active() bool
Active returns true if this distribution series is still in active development.
func (DistroSeries) Description ¶
func (d DistroSeries) Description() string
Description returns the distribution series' description.
func (*DistroSeries) DisplayName ¶
func (d *DistroSeries) DisplayName() string
DisplayName returns the distribution series display name (e.g. "Oneiric").
func (*DistroSeries) FullSeriesName ¶
func (d *DistroSeries) FullSeriesName() string
FullSeriesName returns the distribution series name as it would be displayed in a paragraph (e.g. "Oneiric Ocelot").
func (*DistroSeries) Name ¶
func (s *DistroSeries) Name() string
Name returns the series name, which is a unique name that identifies it and is used in URLs. It consists of only lowercase letters, digits, and simple punctuation. For example, "2.0" or "trunk".
func (*DistroSeries) SetActive ¶
func (s *DistroSeries) SetActive(active bool)
SetActive sets whether the series is still in active development or not.
func (*DistroSeries) SetName ¶
func (s *DistroSeries) SetName(name string)
SetName changes the series name, which must consists of only letters, numbers, and simple punctuation. For example: "2.0" or "trunk".
func (*DistroSeries) SetSummary ¶
func (s *DistroSeries) SetSummary(summary string)
SetSummary changes the summary for this distribution series.
func (*DistroSeries) SetTitle ¶
func (s *DistroSeries) SetTitle(title string)
SetTitle changes the series title.
func (*DistroSeries) SourcePackage ¶
func (d *DistroSeries) SourcePackage(name string) (*SourcePackage, error)
SourcePackage returns the SourcePackage with the given name.
func (*DistroSeries) Summary ¶
func (s *DistroSeries) Summary() string
Summary returns the summary for this distribution series.
func (*DistroSeries) Title ¶
func (s *DistroSeries) Title() string
Title returns the series context title for pages.
func (*DistroSeries) WebPage ¶
func (s *DistroSeries) WebPage() string
WebPage returns the URL for accessing this distribution series in a browser.
type DistroSeriesList ¶
type DistroSeriesList struct {
*Value
}
The DistroSeriesList represents a list of distribution series.
func (*DistroSeriesList) For ¶
func (list *DistroSeriesList) For(f func(s *DistroSeries) error) error
For iterates over the list of series and calls f for each one. If f returns a non-nil error, iteration will stop and the error will be returned as the result of For.
type DistroSourcePackage ¶
type DistroSourcePackage struct {
*Value
}
DistroSourcePackage represents a source package in a distribution.
func (*DistroSourcePackage) DisplayName ¶
func (s *DistroSourcePackage) DisplayName() string
DisplayName returns the package display name.
func (*DistroSourcePackage) Distro ¶
func (s *DistroSourcePackage) Distro() (*Distro, error)
Distro returns the distribution of this source package.
func (*DistroSourcePackage) Name ¶
func (s *DistroSourcePackage) Name() string
Name returns the package name.
func (*DistroSourcePackage) Title ¶
func (s *DistroSourcePackage) Title() string
Title returns the package title.
func (*DistroSourcePackage) WebPage ¶
func (s *DistroSourcePackage) WebPage() string
WebPage returns the URL for accessing this source package in a browser.
type Error ¶
type IRCNick ¶
type IRCNick struct {
*Value
}
func (*IRCNick) SetNetwork ¶
SetNetwork changes the IRC network this nick is associated to. Patch must be called to commit all changes.
type Member ¶
type Member interface { AnyValue DisplayName() string SetDisplayName(name string) Name() string SetName(name string) WebPage() string // Member is a marker function for types satisfying the // the Member interface. This is necessary for now because // the methods above are fairly common across several types, // but this will likely be dropped in the future. Member() }
Member is an interface implemented by both Person and Team.
type MemberList ¶
type MemberList struct {
*Value
}
The MemberList type encapsulates a mixed list containing Person and Team elements for iteration.
type MergeProposal ¶
type MergeProposal struct {
*Value
}
func (*MergeProposal) AddComment ¶
func (mp *MergeProposal) AddComment(subject, message string, vote ProposalVote, reviewType string) error
AddComment adds a new comment to mp.
func (*MergeProposal) CommitMessage ¶
func (mp *MergeProposal) CommitMessage() string
CommitMessage returns the commit message to be used when merging the source branch onto the target branch.
func (*MergeProposal) Description ¶
func (mp *MergeProposal) Description() string
Description returns the detailed description of the changes being proposed in the source branch of the merge proposal.
func (*MergeProposal) Email ¶
func (mp *MergeProposal) Email() string
Email returns the unique email that may be used to add new comments to the merge proposal conversation.
func (*MergeProposal) PreReq ¶
func (mp *MergeProposal) PreReq() (*Branch, error)
PreReq returns the branch is the base (merged or not) for the code within the target branch.
func (*MergeProposal) SetCommitMessage ¶
func (mp *MergeProposal) SetCommitMessage(msg string)
SetCommitMessage changes the commit message to be used when merging the source branch onto the target branch.
func (*MergeProposal) SetDescription ¶
func (mp *MergeProposal) SetDescription(description string)
SetDescription changes the detailed description of the changes being proposed in the source branch of the merge proposal.
func (*MergeProposal) SetStatus ¶
func (mp *MergeProposal) SetStatus(status MergeProposalStatus) error
SetStatus changes the current status of the merge proposal.
func (*MergeProposal) Source ¶
func (mp *MergeProposal) Source() (*Branch, error)
Source returns the source branch that has additional code to land.
func (*MergeProposal) Status ¶
func (mp *MergeProposal) Status() MergeProposalStatus
Status returns the current status of the merge proposal. E.g. Needs Review, Work In Progress, etc.
func (*MergeProposal) Target ¶
func (mp *MergeProposal) Target() (*Branch, error)
Target returns the branch where code will land on once merged.
func (*MergeProposal) WebPage ¶
func (mp *MergeProposal) WebPage() string
WebPage returns the URL for accessing this merge proposal in a browser.
type MergeProposalList ¶
type MergeProposalList struct {
*Value
}
The MergeProposalList represents a list of MergeProposal objects.
func (*MergeProposalList) For ¶
func (list *MergeProposalList) For(f func(t *MergeProposal) error) error
For iterates over the list of merge proposals and calls f for each one. If f returns a non-nil error, iteration will stop and the error will be returned as the result of For.
type MergeProposalStatus ¶
type MergeProposalStatus string
const ( StWorkInProgress MergeProposalStatus = "Work in progress" StNeedsReview MergeProposalStatus = "Needs review" StApproved MergeProposalStatus = "Approved" StRejected MergeProposalStatus = "Rejected" StMerged MergeProposalStatus = "Merged" StFailedToMerge MergeProposalStatus = "Code failed to merge" StQueued MergeProposalStatus = "Queued" StSuperseded MergeProposalStatus = "Superseded" )
type Milestone ¶
type Milestone struct {
*Value
}
The Milestone type represents a milestone associated with a project or distribution.
func (*Milestone) Name ¶
Name returns the milestone name, which consists of only letters, numbers, and simple punctuation.
func (Milestone) SetActive ¶
SetActive sets whether the milestone is still in active development or not.
func (*Milestone) SetCodeName ¶
SetCodeName sets the alternative name for the milestone.
func (*Milestone) SetName ¶
SetName changes the milestone name, which must consists of only letters, numbers, and simple punctuation.
func (*Milestone) SetSummary ¶
SetSummary sets the summary of features and status of this milestone.
type MilestoneList ¶
type MilestoneList struct {
*Value
}
The MilestoneList type represents a list of milestones that may be iterated over.
type OAuth ¶
type OAuth struct { BaseURL string // Defaults to https://(staging.)launchpad.net/ AuthURL string // Set by Login before Callback is called Callback func(*OAuth) error // Called by Login to get user to AuthURL CallbackURL string // Optional. AuthURL will redirect here after confirmation Token, TokenSecret string // Credentials obtained Consumer string // Consumer name. Defaults to "https://launchpad.net/lpad" Anonymous bool // Don't try to login }
The OAuth type enables authenticated sessions to be established with Launchpad using the oauth protocol. See StoredOAuth and ConsoleOAuth for more features added on top of this type.
For more details, see Launchpad's documentation on the subject:
https://help.launchpad.net/API/SigningRequests
type Params ¶
The Params type is a helper to pass parameter into the Value request methods. It may be used as:
value.Get(lpad.Params{"name": "value"})
type Person ¶
type Person struct {
*Value
}
The Person type represents a person in Launchpad.
func (*Person) DisplayName ¶
DisplayName returns the person's name as it would be displayed throughout Launchpad. Most people use their full name.
func (*Person) Member ¶
func (person *Person) Member()
Member is a marker method so Person satisfies the Member interface.
func (*Person) Name ¶
Name returns the person's short unique name, beginning with a lower-case letter or number, and containing only letters, numbers, dots, hyphens, or plus signs.
func (*Person) PreferredEmail ¶
PreferredEmail returns the Person's preferred email. If the user disabled public access to email addresses, this method returns an *Error with StatusCode of 404.
func (*Person) SetDisplayName ¶
SetDisplayName changes the person's name as it would be displayed throughout Launchpad. Most people use their full name. Patch must be called to commit all changes.
type PersonList ¶
type PersonList struct {
*Value
}
The PersonList type encapsulates a list of Person elements for iteration.
type Pocket ¶
type Pocket string
A Pocket represents the various distribution pockets where packages end up.
type Project ¶
type Project struct {
*Value
}
The Project type represents a project in Launchpad.
func (*Project) ActiveMilestones ¶
func (p *Project) ActiveMilestones() (*MilestoneList, error)
ActiveMilestones returns the list of active milestones associated with the project, ordered by the target date.
func (*Project) AllSeries ¶
func (p *Project) AllSeries() (*ProjectSeriesList, error)
AllSeries returns the list of series associated with the project.
func (*Project) BlueprintTarget ¶
func (p *Project) BlueprintTarget()
BlueprintTarget marks *Project as being a target for blueprints.
func (*Project) Description ¶
Description returns the project description.
func (*Project) DisplayName ¶
DisplayName returns the project name as it would be displayed in a paragraph. For example, a project's title might be "The Foo Project" and its display name could be "Foo".
func (*Project) FocusSeries ¶
func (p *Project) FocusSeries() (*ProjectSeries, error)
FocusSeries returns the development series set as the current development focus.
func (*Project) Name ¶
Name returns the project name, which is composed of at least one lowercase letter or number, followed by letters, numbers, dots, hyphens or pluses. This is a short name used in URLs.
func (*Project) SetDescription ¶
SetDescription changes the project's description. Patch must be called to commit all changes.
func (*Project) SetDisplayName ¶
SetDisplayName changes the project name as it would be displayed in a paragraph. For example, a project's title might be "The Foo Project" and its display name could be "Foo". Patch must be called to commit all changes.
func (*Project) SetName ¶
SetName changes the project name, which must be composed of at least one lowercase letter or number, followed by letters, numbers, dots, hyphens or pluses. This is a short name used in URLs. Patch must be called to commit all changes.
func (*Project) SetSummary ¶
SetSummary changes the project summary, which is a short paragraph to introduce the project's work. Patch must be called to commit all changes.
func (*Project) SetTitle ¶
SetTitle changes the project title as it would be displayed in isolation. For example, the project title might be "The Foo Project" and display name could be "Foo". Patch must be called to commit all changes.
func (*Project) Summary ¶
Summary returns the project summary, which is a short paragraph to introduce the project's work.
type ProjectSeries ¶
type ProjectSeries struct {
*Value
}
The ProjectSeries type represents a series associated with a project.
func (*ProjectSeries) Active ¶
func (s *ProjectSeries) Active() bool
Active returns true if this project series is still in active development.
func (*ProjectSeries) Branch ¶
func (s *ProjectSeries) Branch() (*Branch, error)
Branch returns the Bazaar branch associated with this project series.
func (*ProjectSeries) Name ¶
func (s *ProjectSeries) Name() string
Name returns the series name, which is a unique name that identifies it and is used in URLs. It consists of only lowercase letters, digits, and simple punctuation. For example, "2.0" or "trunk".
func (*ProjectSeries) SetActive ¶
func (s *ProjectSeries) SetActive(active bool)
SetActive sets whether the series is still in active development or not.
func (*ProjectSeries) SetBranch ¶
func (s *ProjectSeries) SetBranch(branch *Branch)
SetBranch changes the Bazaar branch associated with this project series.
func (*ProjectSeries) SetName ¶
func (s *ProjectSeries) SetName(name string)
SetName changes the series name, which must consists of only letters, numbers, and simple punctuation. For example: "2.0" or "trunk".
func (*ProjectSeries) SetSummary ¶
func (s *ProjectSeries) SetSummary(summary string)
SetSummary changes the summary for this project series.
func (*ProjectSeries) SetTitle ¶
func (s *ProjectSeries) SetTitle(title string)
SetTitle changes the series title.
func (*ProjectSeries) Summary ¶
func (s *ProjectSeries) Summary() string
Summary returns the summary for this project series.
func (*ProjectSeries) Title ¶
func (s *ProjectSeries) Title() string
Title returns the series context title for pages.
func (*ProjectSeries) WebPage ¶
func (s *ProjectSeries) WebPage() string
WebPage returns the URL for accessing this project series in a browser.
type ProjectSeriesList ¶
type ProjectSeriesList struct {
*Value
}
The ProjectSeriesList represents a list of project series.
func (*ProjectSeriesList) For ¶
func (list *ProjectSeriesList) For(f func(s *ProjectSeries) error) error
For iterates over the list of series and calls f for each one. If f returns a non-nil error, iteration will stop and the error will be returned as the result of For.
type ProposalVote ¶
type ProposalVote string
const ( VoteNone ProposalVote = "" VoteApprove ProposalVote = "Approve" VoteNeedsFixing ProposalVote = "Needs Fixing" VoteNeedsInfo ProposalVote = "Needs Information" VoteAbstain ProposalVote = "Abstain" VoteDisapprove ProposalVote = "Disapprove" VoteResubmit ProposalVote = "Resubmit" )
type Publication ¶
type Publication struct {
*Value
}
The Publication type holds a source package's publication record.
func (*Publication) Archive ¶
func (p *Publication) Archive() (*Archive, error)
Archive returns the archive published into.
func (*Publication) Component ¶
func (p *Publication) Component() string
Component returns the component name published into.
func (*Publication) DistroSeries ¶
func (p *Publication) DistroSeries() (*DistroSeries, error)
DistroSeries returns the distro series published into.
func (*Publication) PackageName ¶
func (p *Publication) PackageName() string
PackageName returns the name of the published source package.
func (*Publication) PackageVersion ¶
func (p *Publication) PackageVersion() string
PackageName returns the version of the published source package.
type PublicationList ¶
type PublicationList struct {
*Value
}
PublicationList represents a list of Publication objects.
func (*PublicationList) For ¶
func (list *PublicationList) For(f func(s *Publication) error) error
For iterates over the list of publication objects and calls f for each one. If f returns a non-nil error, iteration will stop and the error will be returned as the result of For.
type PublishStatus ¶
type PublishStatus string
const ( PubPending PublishStatus = "Pending" PubPublished PublishStatus = "Published" PubSuperseded PublishStatus = "Superseded" PubDeleted PublishStatus = "Deleted" PubObsolete PublishStatus = "Obsolete" )
type Root ¶
type Root struct {
*Value
}
The Root type provides the entrance for the Launchpad API.
func Login ¶
Login returns a Root object with a new session authenticated in Launchpad using the auth authenticator. This is the primary method to start using the Launchpad API.
This simple example demonstrates how to get a user's name in a console application:
oauth := &lpad.ConsoleOAuth{Consumer: "your-app"} root, err := lpad.Login(lpad.Production, oauth) check(err) me, err := root.Me() check(err) fmt.Println(me.DisplayName())
Alternatively, it is possible to communicate with Launchpad anonymously:
oauth := &lpad.ConsoleOAuth{Consumer: "your-app", Anonymous: true} root, err := lpad.Login(lpad.Production, oauth) check(err)
func (*Root) Blueprint ¶
func (root *Root) Blueprint(target BlueprintTarget, name string) (*Blueprint, error)
Blueprint returns the named blueprint associated with target.
func (*Root) Branch ¶
Branch returns a branch for the provided URL. The URL can be in the short form lp: notation, or the web address rooted at http://bazaar.launchpad.net/
func (*Root) Builders ¶
func (root *Root) Builders() (*BuilderList, error)
Builders returns all the builders.
func (*Root) Distros ¶
func (root *Root) Distros() (*DistroList, error)
Distros returns the list of all distributions registered in Launchpad.
func (*Root) FindMembers ¶
func (root *Root) FindMembers(text string) (*MemberList, error)
FindMembers returns a MemberList containing all Person or Team accounts whose Name, DisplayName or email address match text.
func (*Root) FindPeople ¶
func (root *Root) FindPeople(text string) (*PersonList, error)
FindPeople returns a PersonList containing all Person accounts whose Name, DisplayName or email address match text.
func (*Root) FindTeams ¶
FindTeams returns a TeamList containing all Team accounts whose Name, DisplayName or email address match text.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
The Session type represents a session of communication with Launchpad, and carries the authenticator necessary to validate requests in the given session. Creating sessions explicitly is generally not necessary. See the Login method for a convenient way to use lpad to access the Launchpad API.
func NewSession ¶
Create a new session using the auth authenticator. Creating sessions explicitly is generally not necessary. See the Login method for a convenient way to use lpad to access the Launchpad API.
type SourcePackage ¶
type SourcePackage struct {
*Value
}
SourcePackage represents a source package associated to a particular distribution series.
func (*SourcePackage) DisplayName ¶
func (s *SourcePackage) DisplayName() string
DisplayName returns the package display name.
func (*SourcePackage) Distro ¶
func (s *SourcePackage) Distro() (*Distro, error)
Distro returns the distribution for this source package.
func (*SourcePackage) DistroSeries ¶
func (s *SourcePackage) DistroSeries() (*DistroSeries, error)
DistroSeries returns the distribution series for the source package.
func (*SourcePackage) LatestComponent ¶
func (s *SourcePackage) LatestComponent() string
LatestComponent returns the name of the component where the source package was last published.
func (*SourcePackage) WebPage ¶
func (s *SourcePackage) WebPage() string
WebPage returns the URL for accessing this source package in a browser.
type StoredOAuth ¶
type StoredOAuth OAuth
The StoredOAuth type behaves like OAuth, but will cache a successful authentication in ~/.lpad_oauth and reuse it in future Login requests.
See the OAuth type for details on how to construct values of this type, and see the Login method for a convenient way to make use of them.
func (*StoredOAuth) Login ¶
func (oauth *StoredOAuth) Login(baseURL string) error
type Team ¶
type Team struct {
*Value
}
The Team type encapsulates access to details about a team in Launchpad.
func (*Team) DisplayName ¶
DisplayName returns the team's name as it would be displayed throughout Launchpad.
func (*Team) Member ¶
func (team *Team) Member()
Member is a marker method so Team satisfies the Member interface.
func (*Team) Name ¶
Name returns the team's name. This is a short unique name, beginning with a lower-case letter or number, and containing only letters, numbers, dots, hyphens, or plus signs.
func (*Team) SetDisplayName ¶
SetDisplayName changes the team's name as it would be displayed throughout Launchpad. Patch must be called to commit all changes.
type TeamList ¶
type TeamList struct {
*Value
}
The TeamList type encapsulates a list of Team elements for iteration.
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
The Value type is the underlying dynamic layer used as the foundation of all the more specific value types that support the Launchpad model. Besides being used internally to implement these types, the methods of this type also enable accessing new features available in Launchpad which were not yet made available in lpad thorugh more convenient methods.
func NewValue ¶
NewValue creates a new Value with the provided details. Creating values explicitly is generally not necessary. If you're trying to access a location in the Launchpad API which is not covered by the supported types yet, see the Link and Location methods on the Value type for more convenient ways to create values.
func (*Value) BaseLoc ¶
BaseLoc returns the API-oriented URL base for the session. Absolute paths provided to Location and Link will be rooted at this place.
func (*Value) BoolField ¶
BoolField returns the named value field if it exists and is set to a bool value, or false otherwise.
func (*Value) FloatField ¶
FloatField returns the named value field if it exists and is set to a float64 value, or zero otherwise.
func (*Value) For ¶
For iterates over every element in a collection and calls the provided function for each entry. If the function returns a non-nil err value, the iteration will stop. Watch out for very large collections!
func (*Value) Get ¶
Get issues an HTTP GET to retrieve the content of this value, and returns itself and an error in case of problems. If params is not nil, it will provided as the query for the GET request.
Since Get returns the value itself, it may be used as:
v, err := other.Link("some_link").Get(nil)
func (*Value) IntField ¶
IntField returns the named value field if it exists and is set to an int value, or zero otherwise.
func (*Value) IsValid ¶
IsValid returns true if the value is initialized and thus not nil. This provided mainly as a convenience for all the types that embed a *Value.
func (*Value) Link ¶
Link calls Location with a URL available in the given key of the current value's Map. It returns nil if the requested key isn't found in the value. This is a convenient way to navigate through *_link fields in values.
func (*Value) Location ¶
Location returns a new value for a location which may be a full URL, or an absolute path (based on the value's BaseLoc), or a path relative to the value itself (based on the value's URL).
func (*Value) Patch ¶
Patch issues an HTTP PATCH request to modify the server value with the local changes.
func (*Value) Post ¶
Post issues an HTTP POST to perform a given action at the URL specified by this value. If params is not nil, it will provided as the parameters for the POST request.
func (*Value) Session ¶
Session returns the session for the interaction with Launchpad. This session is used to sign any requests delivered to Launchpad.
func (*Value) StartIndex ¶
StartIndex returns the offset of the first value in a collection.
func (*Value) StringField ¶
StringField returns the named value field if it exists and is set to a string value, or the empty string otherwise.
func (*Value) StringListField ¶
StringListField returns the named value field if it exists and is set to a string list value, or an empty list otherwise.