Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) CreatePackage(loc loc.Locator, data io.Reader, options ...pack.PackageOption) (*pack.PackageEnvelope, error)
- func (c *Client) Delete(u string) (*roundtrip.Response, error)
- func (c *Client) DeleteExpired() error
- func (c *Client) DeletePackage(locator loc.Locator) error
- func (c *Client) DeleteRepository(repository string) error
- func (c *Client) Get(u string, params url.Values) (*roundtrip.Response, error)
- func (c *Client) GetPackages(repository string) ([]pack.PackageEnvelope, error)
- func (c *Client) GetRepositories() ([]string, error)
- func (c *Client) GetRepository(repository string) (storage.Repository, error)
- func (c *Client) PackageDownloadURL(loc loc.Locator) string
- func (c *Client) PortalURL() string
- func (c *Client) PostForm(endpoint string, vals url.Values, files ...roundtrip.File) (*roundtrip.Response, error)
- func (c *Client) ReadPackage(loc loc.Locator) (*pack.PackageEnvelope, io.ReadCloser, error)
- func (c *Client) ReadPackageEnvelope(loc loc.Locator) (*pack.PackageEnvelope, error)
- func (c *Client) UpdatePackageLabels(loc loc.Locator, addLabels map[string]string, removeLabels []string) error
- func (c *Client) UpsertPackage(loc loc.Locator, data io.Reader, options ...pack.PackageOption) (*pack.PackageEnvelope, error)
- func (c *Client) UpsertRepository(repository string, expires time.Time) error
- type Config
- type Server
Constants ¶
View Source
const CurrentVersion = "pack/v1"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func NewAuthenticatedClient ¶
func NewAuthenticatedClient(addr, username, password string, params ...roundtrip.ClientParam) (*Client, error)
NewAuthenticatedClient returns client authenticated as a user with given password
func NewBearerClient ¶
func NewBearerClient(addr, token string, params ...roundtrip.ClientParam) (*Client, error)
NewBearerClient returns a new client that user bearer token for authentication
func (*Client) CreatePackage ¶
func (c *Client) CreatePackage(loc loc.Locator, data io.Reader, options ...pack.PackageOption) (*pack.PackageEnvelope, error)
func (*Client) DeleteExpired ¶
func (*Client) DeleteRepository ¶
func (*Client) GetPackages ¶
func (c *Client) GetPackages(repository string) ([]pack.PackageEnvelope, error)
func (*Client) GetRepositories ¶
func (*Client) GetRepository ¶
func (c *Client) GetRepository(repository string) (storage.Repository, error)
func (*Client) PostForm ¶
func (c *Client) PostForm( endpoint string, vals url.Values, files ...roundtrip.File) (*roundtrip.Response, error)
PostForm is a generic method that issues http POST request to the server
func (*Client) ReadPackage ¶
func (c *Client) ReadPackage(loc loc.Locator) (*pack.PackageEnvelope, io.ReadCloser, error)
func (*Client) ReadPackageEnvelope ¶
func (*Client) UpdatePackageLabels ¶
func (c *Client) UpdatePackageLabels(loc loc.Locator, addLabels map[string]string, removeLabels []string) error
UpdatePackageLabels updates package's labels
func (*Client) UpsertPackage ¶
func (c *Client) UpsertPackage(loc loc.Locator, data io.Reader, options ...pack.PackageOption) (*pack.PackageEnvelope, error)
type Config ¶
type Config struct { // Packages provides access to the package service. Packages pack.PackageService // Users provides access to the users service. Users users.Identity // Authenticator is used to authenticate requests. Authenticator users.Authenticator }
Config defines package service web handler configuration.
func (*Config) CheckAndSetDefaults ¶
CheckAndSetDefaults validates the request and sets some defaults.
type Server ¶
type Server struct { httprouter.Router // contains filtered or unexported fields }
func NewHandler ¶
Click to show internal directories.
Click to hide internal directories.