etcd

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: 16 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 etcd storage for Bundle entities.

func NewBundle

func NewBundle(cli clientv3.KV) (*Bundle, error)

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) (bool, 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 provides storage operations on Chart entity

func NewChart

func NewChart(cli clientv3.KV) (*Chart, error)

NewChart creates new storage for Charts

func (*Chart) Get

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

Get returns chart with given name and version from storage

func (*Chart) Remove

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

Remove is removing chart with given name and version from storage

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.

Replace is set to true if chart already existed in storage and was replaced.

type Client

type Client interface {
	clientv3.KV
}

Client wraps etcd client for testing purposes.

func NewClient

func NewClient(cfg Config) (Client, error)

NewClient produces new, configured etcd client.

type Config

type Config struct {
	Endpoints []string `json:"endpoints"`
	Username  string   `json:"username"`
	Password  string   `json:"password"`

	ForceClient *clientv3.Client
}

Config holds configuration for etcd access in storage.

type Instance

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

Instance implements etcd based storage for Instance entities.

func NewInstance

func NewInstance(cli clientv3.KV) (*Instance, error)

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 etcd based storage for BindData.

func NewInstanceBindData

func NewInstanceBindData(cli clientv3.KV) (*InstanceBindData, error)

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 etcd based storage InstanceOperation.

func NewInstanceOperation

func NewInstanceOperation(cli clientv3.KV) (*InstanceOperation, error)

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 modifies state and description on object in storage. 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