storage

package
v2.0.0-alpha.3+incompa... Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package storage implements storage for Tiller objects.The backend storage mechanism may be implemented with different backends. This package and its subpackages provide storage layers for Tiller objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilterFunc

type FilterFunc func(*rspb.Release) bool

FilterFunc returns true if the release object satisfies the predicate of the underlying func.

func All

func All(filters ...FilterFunc) FilterFunc

All returns a FilterFunc that filters a list of releases determined by the predicate 'f0 && f1 && ... && fn'.

func Any

func Any(filters ...FilterFunc) FilterFunc

Any returns a FilterFunc that filters a list of releases determined by the predicate 'f0 || f1 || ... || fn'.

func StatusFilter

func StatusFilter(status rspb.Status_Code) FilterFunc

StatusFilter filters a set of releases by status code.

func (FilterFunc) Check

func (fn FilterFunc) Check(rls *rspb.Release) bool

Check applies the FilterFunc to the release object.

type Storage

type Storage struct {
	driver.Driver
}

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(key string) (*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) Get

func (s *Storage) Get(key string) (*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 key does not exist.

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(filters ...FilterFunc) ([]*rspb.Release, error)

ListFilterAll returns the set of releases satisfying 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(filters ...FilterFunc) ([]*rspb.Release, error)

ListFilterAny returns the set of releases satisfying 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