sdk

package module
v0.0.48 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultAppConfig

func DefaultAppConfig(writer io.Writer, appId uuid.UUID, appName, appNamespace string) error

DefaultAppConfig generates a default app config yaml for an app

Types

type AppConfigTemplateData

type AppConfigTemplateData struct {
	AppName      string
	AppNamespace string
	AppId        string
}

type AppsClient

type AppsClient interface {
	List() ([]model.App, error)
	Create(newApp *model.NewApp) (*model.App, error)
	Get(name, namespace string) (*model.App, error)
	GetStatus(name, namespace string) (*model.AppStatus, error)
}

type Client

type Client struct {
	BaseURL *url.URL

	// Model clients
	Apps         AppsClient
	Deployments  DeploymentsClient
	Namespaces   NamespacesClient
	Rollouts     RolloutsClient
	Secrets      SecretsClient
	Environments EnvironmentsClient
	Validate     ValidateClient
	// contains filtered or unexported fields
}

Client is a API v1 client

func NewClient

func NewClient(baseURI string, apikey string) (*Client, error)

func (*Client) Do

func (c *Client) Do(req *http.Request, v interface{}) (*http.Response, error)

func (*Client) MakeInsecure

func (c *Client) MakeInsecure()

func (*Client) NewGetRequest

func (c *Client) NewGetRequest(relativeUrl string) (*http.Request, error)

func (*Client) NewRequest

func (c *Client) NewRequest(method, relativeUrl string, body interface{}) (*http.Request, error)

type ClientError

type ClientError struct {
	StatusCode       int
	Message          string            `json:"message"`
	ValidationErrors map[string]string `json:"validationErrors"`
}

ClientError provides the error message, status code.

func (*ClientError) Error

func (e *ClientError) Error() string

type DeploymentsClient

type DeploymentsClient interface {
	Delete(deploymentName, namespace, envName string) (*model.SaveDeploymentResponse, error)
	Save(deployment *model.SaveDeploymentRequest, dryRun bool) (*model.SaveDeploymentResponse, error)
	SaveStatus(deploymentName, namespace, envName string, status *model.DeploymentStatusMutable) (statusCode int, err error)
}

type EnvironmentsClient added in v0.0.34

type EnvironmentsClient interface {
	Ping(envName string) error
	List() ([]model.EnvironmentMeta, error)
	GetConfig(envName string) (*model.EnvironmentConfig, error)
	SetConfig(envName string, config *model.EnvironmentConfig) error
}

type NamespacesClient

type NamespacesClient interface {
	List() ([]model.Namespace, error)
	Create(namespaceName string) error
}

type RolloutsClient

type RolloutsClient interface {
	Save(deploymentName, namespace, envName string, trafficRule ...string) error
}

type SecretsClient

type SecretsClient interface {
	List(appName, namepsace, envName string) ([]model.SecretMetaStatus, error)
	Save(appName, namepsace, envName, secretName, plainTextSecret string) error
}

type ValidateClient

type ValidateClient interface {
	AppConfig(appConfig *model.AppConfigWithOverrides) error
}

Jump to

Keyboard shortcuts

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