Help us shape the future of Go! Take the 2026 Go Developer Survey

backends

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: MPL-2.0 Imports: 12 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppNotFound

type AppNotFound struct {
	AppName     string
	OriginalErr error
}

func (*AppNotFound) Error

func (s *AppNotFound) Error() string

type Backend

type Backend interface {
	Configure(config map[string]interface{}) (interface{}, error)

	SupportsWriteLock() bool

	// IsReady can perform any kind of preliminar
	// check (e.g. is TCP port open, are credentials valid,
	// are permissions sufficient) to verify the backend
	// is ready to persist our data
	IsReady(meta interface{}) (bool, error)

	// ListApplications returns all existing applications
	// (no matter if they have any slots/deployments or not)
	ListApplications(meta interface{}) ([]*schema.ApplicationData, error)

	// GetApplication returns application metadata for a given app name
	GetApplication(meta interface{}, name string) (*schema.ApplicationData, error)

	// SaveApplication saves any given application data
	SaveApplication(meta interface{}, name string, data *schema.ApplicationData) error

	// ListSlots returns all existing slots (active+inactive)
	ListSlots(meta interface{}, appName string) ([]*schema.SlotData, error)

	// DeleteSlot deletes all slot data available in the backend
	DeleteSlot(meta interface{}, appName, slotId string) error

	// SaveSlot saves any given slot data into backend
	SaveSlot(meta interface{}, appName, slotId string, slot *schema.SlotData) error

	// GetSlot returns any existing data for a given slotId
	GetSlot(meta interface{}, appName, slotId string) (*schema.SlotData, error)

	// ListSortedDeploymentsForSlotId returns n last deployments
	ListSortedDeploymentsForSlotId(meta interface{}, appName, slotId string, limitPerSlot int) ([]*schema.DeploymentData, error)

	// SaveDeployment saves any given deployment data into backend
	SaveDeployment(meta interface{}, appName, slotId, deploymentId string, data *schema.DeploymentData) error

	// GetDeployment returns deployment data
	// for a given slotId & deploymentId saved previously in the backend
	GetDeployment(meta interface{}, appName, slotId, deploymentId string) (*schema.DeploymentData, error)
}

type BackendFactory

type BackendFactory struct {
	Name    string
	Backend Backend
	Meta    interface{}
}

func (*BackendFactory) Initialize

func (b *BackendFactory) Initialize(config map[string]interface{}) error

type S3

type S3 struct{}

func (*S3) Configure

func (s3 *S3) Configure(config map[string]interface{}) (interface{}, error)

func (*S3) DeleteSlot

func (s3 *S3) DeleteSlot(meta interface{}, appName, slotId string) error

func (*S3) GetApplication

func (s3 *S3) GetApplication(meta interface{}, appName string) (*schema.ApplicationData, error)

func (*S3) GetDeployment

func (s3 *S3) GetDeployment(meta interface{}, appName, slotId, deploymentId string) (*schema.DeploymentData, error)

func (*S3) GetSlot

func (s3 *S3) GetSlot(meta interface{}, appName, slotId string) (*schema.SlotData, error)

func (*S3) IsReady

func (s3 *S3) IsReady(meta interface{}) (bool, error)

func (*S3) ListApplications

func (s3 *S3) ListApplications(meta interface{}) ([]*schema.ApplicationData, error)

func (*S3) ListSlots

func (s3 *S3) ListSlots(meta interface{}, appName string) ([]*schema.SlotData, error)

func (*S3) ListSortedDeploymentsForSlotId

func (s3 *S3) ListSortedDeploymentsForSlotId(meta interface{}, appName, slotId string, limitPerSlot int) ([]*schema.DeploymentData, error)

func (*S3) SaveApplication

func (s3 *S3) SaveApplication(meta interface{}, name string, app *schema.ApplicationData) error

func (*S3) SaveDeployment

func (s3 *S3) SaveDeployment(meta interface{}, appName, slotId, deploymentId string, data *schema.DeploymentData) error

func (*S3) SaveSlot

func (s3 *S3) SaveSlot(meta interface{}, appName, slotId string, slot *schema.SlotData) error

func (*S3) SupportsWriteLock

func (s3 *S3) SupportsWriteLock() bool

This will allow us to print some useful warnings to user, e.g. "Hey, backend %s doesn't support locking, it is your responsibility to let your colleagues know you're deploying!"

type S3Config

type S3Config struct {
	ApiCallerArn string
	Prefix       string
	Bucket       string
	Region       string
	// contains filtered or unexported fields
}

type SlotNotFound

type SlotNotFound struct {
	SlotName    string
	OriginalErr error
}

func (*SlotNotFound) Error

func (s *SlotNotFound) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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