apprclient

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2020 License: Apache-2.0 Imports: 14 Imported by: 6

README

CircleCI

apprclient

Package apprclient implements Application Registry related primitives to work against some CNR implementation.

Projects using apprclient

Test libraries
Libraries
Services & operators

Documentation

Overview

Package apprclient holds the client code required to interact with a CNR backend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsInvalidStatusCode

func IsInvalidStatusCode(err error) bool

IsInvalidStatusCode asserts invalidStatusCodeError.

func IsUnknownStatus

func IsUnknownStatus(err error) bool

IsUnknownStatus asserts unknownStatusError.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client knows how to talk with a CNR server.

func New

func New(config Config) (*Client, error)

New creates a new configured appr client.

func (*Client) DeleteRelease

func (c *Client) DeleteRelease(ctx context.Context, name, release string) error

DeleteRelease removes a release from the server.

func (*Client) GetReleaseVersion

func (c *Client) GetReleaseVersion(ctx context.Context, name, channel string) (string, error)

GetReleaseVersion queries CNR for the release version of the chart represented by the given name and channel.

func (*Client) PromoteChart

func (c *Client) PromoteChart(ctx context.Context, name, release, channel string) error

PromoteChart puts a release of the given chart in a channel.

func (*Client) PullChartTarball

func (c *Client) PullChartTarball(ctx context.Context, name, channel string) (string, error)

PullChartTarball downloads a tarball with the chart described by the given chart name and channel, returning the file path.

func (*Client) PullChartTarballFromRelease

func (c *Client) PullChartTarballFromRelease(ctx context.Context, name, release string) (string, error)

PullChartTarballFromRelease downloads a tarball with the chart described by the given chart name and release, returning the file path.

func (*Client) PushChartTarball

func (c *Client) PushChartTarball(ctx context.Context, name, release, tarballPath string) error

PushChartTarball sends a tarball to the server to be installed for the given name and release.

type Config

type Config struct {
	Fs     afero.Fs
	Logger micrologger.Logger

	Address      string
	Organization string
}

Config represents the configuration used to create a appr client.

type Interface

type Interface interface {
	// DeleteRelease removes a release from the server.
	DeleteRelease(ctx context.Context, name, release string) error
	// GetReleaseVersion queries CNR for the release version of the chart
	// represented by the given name and channel.
	GetReleaseVersion(ctx context.Context, name, channel string) (string, error)
	// PromoteChart puts a release of the given chart in a channel.
	PromoteChart(ctx context.Context, name, release, channel string) error
	// PullChartTarball downloads a tarball with the chart described by
	// the given chart name and channel, returning the file path.
	PullChartTarball(ctx context.Context, name, channel string) (string, error)
	// PullChartTarballFromRelease downloads a tarball with the chart described
	// by the given chart name and release, returning the file path.
	PullChartTarballFromRelease(ctx context.Context, name, release string) (string, error)
	// PushChartTarball sends a tarball to the server to be installed for the given
	// name and release.
	PushChartTarball(ctx context.Context, name, release, tarballPath string) error
}

Interface describes the methods provided by the appr client.

type Payload

type Payload struct {
	Release   string `json:"release"`
	MediaType string `json:"media_type"`
	Blob      string `json:"blob"`
}

type Response

type Response struct {
	Status string `json:"status"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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