tprstorage

package module
v0.0.0-...-88f4fe3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

README

CircleCI

tprstorage

The microstorage implementation using Kubernetes third-party-objects as its backend.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

Types

type Config

type Config struct {
	K8sClient kubernetes.Interface
	Logger    micrologger.Logger

	// TPR is the third party resource where data objects are stored.
	TPR TPRConfig

	// TPOName is the third party object used to store data. This object
	// will be created inside a third party resource specified by TPR. If
	// the object already exists it will be reused. It is safe to run
	// multiple Storage instances using the same TPO.
	TPO TPOConfig
}

func DefaultConfig

func DefaultConfig() Config

type Storage

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

func New

func New(config Config) (*Storage, error)

New creates an uninitialized instance of Storage. It is required to call Boot functions before running any RW operations.

func (*Storage) Boot

func (s *Storage) Boot(ctx context.Context) error

Boot initializes the Storage by ensuring Kubernetes resources used by the Storage are in place. It is safe to call Boot more than once.

func (*Storage) Delete

func (s *Storage) Delete(ctx context.Context, k microstorage.K) error

func (*Storage) Exists

func (s *Storage) Exists(ctx context.Context, k microstorage.K) (bool, error)

func (*Storage) List

func (s *Storage) List(ctx context.Context, k microstorage.K) ([]microstorage.KV, error)

func (*Storage) Put

func (s *Storage) Put(ctx context.Context, kv microstorage.KV) error

func (*Storage) Search

func (s *Storage) Search(ctx context.Context, k microstorage.K) (microstorage.KV, error)

type TPOConfig

type TPOConfig struct {
	Name, Namespace string
}

type TPRConfig

type TPRConfig struct {
	Name, Version, Description string
}

Jump to

Keyboard shortcuts

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