Documentation ¶
Overview ¶
Package client connects to the Epinio API's endpoints
Index ¶
- type Client
- func (c *Client) AllApps() (models.AppList, error)
- func (c *Client) AllConfigurations() (models.ConfigurationResponseList, error)
- func (c *Client) AllServices() (models.ServiceList, error)
- func (c *Client) AppCreate(req models.ApplicationCreateRequest, namespace string) (models.Response, error)
- func (c *Client) AppDelete(namespace string, names []string) (models.ApplicationDeleteResponse, error)
- func (c *Client) AppDeploy(req models.DeployRequest) (*models.DeployResponse, error)
- func (c *Client) AppExec(ctx context.Context, namespace string, appName, instance string, ...) error
- func (c *Client) AppGetPart(namespace, appName, part, destinationPath string) error
- func (c *Client) AppImportGit(app models.AppRef, gitRef models.GitRef) (*models.ImportGitResponse, error)
- func (c *Client) AppLogs(namespace, appName, stageID string, follow bool, ...) error
- func (c *Client) AppMatch(namespace, prefix string) (models.AppMatchResponse, error)
- func (c *Client) AppPortForward(namespace string, appName, instance string, opts *PortForwardOpts) error
- func (c *Client) AppRestart(namespace string, appName string) error
- func (c *Client) AppRunning(app models.AppRef) (models.Response, error)
- func (c *Client) AppShow(namespace string, appName string) (models.App, error)
- func (c *Client) AppStage(req models.StageRequest) (*models.StageResponse, error)
- func (c *Client) AppUpdate(req models.ApplicationUpdateRequest, namespace string, appName string) (models.Response, error)
- func (c *Client) AppUpload(namespace string, name string, tarball string) (models.UploadResponse, error)
- func (c *Client) AppValidateCV(namespace string, name string) (models.Response, error)
- func (c *Client) Apps(namespace string) (models.AppList, error)
- func (c *Client) AuthToken() (string, error)
- func (c *Client) ChartList() ([]models.AppChart, error)
- func (c *Client) ChartMatch(prefix string) (models.ChartMatchResponse, error)
- func (c *Client) ChartShow(name string) (models.AppChart, error)
- func (c *Client) ConfigurationApps(namespace string) (models.ConfigurationAppsResponse, error)
- func (c *Client) ConfigurationBindingCreate(req models.BindRequest, namespace string, appName string) (models.BindResponse, error)
- func (c *Client) ConfigurationBindingDelete(namespace string, appName string, configurationName string) (models.Response, error)
- func (c *Client) ConfigurationCreate(req models.ConfigurationCreateRequest, namespace string) (models.Response, error)
- func (c *Client) ConfigurationDelete(req models.ConfigurationDeleteRequest, namespace string, names []string, ...) (models.ConfigurationDeleteResponse, error)
- func (c *Client) ConfigurationMatch(namespace, prefix string) (models.ConfigurationMatchResponse, error)
- func (c *Client) ConfigurationShow(namespace string, name string) (models.ConfigurationResponse, error)
- func (c *Client) ConfigurationUpdate(req models.ConfigurationUpdateRequest, namespace, name string) (models.Response, error)
- func (c *Client) Configurations(namespace string) (models.ConfigurationResponseList, error)
- func (c *Client) DisableVersionWarning()
- func (c *Client) EnvList(namespace string, appName string) (models.EnvVariableMap, error)
- func (c *Client) EnvMatch(namespace string, appName string, prefix string) (models.EnvMatchResponse, error)
- func (c *Client) EnvSet(req models.EnvVariableMap, namespace string, appName string) (models.Response, error)
- func (c *Client) EnvShow(namespace string, appName string, envName string) (models.EnvVariable, error)
- func (c *Client) EnvUnset(namespace string, appName string, envName string) (models.Response, error)
- func (c *Client) Info() (models.InfoResponse, error)
- func (c *Client) NamespaceCreate(req models.NamespaceCreateRequest) (models.Response, error)
- func (c *Client) NamespaceDelete(namespaces []string) (models.Response, error)
- func (c *Client) NamespaceShow(namespace string) (models.Namespace, error)
- func (c *Client) Namespaces() (models.NamespaceList, error)
- func (c *Client) NamespacesMatch(prefix string) (models.NamespacesMatchResponse, error)
- func (c *Client) ServiceApps(namespace string) (models.ServiceAppsResponse, error)
- func (c *Client) ServiceBind(req *models.ServiceBindRequest, namespace, name string) error
- func (c *Client) ServiceCatalog() (models.CatalogServices, error)
- func (c *Client) ServiceCatalogMatch(prefix string) (models.CatalogMatchResponse, error)
- func (c *Client) ServiceCatalogShow(serviceName string) (*models.CatalogService, error)
- func (c *Client) ServiceCreate(req *models.ServiceCreateRequest, namespace string) error
- func (c *Client) ServiceDelete(req models.ServiceDeleteRequest, namespace string, names []string, f ErrorFunc) (models.ServiceDeleteResponse, error)
- func (c *Client) ServiceList(namespace string) (models.ServiceList, error)
- func (c *Client) ServiceMatch(namespace, prefix string) (models.ServiceMatchResponse, error)
- func (c *Client) ServiceShow(req *models.ServiceShowRequest, namespace string) (*models.Service, error)
- func (c *Client) ServiceUnbind(req *models.ServiceUnbindRequest, namespace, name string) error
- func (c *Client) StagingComplete(namespace string, id string) (models.Response, error)
- func (c *Client) VersionWarningEnabled() bool
- type ErrorFunc
- type PortForwardOpts
- type Upgrader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Settings *epiniosettings.Settings HttpClient *http.Client // contains filtered or unexported fields }
Client provides functionality for talking to an Epinio API server
func New ¶
func New(ctx context.Context, settings *epiniosettings.Settings) *Client
New returns a new Epinio API client
func (*Client) AllConfigurations ¶ added in v0.6.0
func (c *Client) AllConfigurations() (models.ConfigurationResponseList, error)
AllConfigurations returns a list of all configurations, across all namespaces
func (*Client) AllServices ¶ added in v0.1.5
func (c *Client) AllServices() (models.ServiceList, error)
func (*Client) AppCreate ¶
func (c *Client) AppCreate(req models.ApplicationCreateRequest, namespace string) (models.Response, error)
AppCreate creates an application resource
func (*Client) AppDelete ¶
func (c *Client) AppDelete(namespace string, names []string) (models.ApplicationDeleteResponse, error)
AppDelete deletes an app
func (*Client) AppDeploy ¶
func (c *Client) AppDeploy(req models.DeployRequest) (*models.DeployResponse, error)
AppDeploy deploys a staged app
func (*Client) AppGetPart ¶ added in v0.6.3
AppGetPart retrieves part of an app (values.yaml, chart, image)
func (*Client) AppImportGit ¶
func (c *Client) AppImportGit(app models.AppRef, gitRef models.GitRef) (*models.ImportGitResponse, error)
AppImportGit asks the server to import a git repo and put in into the blob store
func (*Client) AppLogs ¶ added in v0.6.1
func (c *Client) AppLogs(namespace, appName, stageID string, follow bool, printCallback func(tailer.ContainerLogLine)) error
AppLogs streams the logs of all the application instances, in the targeted namespace If stageID is an empty string, runtime application logs are streamed. If stageID is set, then the matching staging logs are streamed. Logs are streamed through the returned channel. There are 2 ways of stopping this method: 1. The websocket connection closes. 2. The context is canceled (used by the caller when printing of logs should be stopped).
func (*Client) AppMatch ¶ added in v0.9.0
func (c *Client) AppMatch(namespace, prefix string) (models.AppMatchResponse, error)
AppMatch returns all matching namespaces for the prefix
func (*Client) AppPortForward ¶ added in v0.4.0
func (c *Client) AppPortForward(namespace string, appName, instance string, opts *PortForwardOpts) error
AppPortForward will forward the local traffic to a remote app
func (*Client) AppRestart ¶ added in v0.6.0
AppRestart restarts an app
func (*Client) AppRunning ¶
AppRunning checks if the app is running
func (*Client) AppStage ¶
func (c *Client) AppStage(req models.StageRequest) (*models.StageResponse, error)
AppStage stages an app
func (*Client) AppUpdate ¶
func (c *Client) AppUpdate(req models.ApplicationUpdateRequest, namespace string, appName string) (models.Response, error)
AppUpdate updates an app
func (*Client) AppUpload ¶
func (c *Client) AppUpload(namespace string, name string, tarball string) (models.UploadResponse, error)
AppUpload uploads a tarball for the named app, which is later used in staging
func (*Client) AppValidateCV ¶ added in v1.2.0
AppValidateCV validates the chart values of the specified app against its appchart
func (*Client) ChartMatch ¶ added in v0.8.0
func (c *Client) ChartMatch(prefix string) (models.ChartMatchResponse, error)
ChartMatch returns all application charts whose name matches the prefix
func (*Client) ConfigurationApps ¶ added in v0.6.0
func (c *Client) ConfigurationApps(namespace string) (models.ConfigurationAppsResponse, error)
ConfigurationApps lists all the apps by configurations
func (*Client) ConfigurationBindingCreate ¶ added in v0.6.0
func (c *Client) ConfigurationBindingCreate(req models.BindRequest, namespace string, appName string) (models.BindResponse, error)
ConfigurationBindingCreate creates a binding from an app to a configurationclass
func (*Client) ConfigurationBindingDelete ¶ added in v0.6.0
func (c *Client) ConfigurationBindingDelete(namespace string, appName string, configurationName string) (models.Response, error)
ConfigurationBindingDelete deletes a binding from an app to a configurationclass
func (*Client) ConfigurationCreate ¶ added in v0.6.0
func (c *Client) ConfigurationCreate(req models.ConfigurationCreateRequest, namespace string) (models.Response, error)
ConfigurationCreate creates a configuration by invoking the associated API endpoint
func (*Client) ConfigurationDelete ¶ added in v0.6.0
func (c *Client) ConfigurationDelete(req models.ConfigurationDeleteRequest, namespace string, names []string, f ErrorFunc) (models.ConfigurationDeleteResponse, error)
ConfigurationDelete deletes a configuration
func (*Client) ConfigurationMatch ¶ added in v0.9.0
func (c *Client) ConfigurationMatch(namespace, prefix string) (models.ConfigurationMatchResponse, error)
ConfigurationMatch returns all matching configurations for the prefix
func (*Client) ConfigurationShow ¶ added in v0.6.0
func (c *Client) ConfigurationShow(namespace string, name string) (models.ConfigurationResponse, error)
ConfigurationShow shows a configuration
func (*Client) ConfigurationUpdate ¶ added in v0.6.0
func (c *Client) ConfigurationUpdate(req models.ConfigurationUpdateRequest, namespace, name string) (models.Response, error)
ConfigurationUpdate updates a configuration by invoking the associated API endpoint
func (*Client) Configurations ¶ added in v0.6.0
func (c *Client) Configurations(namespace string) (models.ConfigurationResponseList, error)
Configurations returns a list of configurations for the specified namespace
func (*Client) DisableVersionWarning ¶ added in v1.4.0
func (c *Client) DisableVersionWarning()
func (*Client) EnvMatch ¶
func (c *Client) EnvMatch(namespace string, appName string, prefix string) (models.EnvMatchResponse, error)
EnvMatch returns all env vars matching the prefix
func (*Client) EnvSet ¶
func (c *Client) EnvSet(req models.EnvVariableMap, namespace string, appName string) (models.Response, error)
EnvSet set env vars for an app
func (*Client) EnvShow ¶
func (c *Client) EnvShow(namespace string, appName string, envName string) (models.EnvVariable, error)
EnvShow shows an env variable
func (*Client) EnvUnset ¶
func (c *Client) EnvUnset(namespace string, appName string, envName string) (models.Response, error)
EnvUnset removes an env var
func (*Client) Info ¶
func (c *Client) Info() (models.InfoResponse, error)
Info returns information about Epinio and its components
func (*Client) NamespaceCreate ¶
NamespaceCreate creates a namespace
func (*Client) NamespaceDelete ¶
NamespaceDelete deletes a namespace
func (*Client) NamespaceShow ¶ added in v0.1.4
NamespaceShow shows a namespace
func (*Client) Namespaces ¶
func (c *Client) Namespaces() (models.NamespaceList, error)
Namespaces returns a list of namespaces
func (*Client) NamespacesMatch ¶
func (c *Client) NamespacesMatch(prefix string) (models.NamespacesMatchResponse, error)
NamespacesMatch returns all matching namespaces for the prefix
func (*Client) ServiceApps ¶
func (c *Client) ServiceApps(namespace string) (models.ServiceAppsResponse, error)
ServiceApps lists a map from services to bound apps, for the namespace
func (*Client) ServiceBind ¶ added in v0.6.3
func (c *Client) ServiceBind(req *models.ServiceBindRequest, namespace, name string) error
func (*Client) ServiceCatalog ¶ added in v0.6.2
func (c *Client) ServiceCatalog() (models.CatalogServices, error)
func (*Client) ServiceCatalogMatch ¶ added in v0.9.0
func (c *Client) ServiceCatalogMatch(prefix string) (models.CatalogMatchResponse, error)
ServiceCatalogMatch returns all matching namespaces for the prefix
func (*Client) ServiceCatalogShow ¶ added in v0.6.2
func (c *Client) ServiceCatalogShow(serviceName string) (*models.CatalogService, error)
func (*Client) ServiceCreate ¶
func (c *Client) ServiceCreate(req *models.ServiceCreateRequest, namespace string) error
func (*Client) ServiceDelete ¶
func (c *Client) ServiceDelete(req models.ServiceDeleteRequest, namespace string, names []string, f ErrorFunc) (models.ServiceDeleteResponse, error)
func (*Client) ServiceList ¶ added in v0.7.0
func (c *Client) ServiceList(namespace string) (models.ServiceList, error)
func (*Client) ServiceMatch ¶ added in v0.9.0
func (c *Client) ServiceMatch(namespace, prefix string) (models.ServiceMatchResponse, error)
ServiceMatch returns all matching services for the prefix
func (*Client) ServiceShow ¶
func (*Client) ServiceUnbind ¶ added in v0.8.0
func (c *Client) ServiceUnbind(req *models.ServiceUnbindRequest, namespace, name string) error
func (*Client) StagingComplete ¶
StagingComplete checks if the staging process is complete
func (*Client) VersionWarningEnabled ¶ added in v1.4.0
VersionWarningEnabled returns true if versionWarning field is either not set of true. That makes "true" the default value unless DisableVersionWarning is called.
type PortForwardOpts ¶ added in v0.4.0
type PortForwardOpts struct { Address []string Ports []string StopChannel chan struct{} ReadyChannel chan struct{} Out io.Writer ErrOut io.Writer }
func NewPortForwardOpts ¶ added in v0.4.0
func NewPortForwardOpts(address, ports []string) *PortForwardOpts
type Upgrader ¶ added in v0.3.6
type Upgrader struct {
// contains filtered or unexported fields
}
Upgrader implements the spdy.Upgrader interface. It delegates to spdy.SpdyRoundTripper but handles Epinio errors (like 404) first. The upstream upgrader would simply ignore 404 in cases when app or namespace is not found. Here: https://github.com/kubernetes/apimachinery/blob/v0.21.4/pkg/util/httpstream/spdy/roundtripper.go#L343
func NewUpgrader ¶ added in v0.3.6
func NewUpgrader(cfg spdy.RoundTripperConfig) *Upgrader
func (*Upgrader) NewConnection ¶ added in v0.3.6
func (upgr *Upgrader) NewConnection(resp *http.Response) (httpstream.Connection, error)