memory

package
v0.0.0-...-affaa53 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

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

Bundle implements in-memory storage for Bundle entities.

func NewBundle

func NewBundle() *Bundle

NewBundle creates new storage for Bundles

func (*Bundle) FindAll

func (s *Bundle) FindAll() ([]*internal.Bundle, error)

FindAll returns all objects from storage.

func (*Bundle) Get

func (s *Bundle) Get(name internal.BundleName, ver semver.Version) (*internal.Bundle, error)

Get returns object from storage.

func (*Bundle) GetByID

func (s *Bundle) GetByID(id internal.BundleID) (*internal.Bundle, error)

GetByID returns object by primary ID from storage.

func (*Bundle) Remove

func (s *Bundle) Remove(name internal.BundleName, ver semver.Version) error

Remove removes object from storage.

func (*Bundle) RemoveAll

func (s *Bundle) RemoveAll() error

RemoveAll removes all bundles from storage.

func (*Bundle) RemoveByID

func (s *Bundle) RemoveByID(id internal.BundleID) error

RemoveByID is removing object by primary ID from storage.

func (*Bundle) Upsert

func (s *Bundle) Upsert(b *internal.Bundle) (replaced bool, err error)

Upsert persists object in storage.

If bundle already exists in storage than full replace is performed.

True is returned if object already existed in storage and was replaced.

type Chart

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

Chart entity

func NewChart

func NewChart() *Chart

NewChart creates new storage for Charts

func (*Chart) Get

func (s *Chart) Get(name internal.ChartName, ver semver.Version) (*chart.Chart, error)

Get returns from memory Chart with given name and version

func (*Chart) Remove

func (s *Chart) Remove(name internal.ChartName, ver semver.Version) error

Remove removes from memory Chart with given name and version

func (*Chart) Upsert

func (s *Chart) Upsert(c *chart.Chart) (replaced bool, err error)

Upsert persists Chart in memory.

If chart already exists in storage than full replace is performed.

True is returned if chart already existed in storage and was replaced.

type Config

type Config struct {
	MaxKeys int64 `json:"max-keys"`
}

Config provide config for storage

type Instance

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

Instance implements in-memory storage for Instance entities.

func NewInstance

func NewInstance() *Instance

NewInstance creates new Instances storage

func (*Instance) Get

Get returns object from storage.

func (*Instance) GetAll

func (s *Instance) GetAll() ([]*internal.Instance, error)

GetAll returns collection of Instance objects from storage

func (*Instance) Insert

func (s *Instance) Insert(i *internal.Instance) error

Insert inserts object to storage.

func (*Instance) Remove

func (s *Instance) Remove(id internal.InstanceID) error

Remove removing object from storage.

type InstanceBindData

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

InstanceBindData implements in-memory based storage for BindData.

func NewInstanceBindData

func NewInstanceBindData() *InstanceBindData

NewInstanceBindData returns new instance of BindData storage.

func (*InstanceBindData) Get

Get returns object from storage.

func (*InstanceBindData) Insert

Insert inserts object into storage.

func (*InstanceBindData) Remove

func (s *InstanceBindData) Remove(iID internal.InstanceID) error

Remove removes object from storage.

type InstanceOperation

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

InstanceOperation implements in-memory storage InstanceOperation.

func NewInstanceOperation

func NewInstanceOperation() *InstanceOperation

NewInstanceOperation returns new instance of InstanceOperation storage.

func (*InstanceOperation) Get

Get returns object from storage.

func (*InstanceOperation) GetAll

GetAll returns all objects from storage.

func (*InstanceOperation) Insert

Insert inserts object into storage.

func (*InstanceOperation) Remove

Remove removes object from storage.

func (*InstanceOperation) UpdateState

UpdateState modifies state on object in storage.

func (*InstanceOperation) UpdateStateDesc

func (s *InstanceOperation) UpdateStateDesc(iID internal.InstanceID, opID internal.OperationID, state internal.OperationState, desc *string) error

UpdateStateDesc updates both state and description for single operation. If desc is nil than description will be removed.

func (*InstanceOperation) WithTimeProvider

func (s *InstanceOperation) WithTimeProvider(nowProvider func() time.Time) *InstanceOperation

WithTimeProvider allows for passing custom time provider. Used mostly in testing.

Jump to

Keyboard shortcuts

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