storage

package
v0.11.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package storage is a generated protocol buffer package.

It is generated from these files:

object.proto

It has these top-level messages:

Object

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeToString

func EncodeToString(obj *Object) (string, error)

EncodeToString returns the base64 encoding of a protobuf encoded storage.Object.

err != nil if the protobuf marshaling fails; otherwise nil.

func NewErrAppBuildExists

func NewErrAppBuildExists(appName, buildID string) error

NewErrAppBuildExists returns a formatted error specifying the storage object for build with buildID already exists.

func NewErrAppBuildNotFound

func NewErrAppBuildNotFound(appName, buildID string) error

NewErrAppBuildNotFound returns a formatted error specifying the storage object for build with buildID does not exist.

func NewErrAppStorageExists

func NewErrAppStorageExists(appName string) error

NewErrAppStorageExists returns a formatted error specifying the storage for application specified by appName already exists.

func NewErrAppStorageNotFound

func NewErrAppStorageNotFound(appName string) error

NewErrAppStorageNotFound returns a formatted error specifying the storage for application specified by appName does not exist.

Types

type Creator

type Creator interface {
	// CreateBuild creates and stores a new build.
	CreateBuild(ctx context.Context, appName string, build *Object) error
}

Creator represents the create APIs of the storage engine.

type Deleter

type Deleter interface {
	// DeleteBuilds deletes all draft builds for the application specified by appName.
	DeleteBuilds(ctx context.Context, appName string) ([]*Object, error)
	// DeleteBuild deletes the draft build given by buildID for the application specified by appName.
	DeleteBuild(ctx context.Context, appName, buildID string) (*Object, error)
}

Deleter represents the delete APIs of the storage engine.

type Getter

type Getter interface {
	// GetBuilds retrieves all draft builds from storage.
	GetBuilds(ctx context.Context, appName string) ([]*Object, error)
	// GetBuild retrieves the draft build by id from storage.
	GetBuild(ctx context.Context, appName, buildID string) (*Object, error)
}

Getter represents the retrieval APIs of the storage engine.

type Object

type Object struct {
	BuildID     string `protobuf:"bytes,1,opt,name=buildID" json:"buildID,omitempty"`
	Release     string `protobuf:"bytes,2,opt,name=release" json:"release,omitempty"`
	ContextID   []byte `protobuf:"bytes,3,opt,name=contextID,proto3" json:"contextID,omitempty"`
	LogsFileRef string `protobuf:"bytes,4,opt,name=logs_file_ref,json=logsFileRef" json:"logs_file_ref,omitempty"`
}

Object is the storage object for a draft applications build history.

func DecodeString

func DecodeString(str string) (*Object, error)

DecodeString returns the storage.Object decoded from a base64 encoded protobuf string.

err != nil if decoding fails.

func (*Object) Descriptor

func (*Object) Descriptor() ([]byte, []int)

func (*Object) GetBuildID

func (m *Object) GetBuildID() string

func (*Object) GetContextID

func (m *Object) GetContextID() []byte

func (*Object) GetLogsFileRef added in v0.11.0

func (m *Object) GetLogsFileRef() string

func (*Object) GetRelease

func (m *Object) GetRelease() string

func (*Object) ProtoMessage

func (*Object) ProtoMessage()

func (*Object) Reset

func (m *Object) Reset()

func (*Object) String

func (m *Object) String() string

type Store

type Store interface {
	Creator
	Deleter
	Updater
	Getter
}

Store represents a storage engine for application state stored by Draftd.

type Updater

type Updater interface {
	// UpdateBuild creates and stores a new build.
	UpdateBuild(ctx context.Context, appName string, build *Object) error
}

Updater represents the update APIs of the storage engine.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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