client

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const BooberApiVersion = "/v1"

Variables

View Source
var (
	ErrJsonPathPrefix = errors.New("json path must start with /")
)

Functions

This section is empty.

Types

type ApiClient

type ApiClient struct {
	Host        string
	Token       string
	Affiliation string
}

func NewApiClient

func NewApiClient(host, token, affiliation string) *ApiClient

func (*ApiClient) DeleteVault

func (api *ApiClient) DeleteVault(vaultName string) error

func (*ApiClient) Deploy

func (api *ApiClient) Deploy(deployPayload *DeployPayload) (*DeployResults, error)

func (*ApiClient) Do

func (api *ApiClient) Do(method string, endpoint string, payload []byte) (*Response, error)

func (*ApiClient) GetApplyResult

func (api *ApiClient) GetApplyResult(deployId string) (string, error)

func (*ApiClient) GetAuroraConfig

func (api *ApiClient) GetAuroraConfig() (*AuroraConfig, error)

func (*ApiClient) GetAuroraConfigFile

func (api *ApiClient) GetAuroraConfigFile(fileName string) (*AuroraConfigFile, error)

func (*ApiClient) GetAuroraConfigNames added in v1.2.3

func (api *ApiClient) GetAuroraConfigNames() (*AuroraConfigNames, error)

func (*ApiClient) GetAuroraDeploySpec

func (api *ApiClient) GetAuroraDeploySpec(environment, application string, defaults bool) (AuroraDeploySpec, error)

func (*ApiClient) GetAuroraDeploySpecFormatted

func (api *ApiClient) GetAuroraDeploySpecFormatted(environment, application string, defaults bool) (string, error)

func (*ApiClient) GetClientConfig

func (api *ApiClient) GetClientConfig() (*ClientConfig, error)

func (*ApiClient) GetFileNames

func (api *ApiClient) GetFileNames() (FileNames, error)

func (*ApiClient) GetVault

func (api *ApiClient) GetVault(vaultName string) (*AuroraSecretVault, error)

func (*ApiClient) GetVaults

func (api *ApiClient) GetVaults() ([]*AuroraVaultInfo, error)

func (*ApiClient) PatchAuroraConfigFile

func (api *ApiClient) PatchAuroraConfigFile(fileName string, operation JsonPatchOp) (*ErrorResponse, error)

func (*ApiClient) PutAuroraConfig

func (api *ApiClient) PutAuroraConfig(endpoint string, ac *AuroraConfig) (*ErrorResponse, error)

func (*ApiClient) PutAuroraConfigFile

func (api *ApiClient) PutAuroraConfigFile(file *AuroraConfigFile) (*ErrorResponse, error)

func (*ApiClient) SaveAuroraConfig

func (api *ApiClient) SaveAuroraConfig(ac *AuroraConfig) (*ErrorResponse, error)

func (*ApiClient) SaveVault

func (api *ApiClient) SaveVault(vault AuroraSecretVault, validate bool) error

func (*ApiClient) UpdateSecretFile

func (api *ApiClient) UpdateSecretFile(vault, secret string, content []byte) error

func (*ApiClient) ValidateAuroraConfig

func (api *ApiClient) ValidateAuroraConfig(ac *AuroraConfig) (*ErrorResponse, error)

type AuroraConfig

type AuroraConfig struct {
	Files    map[string]json.RawMessage `json:"files"`
	Versions map[string]string          `json:"versions"`
}

func NewAuroraConfig

func NewAuroraConfig() *AuroraConfig

type AuroraConfigFile

type AuroraConfigFile struct {
	Name     string          `json:"name"`
	Version  string          `json:"version"`
	Override bool            `json:"override"`
	Contents json.RawMessage `json:"contents"`
}

func (*AuroraConfigFile) ToPrettyJson

func (f *AuroraConfigFile) ToPrettyJson() string

type AuroraConfigNames added in v1.2.3

type AuroraConfigNames []string

type AuroraDeploySpec

type AuroraDeploySpec map[string]interface{}

type AuroraSecretVault

type AuroraSecretVault struct {
	Name        string            `json:"name"`
	Permissions Permissions       `json:"permissions"`
	Secrets     Secrets           `json:"secrets"`
	Versions    map[string]string `json:"versions"`
}

func NewAuroraSecretVault

func NewAuroraSecretVault(name string) *AuroraSecretVault

type AuroraVaultInfo

type AuroraVaultInfo struct {
	Name        string      `json:"name"`
	Permissions Permissions `json:"permissions"`
	Secrets     []string    `json:"secrets"`
	Admin       bool        `json:"admin"`
}

type ClientConfig

type ClientConfig struct {
	GitUrlPattern string `json:"gitUrlPattern"`
	ApiVersion    int    `json:"apiVersion"`
}

type DeployPayload

type DeployPayload struct {
	ApplicationIds []applicationId            `json:"applicationIds"`
	Overrides      map[string]json.RawMessage `json:"overrides"`
	Deploy         bool                       `json:"deploy"`
}

func NewDeployPayload

func NewDeployPayload(applications []string, overrides map[string]json.RawMessage) *DeployPayload

type DeployResult

type DeployResult struct {
	DeployId string `json:"deployId"`
	ADS      struct {
		Name      string `json:"name"`
		Namespace string `json:"namespace"`
		Cluster   string `json:"cluster"`
	} `json:"auroraDeploymentSpec"`
	Success bool `json:"success"`
}

type DeployResults

type DeployResults struct {
	Message string
	Success bool
	Results []DeployResult
}

type ErrorResponse

type ErrorResponse struct {
	ContainsError      bool
	IllegalFieldErrors []string
	MissingFieldErrors []string
	InvalidFieldErrors []string
	UniqueErrors       map[string]bool
	// contains filtered or unexported fields
}

func NewErrorResponse

func NewErrorResponse(message string) *ErrorResponse

func (*ErrorResponse) Contains

func (e *ErrorResponse) Contains(key string) bool

func (*ErrorResponse) FormatValidationError

func (e *ErrorResponse) FormatValidationError(res *responseErrorItem)

func (*ErrorResponse) GetAllErrors

func (e *ErrorResponse) GetAllErrors() []string

func (*ErrorResponse) SetMessage

func (e *ErrorResponse) SetMessage(m string)

func (*ErrorResponse) String

func (e *ErrorResponse) String() string

type FileNames

type FileNames []string

func (FileNames) GetApplicationIds

func (f FileNames) GetApplicationIds() []string

func (FileNames) GetApplications

func (f FileNames) GetApplications() []string

func (FileNames) GetEnvironments

func (f FileNames) GetEnvironments() []string

type JsonPatchOp

type JsonPatchOp struct {
	OP    string      `json:"op"`
	Path  string      `json:"path"`
	Value interface{} `json:"value"`
}

func (JsonPatchOp) Validate

func (op JsonPatchOp) Validate() error

type Permissions

type Permissions map[string][]string

func (Permissions) AddGroup

func (p Permissions) AddGroup(group string) error

func (Permissions) DeleteGroup

func (p Permissions) DeleteGroup(group string) error

func (Permissions) GetGroups

func (p Permissions) GetGroups() []string

type Response

type Response struct {
	Success bool            `json:"success"`
	Message string          `json:"message"`
	Items   json.RawMessage `json:"items"`
	Count   int             `json:"count"`
}

func (*Response) ParseFirstItem

func (res *Response) ParseFirstItem(data interface{}) error

func (*Response) ParseItems

func (res *Response) ParseItems(data interface{}) error

func (*Response) ToErrorResponse

func (res *Response) ToErrorResponse() (*ErrorResponse, error)

type Secrets

type Secrets map[string]string

func (Secrets) AddSecret

func (s Secrets) AddSecret(name, content string)

func (Secrets) GetSecret

func (s Secrets) GetSecret(name string) (string, error)

func (Secrets) RemoveSecret

func (s Secrets) RemoveSecret(name string)

Jump to

Keyboard shortcuts

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