storage

package
v0.0.0-...-a0e2d3e Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const NoReleasesErr = "has no deployed releases"

NoReleasesErr indicates that a given release cannot be found

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	driver.Driver

	// MaxHistory specifies the maximum number of historical releases that will
	// be retained, including the most recent release. Values of 0 or less are
	// ignored (meaning no limits are imposed).
	MaxHistory int

	Log func(string, ...interface{})
}

Storage represents a storage engine for a Release.

func Init

func Init(d driver.Driver) *Storage

Init initializes a new storage backend with the driver d. If d is nil, the default in-memory driver is used.

func (*Storage) Create

func (s *Storage) Create(rls *rspb.Release) error

Create creates a new storage entry holding the release. An error is returned if the storage driver failed to store the release, or a release with identical an key already exists.

func (*Storage) Delete

func (s *Storage) Delete(name string, version int32) (*rspb.Release, error)

Delete deletes the release from storage. An error is returned if the storage backend fails to delete the release or if the release does not exist.

func (*Storage) Deployed

func (s *Storage) Deployed(name string) (*rspb.Release, error)

Deployed returns the last deployed release with the provided release name, or returns ErrReleaseNotFound if not found.

func (*Storage) DeployedAll

func (s *Storage) DeployedAll(name string) ([]*rspb.Release, error)

DeployedAll returns all deployed releases with the provided name, or returns ErrReleaseNotFound if not found.

func (*Storage) Get

func (s *Storage) Get(name string, version int32) (*rspb.Release, error)

Get retrieves the release from storage. An error is returned if the storage driver failed to fetch the release, or the release identified by the key, version pair does not exist.

func (*Storage) History

func (s *Storage) History(name string) ([]*rspb.Release, error)

History returns the revision history for the release with the provided name, or returns ErrReleaseNotFound if no such release name exists.

func (*Storage) Last

func (s *Storage) Last(name string) (*rspb.Release, error)

Last fetches the last revision of the named release.

func (*Storage) ListDeleted

func (s *Storage) ListDeleted() ([]*rspb.Release, error)

ListDeleted returns all releases with Status == DELETED. An error is returned if the storage backend fails to retrieve the releases.

func (*Storage) ListDeployed

func (s *Storage) ListDeployed() ([]*rspb.Release, error)

ListDeployed returns all releases with Status == DEPLOYED. An error is returned if the storage backend fails to retrieve the releases.

func (*Storage) ListFilterAll

func (s *Storage) ListFilterAll(fns ...relutil.FilterFunc) ([]*rspb.Release, error)

ListFilterAll returns the set of releases satisfying the predicate (filter0 && filter1 && ... && filterN), i.e. a Release is included in the results if and only if all filters return true.

func (*Storage) ListFilterAny

func (s *Storage) ListFilterAny(fns ...relutil.FilterFunc) ([]*rspb.Release, error)

ListFilterAny returns the set of releases satisfying the predicate (filter0 || filter1 || ... || filterN), i.e. a Release is included in the results if at least one of the filters returns true.

func (*Storage) ListReleases

func (s *Storage) ListReleases() ([]*rspb.Release, error)

ListReleases returns all releases from storage. An error is returned if the storage backend fails to retrieve the releases.

func (*Storage) Update

func (s *Storage) Update(rls *rspb.Release) error

Update update the release in storage. An error is returned if the storage backend fails to update the release or if the release does not exist.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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