Documentation ¶
Overview ¶
Package platformclient manages channels and releases through the Replicated Vendor API.
Index ¶
- Variables
- type APIError
- type AppChannels
- type AppOptions
- type BadRequest
- type ChannelOptions
- type ChannelReleases
- 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) DoJSON(method string, path string, successStatus int, reqBody interface{}, ...) error
- func (c *HTTPClient) DoJSONWithoutUnmarshal(method string, path string, reqBody string) ([]byte, 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) HTTPGet(path string, successStatus int) ([]byte, 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 (
ErrForbidden = errors.New("the action is not allowed for the current user or team")
)
var ErrNotFound = errors.New("Not found")
ErrNotFound represents 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 HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
An HTTPClient communicates with the Replicated Vendor HTTP API. TODO: rename this to client
func NewHTTPClient ¶
func NewHTTPClient(origin string, apiKey string) *HTTPClient
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) DoJSON ¶ added in v0.29.0
func (c *HTTPClient) DoJSON(method string, path string, successStatus int, reqBody interface{}, respBody interface{}) error
func (*HTTPClient) DoJSONWithoutUnmarshal ¶ added in v0.47.0
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) HTTPGet ¶ added in v0.29.0
func (c *HTTPClient) HTTPGet(path string, successStatus int) ([]byte, error)
Minimal, simplified version of DoJSON for GET requests, just returns bytes
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.