api

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const InfoNameSpace = "info"

Variables

View Source
var ErrNilValue = errors.New("value cannot be nil")
View Source
var ErrRepoExists = errors.New("repository already exists")
View Source
var ErrTypeChange = errors.New("cannot change existing feature types")

Functions

func KeyNotFoundError

func KeyNotFoundError(n string) error

Types

type Client

type Client struct {
	Store   stores.StoreIFace
	Repo    repo.IFace
	Watcher watchers.KVWatcherIFace
	Stats   *godspeed.Godspeed
	// contains filtered or unexported fields
}

func New

func (*Client) Commit

func (c *Client) Commit(ft *models.Feature, deleted bool) error

func (*Client) Delete

func (c *Client) Delete(key string, scope string) error

func (*Client) Get

func (c *Client) Get(key string, v interface{}) error

func (*Client) GetInfo

func (c *Client) GetInfo() (*models.Info, error)

func (*Client) InitRepo

func (c *Client) InitRepo(create bool) error

func (*Client) KVsToFeatureMap added in v0.2.2

func (c *Client) KVsToFeatureMap(kvb stores.KVBytes) (*models.FeatureMap, error)

KVsToFeatures helper for unmarshalling `KVBytes` to a `FeatureMap`

func (*Client) List

func (c *Client) List(prefix string, scope string) (models.Features, error)

func (*Client) Namespace

func (c *Client) Namespace() string

func (*Client) Push

func (c *Client) Push() error

func (*Client) SendStatEvent

func (c *Client) SendStatEvent(f *models.Feature, delete bool) error

func (*Client) Set

func (c *Client) Set(ft *models.Feature) error

func (*Client) UpdateCurrentSHA added in v0.2.2

func (c *Client) UpdateCurrentSHA() (string, error)

func (*Client) Watch

func (c *Client) Watch()

func (*Client) WriteOutputFile

func (c *Client) WriteOutputFile(kvb stores.KVBytes)

type ClientIFace

type ClientIFace interface {
	List(prefix string, scope string) (models.Features, error)
	Set(ft *models.Feature) error
	Get(key string, v interface{}) error
	Delete(key string, scope string) error
	GetInfo() (*models.Info, error)
	InitRepo(create bool) error
	Commit(ft *models.Feature, deleted bool) error
	Push() error
	UpdateCurrentSHA() (string, error)
	Watch()
	Namespace() string
}

type MockRepo

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

func (*MockRepo) Clone

func (mr *MockRepo) Clone() error

func (*MockRepo) Commit

func (mr *MockRepo) Commit(bts []byte, msg string) error

func (*MockRepo) Create

func (mr *MockRepo) Create() error

func (*MockRepo) CurrentSHA added in v0.2.2

func (mr *MockRepo) CurrentSHA() (string, error)

func (*MockRepo) Enabled

func (mr *MockRepo) Enabled() bool

func (*MockRepo) Exists

func (mr *MockRepo) Exists() bool

func (*MockRepo) Init

func (mr *MockRepo) Init()

func (*MockRepo) Pull

func (mr *MockRepo) Pull() error

func (*MockRepo) Push

func (mr *MockRepo) Push() error

type MockStore

type MockStore struct {
	Item  *stores.KVByte
	Items stores.KVBytes
	Err   error
}

func NewMockStore

func NewMockStore(ft *models.Feature, err error) (ms *MockStore)

func (*MockStore) Delete

func (ms *MockStore) Delete(key string) error

func (*MockStore) Get

func (ms *MockStore) Get(key string) (*stores.KVByte, error)

func (*MockStore) List

func (ms *MockStore) List(prefix string) (stores.KVBytes, error)

func (*MockStore) Put

func (ms *MockStore) Put(key string, bts []byte) error

func (*MockStore) Set

func (ms *MockStore) Set(key string, bts []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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