Documentation
¶
Index ¶
- type APIClient
- type Client
- type HttpClient
- func (c *HttpClient) Install(ctx context.Context, name string, chart string, values Values, ...) (string, error)
- func (c *HttpClient) List(ctx context.Context, fl flags.ListFlags) ([]release.Release, error)
- func (c *HttpClient) Status(ctx context.Context, name string, fl flags.StatusFlags) (release.Release, error)
- func (c *HttpClient) Uninstall(ctx context.Context, name string, fl flags.UninstallFlags) (release.Release, error)
- func (c *HttpClient) Upgrade(ctx context.Context, name string, chart string, values Values, ...) (string, error)
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient interface {
Send(url string, method string, body io.Reader) (*http.Response, []byte, error)
}
APIClient defines the contract for the http client implementation to send requests to the albatross api server
type Client ¶
type Client interface {
// List returns a list of release corresponding to the provided list flags
List(ctx context.Context, fl flags.ListFlags) ([]release.Release, error)
// Install installs a release, specified by the params, and returns a status
// TODO: We should have the api return the release object, instead of just the status
Install(ctx context.Context, name string, chart string, values Values, fl flags.InstallFlags) (string, error)
// Upgrade installs a release, specified by the params, and returns a status.
// UpgradeFlags govern the actions of upgrade action, i.e whether it should be installed if not present
Upgrade(ctx context.Context, name string, chart string, values Values, fl flags.UpgradeFlags) (string, error)
// Status returns the status of a release with the specific release and revision
Status(ctx context.Context, name string, fl flags.StatusFlags) (release.Release, error)
Uninstall(ctx context.Context, name string, fl flags.UninstallFlags) (release.Release, error)
}
Client represents a contract that a concrete client types(http/grpc) must implement
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
HttpClient is responsible to sending api requests and parsing their responses It embeds the base url of the albatross service and an underlying http apiclient that handles sending requests to the albatross api server
func (*HttpClient) Install ¶
func (c *HttpClient) Install(ctx context.Context, name string, chart string, values Values, fl flags.InstallFlags) (string, error)
Install calls the install api and returns the status TODO: Make install api return an installed release rather than just the status
func (*HttpClient) List ¶
List sends the list api request to the APIClient and returns a list of releases if successfull.
func (*HttpClient) Status ¶
func (c *HttpClient) Status(ctx context.Context, name string, fl flags.StatusFlags) (release.Release, error)