describe

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BlankServiceDiscoveryURI is an empty URI to denote services
	// that cannot be reached with Service Discovery.
	BlankServiceDiscoveryURI = "-"
)

Variables

This section is empty.

Functions

func IsStackNotExistsErr

func IsStackNotExistsErr(err error) bool

IsStackNotExistsErr returns true if error type is stack not exist.

Types

type App

type App struct {
	Name      string                   `json:"name"`
	Version   string                   `json:"version"`
	URI       string                   `json:"uri"`
	Envs      []*config.Environment    `json:"environments"`
	Services  []*config.Workload       `json:"services"`
	Pipelines []*codepipeline.Pipeline `json:"pipelines"`
}

App contains serialized parameters for an application.

func (*App) HumanString

func (a *App) HumanString() string

HumanString returns the stringified App struct with human readable format.

func (*App) JSONString

func (a *App) JSONString() (string, error)

JSONString returns the stringified App struct with json format.

type AppDescriber added in v1.5.0

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

AppDescriber retrieves information about an application.

func NewAppDescriber added in v1.5.0

func NewAppDescriber(appName string) (*AppDescriber, error)

NewAppDescriber instantiates an application describer.

func (*AppDescriber) Version added in v1.5.0

func (d *AppDescriber) Version() (string, error)

Version returns the app CloudFormation template version associated with the application by reading the Metadata.Version field from the template. Specifically it will get both app CFN stack template version and app StackSet template version, and return the minimum as the current app version.

If the Version field does not exist, then it's a legacy template and it returns an deploy.LegacyAppTemplateVersion and nil error.

type AppRunnerServiceDescriber added in v1.7.0

type AppRunnerServiceDescriber struct {
	*ServiceDescriber
	// contains filtered or unexported fields
}

AppRunnerServiceDescriber retrieves information about a service.

func NewAppRunnerServiceDescriber added in v1.7.0

func NewAppRunnerServiceDescriber(opt NewServiceConfig) (*AppRunnerServiceDescriber, error)

NewAppRunnerServiceDescriber initiates an AppRunnerServiceDescriber struct.

func (*AppRunnerServiceDescriber) Service added in v1.7.0

Service retrieves an app runner service.

func (*AppRunnerServiceDescriber) ServiceARN added in v1.7.0

func (d *AppRunnerServiceDescriber) ServiceARN() (string, error)

ServiceARN retrieves the ARN of the app runner service.

func (*AppRunnerServiceDescriber) ServiceURL added in v1.7.0

func (d *AppRunnerServiceDescriber) ServiceURL() (string, error)

ServiceURL retrieves the app runner service URL.

type AppRunnerStatusDescriber added in v1.7.0

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

AppRunnerStatusDescriber retrieves status of an AppRunner service.

func NewAppRunnerStatusDescriber added in v1.7.0

func NewAppRunnerStatusDescriber(opt *NewServiceStatusConfig) (*AppRunnerStatusDescriber, error)

NewAppRunnerStatusDescriber instantiates a new AppRunnerStatusDescriber struct.

func (*AppRunnerStatusDescriber) Describe added in v1.7.0

Describe returns status of an AppRunner service.

type BackendServiceDescriber

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

BackendServiceDescriber retrieves information about a backend service.

func NewBackendServiceDescriber

func NewBackendServiceDescriber(opt NewBackendServiceConfig) (*BackendServiceDescriber, error)

NewBackendServiceDescriber instantiates a backend service describer.

func (*BackendServiceDescriber) Describe

Describe returns info of a backend service.

func (*BackendServiceDescriber) URI

func (d *BackendServiceDescriber) URI(envName string) (string, error)

URI returns the service discovery namespace and is used to make BackendServiceDescriber have the same signature as WebServiceDescriber.

type ConfigStoreSvc

type ConfigStoreSvc interface {
	GetEnvironment(appName string, environmentName string) (*config.Environment, error)
	ListEnvironments(appName string) ([]*config.Environment, error)
	ListServices(appName string) ([]*config.Workload, error)
	GetWorkload(appName string, name string) (*config.Workload, error)
}

ConfigStoreSvc wraps methods of config store.

type DeployedEnvServicesLister

type DeployedEnvServicesLister interface {
	ListEnvironmentsDeployedTo(appName string, svcName string) ([]string, error)
	ListDeployedServices(appName string, envName string) ([]string, error)
}

DeployedEnvServicesLister wraps methods of deploy store.

type ECSServiceConfig added in v1.7.0

type ECSServiceConfig struct {
	*ServiceConfig

	Tasks string `json:"tasks"`
}

type ECSServiceDescriber added in v1.7.0

type ECSServiceDescriber struct {
	*ServiceDescriber
	// contains filtered or unexported fields
}

ECSServiceDescriber retrieves information about a service.

func NewECSServiceDescriber added in v1.7.0

func NewECSServiceDescriber(opt NewServiceConfig) (*ECSServiceDescriber, error)

NewServiceDescriber instantiates a new service.

func (*ECSServiceDescriber) EnvVars added in v1.7.0

func (d *ECSServiceDescriber) EnvVars() ([]*awsecs.ContainerEnvVar, error)

EnvVars returns the environment variables of the task definition.

func (*ECSServiceDescriber) Secrets added in v1.7.0

func (d *ECSServiceDescriber) Secrets() ([]*awsecs.ContainerSecret, error)

Secrets returns the secrets of the task definition.

type ECSStatusDescriber added in v1.7.0

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

ECSStatusDescriber retrieves status of an ECS service.

func NewECSStatusDescriber added in v1.7.0

func NewECSStatusDescriber(opt *NewServiceStatusConfig) (*ECSStatusDescriber, error)

NewECSStatusDescriber instantiates a new ECSStatusDescriber struct.

func (*ECSStatusDescriber) Describe added in v1.7.0

func (s *ECSStatusDescriber) Describe() (HumanJSONStringer, error)

Describe returns status of an ECS service.

type EnvDescriber

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

EnvDescriber retrieves information about an environment.

func NewEnvDescriber

func NewEnvDescriber(opt NewEnvDescriberConfig) (*EnvDescriber, error)

NewEnvDescriber instantiates an environment describer.

func (*EnvDescriber) Describe

func (d *EnvDescriber) Describe() (*EnvDescription, error)

Describe returns info about an application's environment.

func (*EnvDescriber) Outputs added in v1.7.1

func (d *EnvDescriber) Outputs() (map[string]string, error)

Params returns the outputs of the environment stack.

func (*EnvDescriber) Params added in v1.7.1

func (d *EnvDescriber) Params() (map[string]string, error)

Params returns the parameters of the environment stack.

func (*EnvDescriber) Version added in v0.5.0

func (d *EnvDescriber) Version() (string, error)

Version returns the CloudFormation template version associated with the environment by reading the Metadata.Version field from the template.

If the Version field does not exist, then it's a legacy template and it returns an deploy.LegacyEnvTemplateVersion and nil error.

type EnvDescription

type EnvDescription struct {
	Environment    *config.Environment `json:"environment"`
	Services       []*config.Workload  `json:"services"`
	Tags           map[string]string   `json:"tags,omitempty"`
	Resources      []*stack.Resource   `json:"resources,omitempty"`
	EnvironmentVPC EnvironmentVPC      `json:"environmentVPC"`
}

EnvDescription contains the information about an environment.

func (*EnvDescription) HumanString

func (e *EnvDescription) HumanString() string

HumanString returns the stringified EnvDescription struct with human readable format.

func (*EnvDescription) JSONString

func (e *EnvDescription) JSONString() (string, error)

JSONString returns the stringified EnvDescription struct with json format.

type EnvironmentVPC added in v0.6.0

type EnvironmentVPC struct {
	ID               string   `json:"id"`
	PublicSubnetIDs  []string `json:"publicSubnetIDs"`
	PrivateSubnetIDs []string `json:"privateSubnetIDs"`
}

EnvironmentVPC holds the ID of the environment's VPC configuration.

type HumanJSONStringer

type HumanJSONStringer interface {
	HumanString() string
	JSONString() (string, error)
}

HumanJSONStringer contains methods that stringify app info for output.

type LBWebServiceDescriber added in v1.7.0

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

LBWebServiceDescriber retrieves information about a load balanced web service.

func NewLBWebServiceDescriber added in v1.7.0

func NewLBWebServiceDescriber(opt NewLBWebServiceConfig) (*LBWebServiceDescriber, error)

NewLBWebServiceDescriber instantiates a load balanced service describer.

func (*LBWebServiceDescriber) Describe added in v1.7.0

Describe returns info of a web service.

func (*LBWebServiceDescriber) URI added in v1.7.0

func (d *LBWebServiceDescriber) URI(envName string) (string, error)

URI returns the LBWebServiceURI to identify this service uniquely given an environment name.

type LBWebServiceURI added in v1.7.0

type LBWebServiceURI struct {
	HTTPS    bool
	DNSNames []string // The environment's subdomain if the service is served on HTTPS. Otherwise, the public load balancer's DNS.
	Path     string   // Empty if the service is served on HTTPS. Otherwise, the pattern used to match the service.
}

LBWebServiceURI represents the unique identifier to access a load balanced web service.

func (*LBWebServiceURI) String added in v1.7.0

func (u *LBWebServiceURI) String() string

type NewBackendServiceConfig

type NewBackendServiceConfig struct {
	NewServiceConfig
	EnableResources bool
	DeployStore     DeployedEnvServicesLister
}

NewBackendServiceConfig contains fields that initiates BackendServiceDescriber struct.

type NewEnvDescriberConfig

type NewEnvDescriberConfig struct {
	App             string
	Env             string
	EnableResources bool
	ConfigStore     ConfigStoreSvc
	DeployStore     DeployedEnvServicesLister
}

NewEnvDescriberConfig contains fields that initiates EnvDescriber struct.

type NewLBWebServiceConfig added in v1.7.0

type NewLBWebServiceConfig struct {
	NewServiceConfig
	EnableResources bool
	DeployStore     DeployedEnvServicesLister
}

NewLBWebServiceConfig contains fields that initiates WebServiceDescriber struct.

type NewRDWebServiceConfig added in v1.7.0

type NewRDWebServiceConfig struct {
	NewServiceConfig
	EnableResources bool
	DeployStore     DeployedEnvServicesLister
}

NewRDWebServiceConfig contains fields that initiates RDWebServiceDescriber struct.

type NewServiceConfig

type NewServiceConfig struct {
	App         string
	Env         string
	Svc         string
	ConfigStore ConfigStoreSvc
}

NewServiceConfig contains fields that initiates ServiceDescriber struct.

type NewServiceStatusConfig

type NewServiceStatusConfig struct {
	App         string
	Env         string
	Svc         string
	ConfigStore ConfigStoreSvc
}

NewServiceStatusConfig contains fields that initiates ServiceStatus struct.

type Pipeline

type Pipeline struct {
	codepipeline.Pipeline

	Resources []*stack.Resource `json:"resources,omitempty"`
}

Pipeline contains serialized parameters for a pipeline.

func (*Pipeline) HumanString

func (p *Pipeline) HumanString() string

HumanString returns the stringified Pipeline struct with human readable format.

func (*Pipeline) JSONString

func (p *Pipeline) JSONString() (string, error)

JSONString returns the stringified Pipeline struct with JSON format.

type PipelineDescriber

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

PipelineDescriber retrieves information about an application.

func NewPipelineDescriber

func NewPipelineDescriber(pipelineName string, showResources bool) (*PipelineDescriber, error)

NewPipelineDescriber instantiates a new pipeline describer

func (*PipelineDescriber) Describe

func (d *PipelineDescriber) Describe() (HumanJSONStringer, error)

Describe returns description of a pipeline.

type PipelineStatus

type PipelineStatus struct {
	codepipeline.PipelineState
}

PipelineStatus contains the status for a pipeline.

func (PipelineStatus) HumanString

func (p PipelineStatus) HumanString() string

HumanString returns stringified PipelineStatus struct with human readable format.

func (PipelineStatus) JSONString

func (p PipelineStatus) JSONString() (string, error)

JSONString returns stringified PipelineStatus struct with json format.

type PipelineStatusDescriber

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

PipelineStatusDescriber retrieves status of a pipeline.

func NewPipelineStatusDescriber

func NewPipelineStatusDescriber(pipelineName string) (*PipelineStatusDescriber, error)

NewPipelineStatusDescriber instantiates a new PipelineStatus struct.

func (*PipelineStatusDescriber) Describe

Describe returns status of a pipeline.

type RDWebServiceDescriber added in v1.7.0

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

RDWebServiceDescriber retrieves information about a request-driven web service.

func NewRDWebServiceDescriber added in v1.7.0

func NewRDWebServiceDescriber(opt NewRDWebServiceConfig) (*RDWebServiceDescriber, error)

NewRDWebServiceDescriber instantiates a request-driven service describer.

func (*RDWebServiceDescriber) Describe added in v1.7.0

Describe returns info for a request-driven web service.

func (*RDWebServiceDescriber) URI added in v1.7.0

func (d *RDWebServiceDescriber) URI(envName string) (string, error)

URI returns the WebServiceURI to identify this service uniquely given an environment name.

type ServiceConfig

type ServiceConfig struct {
	Environment string `json:"environment"`
	Port        string `json:"port"`
	CPU         string `json:"cpu"`
	Memory      string `json:"memory"`
}

ServiceConfig contains serialized configuration parameters for a service.

type ServiceDescriber

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

ServiceDescriber provides base functionality for retrieving info about a service.

func NewServiceDescriber

func NewServiceDescriber(opt NewServiceConfig) (*ServiceDescriber, error)

func (*ServiceDescriber) EnvVars

func (d *ServiceDescriber) EnvVars() ([]*awsecs.ContainerEnvVar, error)

EnvVars returns the environment variables of the task definition.

func (*ServiceDescriber) Outputs added in v1.7.1

func (d *ServiceDescriber) Outputs() (map[string]string, error)

Params returns the outputs of the service stack.

func (*ServiceDescriber) Params

func (d *ServiceDescriber) Params() (map[string]string, error)

Params returns the parameters of the service stack.

func (*ServiceDescriber) Secrets added in v1.1.0

func (d *ServiceDescriber) Secrets() ([]*awsecs.ContainerSecret, error)

Secrets returns the secrets of the task definition.

func (*ServiceDescriber) ServiceStackResources

func (d *ServiceDescriber) ServiceStackResources() ([]*stack.Resource, error)

ServiceStackResources returns the filtered service stack resources created by CloudFormation.

type ServiceDiscovery

type ServiceDiscovery struct {
	Environment []string `json:"environment"`
	Namespace   string   `json:"namespace"`
}

ServiceDiscovery contains serialized service discovery info for an service.

type WebServiceRoute

type WebServiceRoute struct {
	Environment string `json:"environment"`
	URL         string `json:"url"`
}

WebServiceRoute contains serialized route parameters for a web service.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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