keyStorages

package
v0.0.0-...-06a89c9 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrStorageKeyNotFound - returned when value is not fould in storage (source or fallback cache)
	ErrStorageKeyNotFound = errors.New("Storage: Key not found")

	// ErrStorageConnectionFailed - returned when there was connection error to storage (source or fallback cache)
	ErrStorageConnectionFailed = errors.New("Storage: Connection failed")
)

Functions

This section is empty.

Types

type ETCDCache

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

ETCDCache - ETCD based key storage used as cache

func NewEtcdCache

func NewEtcdCache(endpoints []string, prefix string, ttl time.Duration) (*ETCDCache, error)

NewEtcdCache - constructor for etcd based key storage

func (*ETCDCache) Get

func (c *ETCDCache) Get(key string) (value string, err error)

Get - fetch value from key storage

func (*ETCDCache) Remove

func (c *ETCDCache) Remove(key string) (err error)

Remove - remove value by key from key storage

func (*ETCDCache) Set

func (c *ETCDCache) Set(key, value string) (err error)

Set - save value into key storage

type GithubKeys

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

GithubKeys - github api as key storage

func NewGithubKeys

func NewGithubKeys(token, owner, team string, teamID int) *GithubKeys

NewGithubKeys - constructor for github key storage

func (*GithubKeys) Get

func (s *GithubKeys) Get(user string) (value string, err error)

Get - fetch {user} ssh keys

type NilStorage

type NilStorage struct{}

NilStorage - empty key storage

func (*NilStorage) Get

func (c *NilStorage) Get(name string) (value string, err error)

Get - always return not found

func (*NilStorage) Remove

func (c *NilStorage) Remove(name string) (err error)

Remove - remove nothing but return nil error

func (*NilStorage) Set

func (c *NilStorage) Set(name, value string) (err error)

Set - save nothing but return nil error

type Proxy

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

Proxy - key storage fallback proxy.

	Always deal with source key storage first, and sync values with fallback cache storage
     If source key storage is unavailable fallback to cache storage

func NewProxy

func NewProxy(source source, fallbackCache fallbackCache) *Proxy

NewProxy - constructor to create Proxy object

func (*Proxy) Get

func (c *Proxy) Get(name string) (value string, err error)

Get - fetch value from key storage

Jump to

Keyboard shortcuts

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