lpad

package module
v0.0.0-...-96aeea6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2014 License: GPL-3.0 Imports: 15 Imported by: 0

README

lpad

A fork of https://launchpad.net/lpad. Eventually this will get pushed back to that repo. While I work on it. I prefer to use git.

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

Constants

This section is empty.

Variables

View Source
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

func SetDebug

func SetDebug(debug bool)

SetDebug enables debugging. With debug on requests and responses will all be dumped into the standard error output.

Types

type APIBase

type APIBase string
const (
	Production APIBase = "https://api.launchpad.net/devel/"
	Staging    APIBase = "https://api.staging.launchpad.net/devel/"
)

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

func (a *Archive) Description() string

Description returns a description string for this archive.

func (*Archive) DisplayName

func (a *Archive) DisplayName() string

DisplayName returns the user friendly name of this archive.

func (*Archive) Distro

func (a *Archive) Distro() (*Distro, error)

Distro returns the distribution that uses this archive.

func (*Archive) Name

func (a *Archive) Name() string

Name returns the 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.

func (*Archive) WebPage

func (a *Archive) WebPage() string

WebPage returns the URL for accessing this archive in a browser.

type ArchiveList

type ArchiveList struct {
	*Value
}

ArchiveList represents a list of Archive objects.

func (*ArchiveList) For

func (list *ArchiveList) For(f func(a *Archive) error) error

For iterates over the list of archive 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 Auth

type Auth interface {
	Login(baseURL string) (err error)
	Sign(req *http.Request) (err error)
}

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

func (bp *Blueprint) LinkBranch(branch *Branch) error

LinkBranch associates a branch with this blueprint.

func (*Blueprint) LinkBug

func (bp *Blueprint) LinkBug(bug *Bug) error

LinkBug associates a bug with this blueprint.

func (*Blueprint) Name

func (bp *Blueprint) Name() string

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

func (bp *Blueprint) SetName(name string)

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

func (bp *Blueprint) SetSummary(summary string)

SetSummary changes the blueprint summary which must consist of a single paragraph description of the feature.

func (*Blueprint) SetTitle

func (bp *Blueprint) SetTitle(title string)

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

func (bp *Blueprint) SetWhiteboard(whiteboard string)

SetWhiteboard changes the blueprint whiteboard that may contain any notes on the status of this specification.

func (*Blueprint) Summary

func (bp *Blueprint) Summary() string

Summary returns the blueprint summary which should consist of a single paragraph description of the feature.

func (*Blueprint) Title

func (bp *Blueprint) Title() string

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) WebPage

func (bp *Blueprint) WebPage() string

WebPage returns the URL for accessing this blueprint in a browser.

func (*Blueprint) Whiteboard

func (bp *Blueprint) Whiteboard() string

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

func (b *Branch) Id() string

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) Owner

func (b *Branch) Owner() (*Person, error)

Owner returns the Person that owns this branch.

func (*Branch) OwnerName

func (b *Branch) OwnerName() string

OwnerName returns the name from the owner of this branch.

func (*Branch) ProjectName

func (b *Branch) ProjectName() string

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

func (b *Branch) RevisionCount() int

RevisionCount returns the revision number of the tip of the branch

func (*Branch) UniqueName

func (b *Branch) UniqueName() string

UniqueName returns the unique branch name, in the form lp:~user/project/branch-name.

func (*Branch) WebPage

func (b *Branch) WebPage() string

WebPage returns the URL for accessing this branch in a browser.

type BranchTip

type BranchTip struct {
	UniqueName     string
	Revision       string
	OfficialSeries []string
}

type Bug

type Bug struct {
	*Value
}

The Bug type represents a bug in Launchpad.

func (*Bug) DateCreated

func (bug *Bug) DateCreated() string

func (*Bug) DateLastMessage

func (bug *Bug) DateLastMessage() string

func (*Bug) DateLastUpdated

func (bug *Bug) DateLastUpdated() string

func (*Bug) DateLatestPatchUploaded

func (bug *Bug) DateLatestPatchUploaded() string

func (*Bug) Description

func (bug *Bug) Description() string

Description returns the main bug description.

func (*Bug) Heat

func (bug *Bug) Heat() int

func (*Bug) Id

func (bug *Bug) Id() int

Id returns the bug numeric identifier (the bug # itself).

func (*Bug) IsExpirable

func (bug *Bug) IsExpirable() bool

func (*Bug) LinkBranch

func (bug *Bug) LinkBranch(branch *Branch) error

LinkBranch associates a branch with this bug.

func (*Bug) Owner

func (bug *Bug) Owner() (*Person, error)

func (*Bug) Private

func (bug *Bug) Private() bool

Private returns true if the bug is flagged as private.

func (*Bug) SecurityRelated

func (bug *Bug) SecurityRelated() bool

SecurityRelated returns true if the bug describes sensitive information about a security vulnerability.

func (*Bug) SetDescription

func (bug *Bug) SetDescription(description string)

SetDescription changes the bug description. Patch must be called to commit all changes.

func (*Bug) SetPrivate

func (bug *Bug) SetPrivate(private bool)

SetPrivate changes the bug private flag. Patch must be called to commit all changes.

func (*Bug) SetSecurityRelated

func (bug *Bug) SetSecurityRelated(related bool)

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) SetTags

func (bug *Bug) SetTags(tags []string)

SetTags changes the bug tags. Patch must be called to commit all changes.

func (*Bug) SetTitle

func (bug *Bug) SetTitle(title string)

SetTitle changes the bug title. Patch must be called to commit all changes.

func (*Bug) Tags

func (bug *Bug) Tags() []string

Tags returns the set of tags associated with the bug.

func (*Bug) Tasks

func (bug *Bug) Tasks() (*BugTaskList, error)

Tasks returns the list of bug tasks associated with the bug.

func (*Bug) Title

func (bug *Bug) Title() string

Title returns the short bug summary.

func (*Bug) WebPage

func (bug *Bug) WebPage() string

WebPage returns the URL for accessing this bug in a browser.

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) Assignee

func (task *BugTask) Assignee() (*Person, error)

Assignee returns the person currently assigned to work on the task.

func (*BugTask) BugTargetDisplayName

func (task *BugTask) BugTargetDisplayName() string

func (*BugTask) BugTargetName

func (task *BugTask) BugTargetName() string

func (*BugTask) DateAssigned

func (task *BugTask) DateAssigned() string

func (*BugTask) DateClosed

func (task *BugTask) DateClosed() string

func (*BugTask) DateConfirmed

func (task *BugTask) DateConfirmed() string

func (*BugTask) DateCreated

func (task *BugTask) DateCreated() string

func (*BugTask) DateFixCommitted

func (task *BugTask) DateFixCommitted() string

func (*BugTask) DateFixReleased

func (task *BugTask) DateFixReleased() string

func (*BugTask) DateInProgress

func (task *BugTask) DateInProgress() string

func (*BugTask) DateIncomplete

func (task *BugTask) DateIncomplete() string

func (*BugTask) DateLeftClosed

func (task *BugTask) DateLeftClosed() string

func (*BugTask) DateLeftNew

func (task *BugTask) DateLeftNew() string

func (*BugTask) DateTriaged

func (task *BugTask) DateTriaged() string

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 (task *BugTask) IsComplete() bool

func (*BugTask) Milestone

func (task *BugTask) Milestone() (*Milestone, error)

Milestone returns the milestone the task is currently targeted at.

func (*BugTask) Owner

func (task *BugTask) Owner() (*Person, error)

func (*BugTask) SetAssignee

func (task *BugTask) SetAssignee(person *Person)

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

func (task *BugTask) SetMilestone(ms *Milestone)

SetMilestone changes the milestone the task is currently targeted at.

func (*BugTask) SetStatus

func (task *BugTask) SetStatus(status BugStatus)

SetStatus changes the current status for the bug task. See the Status type for supported values.

func (*BugTask) Status

func (task *BugTask) Status() BugStatus

Status returns the current status for the bug task. See the Status type for supported values.

func (*BugTask) Title

func (task *BugTask) Title() string

type BugTaskList

type BugTaskList struct {
	*Value
}

BugTaskList represents a list of BugTasks for iteration.

func (*BugTaskList) For

func (list *BugTaskList) For(f func(bt *BugTask) error) error

For iterates over the list of bug tasks 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 Build

type Build struct {
	*Value
}

The Build type describes a package build.

func (*Build) Arch

func (build *Build) Arch() string

Arch returns the architecture of build.

func (*Build) BuildLogURL

func (build *Build) BuildLogURL() string

BuildLogURL returns the URL for the build log file.

func (*Build) Created

func (build *Build) Created() string

Created returns the timestamp when the build farm job was created.

func (*Build) Finished

func (build *Build) Finished() string

Finished returns the timestamp when the build farm job was finished.

func (*Build) Publication

func (build *Build) Publication() (*Publication, error)

Publication returns the source publication record corresponding to build.

func (*Build) Retry

func (build *Build) Retry() error

Retry sends a failed build back to the builder farm.

func (*Build) State

func (build *Build) State() BuildState

State returns the state of build.

func (*Build) Title

func (build *Build) Title() string

Title returns the build title.

func (*Build) UploadLogURL

func (build *Build) UploadLogURL() string

UploadLogURL returns the URL for the upload log if there was an upload failure.

func (*Build) WebPage

func (build *Build) WebPage() string

WebPage returns the URL for accessing this build in a browser.

type BuildList

type BuildList struct {
	*Value
}

The BuildList type represents a list of package Build objects.

func (*BuildList) For

func (bl *BuildList) For(f func(b *Build) error) error

For iterates over the list of package builds 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 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) Active

func (b *Builder) Active() bool

Active returns whether the builder is enabled.

func (*Builder) BuilderOK

func (b *Builder) BuilderOK() bool

BuilderOK returns whether the builder is working fine.

func (*Builder) Name

func (b *Builder) Name() string

Name returns the builder's name.

func (*Builder) Title

func (b *Builder) Title() string

Title returns the builder slave title.

func (*Builder) VMHost

func (b *Builder) VMHost() string

VMHost returns the machine hostname hosting the builder.

func (*Builder) Virtualized

func (b *Builder) Virtualized() bool

Virtualized returns whether the builder is virtualized Xen instance.

func (*Builder) WebPage

func (b *Builder) WebPage() string

WebPage returns the URL for accessing this builder in a browser.

type BuilderList

type BuilderList struct {
	*Value
}

A BuilderList represents a list of Builder objects.

func (*BuilderList) For

func (list *BuilderList) For(f func(b *Builder) error) error

For iterates over the list of builders 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 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

func (*ConsoleOAuth) Sign

func (oauth *ConsoleOAuth) Sign(req *http.Request) 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) Archive

func (d *Distro) Archive(name string) (*Archive, error)

Archive returns the named archive 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

func (d *Distro) BranchTips(since time.Time) (tips []BranchTip, err error)

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

func (d *Distro) Description() string

Description returns the distribution description.

func (*Distro) DisplayName

func (d *Distro) DisplayName() string

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

func (d *Distro) Name() string

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

func (d *Distro) SetDescription(description string)

SetDescription changes the distributions's description. Patch must be called to commit all changes.

func (*Distro) SetDisplayName

func (d *Distro) SetDisplayName(name string)

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

func (d *Distro) SetName(name string)

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

func (d *Distro) SetSummary(title string)

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

func (d *Distro) SetTitle(title string)

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

func (d *Distro) Summary() string

Summary returns the distribution summary, which is a short paragraph to introduce the distribution's goals and highlights.

func (*Distro) Title

func (d *Distro) Title() string

Title returns the distribution title as it might be used in isolation.

func (*Distro) WebPage

func (d *Distro) WebPage() string

WebPage returns the URL for accessing this distribution in a browser.

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 Error struct {
	StatusCode int    // HTTP status code (500, 403, ...)
	Body       []byte // Body of response
}

func (*Error) Error

func (e *Error) Error() string

type IRCNick

type IRCNick struct {
	*Value
}

func (*IRCNick) Network

func (nick *IRCNick) Network() string

Network returns the IRC network this nick is associated to.

func (*IRCNick) Nick

func (nick *IRCNick) Nick() string

Nick returns the person's nick on an IRC network.

func (*IRCNick) SetNetwork

func (nick *IRCNick) SetNetwork(n string)

SetNetwork changes the IRC network this nick is associated to. Patch must be called to commit all changes.

func (*IRCNick) SetNick

func (nick *IRCNick) SetNick(n string)

SetNick changes the person's nick on an IRC network. 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.

func (*MemberList) For

func (list *MemberList) For(f func(v Member) error) error

For iterates over the list of people and teams 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 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 MergeStub

type MergeStub struct {
	Description   string
	CommitMessage string
	NeedsReview   bool
	Target        *Branch
	PreReq        *Branch
}

type Milestone

type Milestone struct {
	*Value
}

The Milestone type represents a milestone associated with a project or distribution.

func (*Milestone) Active

func (ms *Milestone) Active() bool

Active returns true if the milestone is still in active development.

func (*Milestone) CodeName

func (ms *Milestone) CodeName() string

CodeName returns the alternative name for the milestone, if any.

func (*Milestone) Date

func (ms *Milestone) Date() string

Date returns the target date for the milestone.

func (*Milestone) Name

func (ms *Milestone) Name() string

Name returns the milestone name, which consists of only letters, numbers, and simple punctuation.

func (Milestone) SetActive

func (ms Milestone) SetActive(active bool)

SetActive sets whether the milestone is still in active development or not.

func (*Milestone) SetCodeName

func (ms *Milestone) SetCodeName(name string)

SetCodeName sets the alternative name for the milestone.

func (*Milestone) SetDate

func (ms *Milestone) SetDate(date string)

SetDate changes the target date for the milestone.

func (*Milestone) SetName

func (ms *Milestone) SetName(name string)

SetName changes the milestone name, which must consists of only letters, numbers, and simple punctuation.

func (*Milestone) SetSummary

func (ms *Milestone) SetSummary(summary string)

SetSummary sets the summary of features and status of this milestone.

func (*Milestone) SetTitle

func (ms *Milestone) SetTitle(title string)

SetTitle changes the milestone's context title for pages.

func (*Milestone) Summary

func (ms *Milestone) Summary() string

Summary returns the summary of features and status of this milestone.

func (*Milestone) Title

func (ms *Milestone) Title() string

Title returns the milestone context title for pages.

func (*Milestone) WebPage

func (ms *Milestone) WebPage() string

WebPage returns the URL for accessing this milestone in a browser.

type MilestoneList

type MilestoneList struct {
	*Value
}

The MilestoneList type represents a list of milestones that may be iterated over.

func (*MilestoneList) For

func (list *MilestoneList) For(f func(m *Milestone) error) error

For iterates over the list of milestones 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 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

func (*OAuth) Login

func (oauth *OAuth) Login(baseURL string) error

func (*OAuth) Sign

func (oauth *OAuth) Sign(req *http.Request) error

type Params

type Params map[string]string

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

func (person *Person) DisplayName() string

DisplayName returns the person's name as it would be displayed throughout Launchpad. Most people use their full name.

func (*Person) IRCNicks

func (person *Person) IRCNicks() (nicks []*IRCNick, err error)

IRCNicks returns a list of all IRC nicks for the person.

func (*Person) Member

func (person *Person) Member()

Member is a marker method so Person satisfies the Member interface.

func (*Person) Name

func (person *Person) Name() string

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

func (person *Person) PreferredEmail() (string, error)

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

func (person *Person) SetDisplayName(name string)

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.

func (*Person) SetName

func (person *Person) SetName(name string)

SetName changes the person's short unique name. The name must begin with a lower-case letter or number, and contain only letters, numbers, dots, hyphens, or plus signs.

func (*Person) WebPage

func (person *Person) WebPage() string

WebPage returns the URL for accessing this person's page in a browser.

type PersonList

type PersonList struct {
	*Value
}

The PersonList type encapsulates a list of Person elements for iteration.

func (*PersonList) For

func (list *PersonList) For(f func(p *Person) error) error

For iterates over the list of people 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 Pocket

type Pocket string

A Pocket represents the various distribution pockets where packages end up.

const (
	PocketAny       Pocket = ""
	PocketRelease   Pocket = "Release"
	PocketSecurity  Pocket = "Security"
	PocketUpdates   Pocket = "Updates"
	PocketProposed  Pocket = "Proposed"
	PocketBackports Pocket = "Backports"
)

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

func (p *Project) Description() string

Description returns the project description.

func (*Project) DisplayName

func (p *Project) DisplayName() string

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

func (p *Project) Name() string

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

func (p *Project) SetDescription(description string)

SetDescription changes the project's description. Patch must be called to commit all changes.

func (*Project) SetDisplayName

func (p *Project) SetDisplayName(name string)

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

func (p *Project) SetName(name string)

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

func (p *Project) SetSummary(title string)

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

func (p *Project) SetTitle(title string)

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

func (p *Project) Summary() string

Summary returns the project summary, which is a short paragraph to introduce the project's work.

func (*Project) Title

func (p *Project) Title() string

Title returns the project title as it might be used in isolation. For example, a project's title might be "The Foo Project" and its display name could be "Foo".

func (*Project) WebPage

func (p *Project) WebPage() string

WebPage returns the URL for accessing this project in a browser.

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

func Login(baseurl APIBase, auth Auth) (*Root, error)

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

func (root *Root) Branch(burl string) (*Branch, error)

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) Bug

func (root *Root) Bug(id int) (*Bug, error)

CreateBug creates a new bug with an appropriate bug task and returns it.

func (*Root) Build

func (root *Root) Build(distro string, source string, version string, id int) (*Build, error)

Build returns the identified package build.

func (*Root) Builder

func (root *Root) Builder(name string) (*Builder, error)

Builder returns a builder by its name.

func (*Root) Builders

func (root *Root) Builders() (*BuilderList, error)

Builders returns all the builders.

func (*Root) CreateBug

func (root *Root) CreateBug(stub *BugStub) (*Bug, error)

CreateBug creates a new bug with an appropriate bug task and returns it.

func (*Root) Distro

func (root *Root) Distro(name string) (*Distro, error)

Distro returns a distribution with the given name.

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

func (root *Root) FindTeams(text string) (*TeamList, error)

FindTeams returns a TeamList containing all Team accounts whose Name, DisplayName or email address match text.

func (*Root) Me

func (root *Root) Me() (*Person, error)

Me returns the Person authenticated into Lauchpad in the current session.

func (*Root) Member

func (root *Root) Member(name string) (Member, error)

Member returns the Team or Person with the provided name or username.

func (*Root) Project

func (root *Root) Project(name string) (*Project, error)

Project returns a project with the given name.

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

func NewSession(auth Auth) *Session

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.

func (*Session) Sign

func (s *Session) Sign(req *http.Request) (err error)

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) Name

func (s *SourcePackage) Name() string

Name returns the package name.

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

func (*StoredOAuth) Sign

func (oauth *StoredOAuth) Sign(req *http.Request) error

type Team

type Team struct {
	*Value
}

The Team type encapsulates access to details about a team in Launchpad.

func (*Team) DisplayName

func (team *Team) DisplayName() string

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

func (team *Team) Name() string

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

func (team *Team) SetDisplayName(name string)

SetDisplayName changes the team's name as it would be displayed throughout Launchpad. Patch must be called to commit all changes.

func (*Team) SetName

func (team *Team) SetName(name string)

SetName changes 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. Patch must be called to commit all changes.

func (*Team) WebPage

func (team *Team) WebPage() string

WebPage returns the URL for accessing this team's page in a browser.

type TeamList

type TeamList struct {
	*Value
}

The TeamList type encapsulates a list of Team elements for iteration.

func (*TeamList) For

func (list *TeamList) For(f func(t *Team) error) error

For iterates over the list of teams 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 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

func NewValue(session *Session, baseloc, loc string, m map[string]interface{}) *Value

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) AbsLoc

func (v *Value) AbsLoc() string

AbsLoc returns the API-oriented URL of this value.

func (*Value) BaseLoc

func (v *Value) BaseLoc() string

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

func (v *Value) BoolField(key string) bool

BoolField returns the named value field if it exists and is set to a bool value, or false otherwise.

func (*Value) FloatField

func (v *Value) FloatField(key string) float64

FloatField returns the named value field if it exists and is set to a float64 value, or zero otherwise.

func (*Value) For

func (v *Value) For(f func(*Value) error) (err error)

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

func (v *Value) Get(params Params) (same *Value, err error)

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

func (v *Value) IntField(key string) int

IntField returns the named value field if it exists and is set to an int value, or zero otherwise.

func (*Value) IsValid

func (v *Value) IsValid() bool

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 (v *Value) Link(key string) *Value

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

func (v *Value) Location(loc string) *Value

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) Map

func (v *Value) Map() map[string]interface{}

Map returns the dynamic map with the content of this value.

func (*Value) Patch

func (v *Value) Patch() error

Patch issues an HTTP PATCH request to modify the server value with the local changes.

func (*Value) Post

func (v *Value) Post(params Params) (other *Value, err error)

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

func (v *Value) Session() *Session

Session returns the session for the interaction with Launchpad. This session is used to sign any requests delivered to Launchpad.

func (*Value) SetField

func (v *Value) SetField(key string, value interface{})

SetField changes the named field with the provided value.

func (*Value) StartIndex

func (v *Value) StartIndex() int

StartIndex returns the offset of the first value in a collection.

func (*Value) StringField

func (v *Value) StringField(key string) string

StringField returns the named value field if it exists and is set to a string value, or the empty string otherwise.

func (*Value) StringListField

func (v *Value) StringListField(key string) []string

StringListField returns the named value field if it exists and is set to a string list value, or an empty list otherwise.

func (*Value) TotalSize

func (v *Value) TotalSize() int

TotalSize returns the total number of entries in a collection.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL