store

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package store implements CRUD operations for project, environment, application and pipeline configuration. This configuration contains the archer projects a customer has, and the environments and pipelines associated with each project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrNoSuchApplication

type ErrNoSuchApplication struct {
	ProjectName     string
	ApplicationName string
}

ErrNoSuchApplication means a specific application couldn't be found in a specific project.

func (*ErrNoSuchApplication) Error

func (e *ErrNoSuchApplication) Error() string

func (*ErrNoSuchApplication) Is

func (e *ErrNoSuchApplication) Is(target error) bool

Is returns whether the provided error equals this error.

type ErrNoSuchEnvironment

type ErrNoSuchEnvironment struct {
	ProjectName     string
	EnvironmentName string
}

ErrNoSuchEnvironment means a specific environment couldn't be found in a specific project.

func (*ErrNoSuchEnvironment) Error

func (e *ErrNoSuchEnvironment) Error() string

func (*ErrNoSuchEnvironment) Is

func (e *ErrNoSuchEnvironment) Is(target error) bool

Is returns whether the provided error equals this error.

type ErrNoSuchProject

type ErrNoSuchProject struct {
	ProjectName string
	AccountID   string
	Region      string
}

ErrNoSuchProject means a project couldn't be found within a specific account and region.

func (*ErrNoSuchProject) Error

func (e *ErrNoSuchProject) Error() string

func (*ErrNoSuchProject) Is

func (e *ErrNoSuchProject) Is(target error) bool

Is returns whether the provided error equals this error.

type Store

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

Store is in charge of fetching and creating projects, environment and pipeline configuration in SSM.

func New

func New() (*Store, error)

New returns a Store allowing you to query or create Projects or Environments.

func (*Store) CreateApplication

func (s *Store) CreateApplication(app *archer.Application) error

CreateApplication instantiates a new application within an existing project. Skip if the application already exists in the project.

func (*Store) CreateEnvironment

func (s *Store) CreateEnvironment(environment *archer.Environment) error

CreateEnvironment instantiates a new environment within an existing project. Skip if the environment already exists in the project.

func (*Store) CreateProject

func (s *Store) CreateProject(project *archer.Project) error

CreateProject instantiates a new project, validates its uniqueness and stores it in SSM.

func (*Store) DeleteApplication

func (s *Store) DeleteApplication(projectName, appName string) error

DeleteApplication removes an application from SSM. If the application does not exist in the store or is successfully deleted then returns nil. Otherwise, returns an error.

func (*Store) DeleteEnvironment

func (s *Store) DeleteEnvironment(projectName, environmentName string) error

DeleteEnvironment removes an environment from SSM. If the environment does not exist in the store or is successfully deleted then returns nil. Otherwise, returns an error.

func (*Store) DeleteProject added in v0.0.5

func (s *Store) DeleteProject(name string) error

DeleteProject deletes the SSM parameter related to the project.

func (*Store) GetApplication

func (s *Store) GetApplication(projectName, appName string) (*archer.Application, error)

GetApplication gets an application belonging to a particular project by name. If no app is found it returns ErrNoSuchApplication.

func (*Store) GetEnvironment

func (s *Store) GetEnvironment(projectName string, environmentName string) (*archer.Environment, error)

GetEnvironment gets an environment belonging to a particular project by name. If no environment is found it returns ErrNoSuchEnvironment.

func (*Store) GetProject

func (s *Store) GetProject(projectName string) (*archer.Project, error)

GetProject fetches a project by name. If it can't be found, return a ErrNoSuchProject

func (*Store) ListApplications

func (s *Store) ListApplications(projectName string) ([]*archer.Application, error)

ListApplications returns all applications belonging to a particular project.

func (*Store) ListEnvironments

func (s *Store) ListEnvironments(projectName string) ([]*archer.Environment, error)

ListEnvironments returns all environments belonging to a particular project.

func (*Store) ListProjects

func (s *Store) ListProjects() ([]*archer.Project, error)

ListProjects returns the list of existing projects in the customer's account and region.

Directories

Path Synopsis
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