Documentation ¶
Overview ¶
Package platformclient manages channels and releases through the Replicated Vendor API.
Index ¶
- Variables
- type AppChannels
- type AppOptions
- type BadRequest
- type ChannelOptions
- type ChannelReleases
- type Client
- type HTTPClient
- func (c *HTTPClient) ArchiveChannel(appID, channelID string) error
- func (c *HTTPClient) CreateApp(opts *AppOptions) (*apps.App, error)
- func (c *HTTPClient) CreateChannel(appID string, name string, description string) error
- func (c *HTTPClient) CreateLicense(license *v2.LicenseV2) (*v2.LicenseV2, error)
- func (c *HTTPClient) CreateRelease(appID string, yaml string) (*releases.AppReleaseInfo, error)
- func (c *HTTPClient) DeleteApp(id string) error
- func (c *HTTPClient) GetApp(slugOrID string) (*apps.App, error)
- func (c *HTTPClient) GetChannel(appID, channelID string) (*channels.AppChannel, []channels.ChannelRelease, error)
- func (c *HTTPClient) GetRelease(appID string, sequence int64) (*releases.AppRelease, error)
- func (c *HTTPClient) LintRelease(appID string, yaml string) ([]types.LintMessage, error)
- func (c *HTTPClient) ListApps() ([]apps.AppAndChannels, error)
- func (c *HTTPClient) ListChannels(appID string) ([]channels.AppChannel, error)
- func (c *HTTPClient) ListReleases(appID string) ([]releases.AppReleaseInfo, error)
- func (c *HTTPClient) PromoteCollector(appID string, specID string, channelIDs ...string) error
- func (c *HTTPClient) PromoteRelease(appID string, sequence int64, label, notes string, required bool, ...) error
- func (c *HTTPClient) UpdateRelease(appID string, sequence int64, yaml string) error
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("Not found")
ErrNotFound represnets a 404 response from the API.
Functions ¶
This section is empty.
Types ¶
type AppChannels ¶
type AppChannels []channels.AppChannel
AppChannels sorts []channels.AppChannel by Channel.Position
func (AppChannels) Len ¶
func (acs AppChannels) Len() int
func (AppChannels) Less ¶
func (acs AppChannels) Less(i, j int) bool
func (AppChannels) Swap ¶
func (acs AppChannels) Swap(i, j int)
type AppOptions ¶
type AppOptions struct {
Name string
}
type BadRequest ¶
BadRequest represents a 400 response from the API.
func (*BadRequest) Error ¶
func (br *BadRequest) Error() string
Error prints the MessageCode and Message returned from the API.
type ChannelOptions ¶
type ChannelReleases ¶
type ChannelReleases []channels.ChannelRelease
ChannelReleases sorts []channels.ChannelRelease newest to oldest
func (ChannelReleases) Len ¶
func (crs ChannelReleases) Len() int
func (ChannelReleases) Less ¶
func (crs ChannelReleases) Less(i, j int) bool
func (ChannelReleases) Swap ¶
func (crs ChannelReleases) Swap(i, j int)
type Client ¶
type Client interface { ListApps() ([]apps.AppAndChannels, error) GetApp(string) (*apps.App, error) CreateApp(opts *AppOptions) (*apps.App, error) ListChannels(string) ([]channels.AppChannel, error) CreateChannel(string, string, string) error ArchiveChannel(appID, channelID string) error GetChannel(appID, channelID string) (*channels.AppChannel, []channels.ChannelRelease, error) ListReleases(appID string) ([]releases.AppReleaseInfo, error) CreateRelease(appID string, yaml string) (*releases.AppReleaseInfo, error) UpdateRelease(appID string, sequence int64, yaml string) error GetRelease(appID string, sequence int64) (*releases.AppRelease, error) PromoteRelease(appID string, sequence int64, label string, notes string, required bool, channelIDs ...string) error LintRelease(string, string) ([]types.LintMessage, error) PromoteCollector(appID string, specID string, channelIDs ...string) error CreateLicense(*v2.LicenseV2) (*v2.LicenseV2, error) }
Client provides methods to manage apps, channels, and releases.
func NewHTTPClient ¶
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
An HTTPClient communicates with the Replicated Vendor HTTP API. TODO: rename this to client
func (*HTTPClient) ArchiveChannel ¶
func (c *HTTPClient) ArchiveChannel(appID, channelID string) error
ArchiveChannel archives a channel.
func (*HTTPClient) CreateApp ¶
func (c *HTTPClient) CreateApp(opts *AppOptions) (*apps.App, error)
CreateApp creates a new app with the given name and returns it.
func (*HTTPClient) CreateChannel ¶
func (c *HTTPClient) CreateChannel(appID string, name string, description string) error
CreateChannel adds a channel to an app.
func (*HTTPClient) CreateLicense ¶
CreateLicense creates a new License.
func (*HTTPClient) CreateRelease ¶
func (c *HTTPClient) CreateRelease(appID string, yaml string) (*releases.AppReleaseInfo, error)
CreateRelease adds a release to an app.
func (*HTTPClient) DeleteApp ¶
func (c *HTTPClient) DeleteApp(id string) error
DeleteApp deletes an app by id.
func (*HTTPClient) GetApp ¶
func (c *HTTPClient) GetApp(slugOrID string) (*apps.App, error)
GetApp resolves an app by either slug or ID.
func (*HTTPClient) GetChannel ¶
func (c *HTTPClient) GetChannel(appID, channelID string) (*channels.AppChannel, []channels.ChannelRelease, error)
GetChannel returns channel details and release history
func (*HTTPClient) GetRelease ¶
func (c *HTTPClient) GetRelease(appID string, sequence int64) (*releases.AppRelease, error)
GetRelease returns a release's properties.
func (*HTTPClient) LintRelease ¶ added in v0.8.0
func (c *HTTPClient) LintRelease(appID string, yaml string) ([]types.LintMessage, error)
func (*HTTPClient) ListApps ¶
func (c *HTTPClient) ListApps() ([]apps.AppAndChannels, error)
ListApps returns all apps and their channels.
func (*HTTPClient) ListChannels ¶
func (c *HTTPClient) ListChannels(appID string) ([]channels.AppChannel, error)
ListChannels returns all channels for an app.
func (*HTTPClient) ListReleases ¶
func (c *HTTPClient) ListReleases(appID string) ([]releases.AppReleaseInfo, error)
ListReleases lists all releases for an app.
func (*HTTPClient) PromoteCollector ¶ added in v0.12.0
func (c *HTTPClient) PromoteCollector(appID string, specID string, channelIDs ...string) error
Vendor-API: PromoteCollector points the specified channels at a named collector.
func (*HTTPClient) PromoteRelease ¶
func (c *HTTPClient) PromoteRelease(appID string, sequence int64, label, notes string, required bool, channelIDs ...string) error
PromoteRelease points the specified channels at a release sequence.
func (*HTTPClient) UpdateRelease ¶
func (c *HTTPClient) UpdateRelease(appID string, sequence int64, yaml string) error
UpdateRelease updates a release's yaml.