account

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2018 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudAccount

type CloudAccount struct {
	Name        string        `json:"name" valid:"required, length(1|32)"`
	Provider    provider.Name `json:"provider" valid:"in(aws|digitalocean|packet|gce|openstack)"`
	Credentials Credentials   `json:"credentials" valid:"optional"`
}

CloudAccount is settings of account in public or private cloud (e.g. AWS, vCenter) Name should be unique.

type Credentials

type Credentials map[string]string

Credentials store ssh keys, fingerprints and other creds associated with CloudAccount

type Handler

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

Handler is a http controller for account entity

func (*Handler) Create

func (e *Handler) Create(rw http.ResponseWriter, r *http.Request)

Create register new cloud account

func (*Handler) Delete

func (e *Handler) Delete(rw http.ResponseWriter, r *http.Request)

Delete cloud account

func (*Handler) Get

func (e *Handler) Get(rw http.ResponseWriter, r *http.Request)

Get retrieves individual account by name

func (*Handler) ListAll

func (e *Handler) ListAll(rw http.ResponseWriter, r *http.Request)

ListAll retrieves all cloud accounts

func (*Handler) Update

func (e *Handler) Update(rw http.ResponseWriter, r *http.Request)

Update saves updated state of an cloud account, account name can't be changed

type Service

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

Service holds all business logic related to cloud accounts

func (*Service) Create

func (s *Service) Create(ctx context.Context, account *CloudAccount) error

Create stores user in the underlying storage

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, accountName string) error

Delete cloud account by name

func (*Service) Get

func (s *Service) Get(ctx context.Context, accountName string) (*CloudAccount, error)

Get retrieves a user by it's accountName, returns nil if not found

func (*Service) GetAll

func (s *Service) GetAll(ctx context.Context) ([]CloudAccount, error)

GetAll retrieves cloud accounts from underlying storage, returns empty slice if none found

func (*Service) Update

func (s *Service) Update(ctx context.Context, account *CloudAccount) error

Update cloud account

Jump to

Keyboard shortcuts

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