mock

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServerV2

type ServerV2 struct {
	mock.Mock
	// contains filtered or unexported fields
}

A mock Server for the v2 handlers.

func NewServerV2

func NewServerV2(store store.Store) *ServerV2

func (*ServerV2) ClientURL

func (s *ServerV2) ClientURL(name string) (string, bool)

func (*ServerV2) CommitIndex

func (s *ServerV2) CommitIndex() uint64

func (*ServerV2) Dispatch

func (s *ServerV2) Dispatch(c raft.Command, w http.ResponseWriter, req *http.Request) error

func (*ServerV2) Leader

func (s *ServerV2) Leader() string

func (*ServerV2) PeerURL

func (s *ServerV2) PeerURL(name string) (string, bool)

func (*ServerV2) State

func (s *ServerV2) State() string

func (*ServerV2) Store

func (s *ServerV2) Store() store.Store

func (*ServerV2) Term

func (s *ServerV2) Term() uint64

type Store

type Store struct {
	mock.Mock
}

A mock Store object used for testing.

func NewStore

func NewStore() *Store

func (*Store) CompareAndSwap

func (s *Store) CompareAndSwap(nodePath string, prevValue string, prevIndex uint64, value string, expireTime time.Time, index uint64, term uint64) (*store.Event, error)

func (*Store) Create

func (s *Store) Create(nodePath string, value string, incrementalSuffix bool, expireTime time.Time, index uint64, term uint64) (*store.Event, error)

func (*Store) Delete

func (s *Store) Delete(nodePath string, recursive bool, index uint64, term uint64) (*store.Event, error)

func (*Store) Get

func (s *Store) Get(nodePath string, recursive, sorted bool, index uint64, term uint64) (*store.Event, error)

func (*Store) JsonStats

func (s *Store) JsonStats() []byte

func (*Store) Recovery

func (s *Store) Recovery(b []byte) error

func (*Store) Save

func (s *Store) Save() ([]byte, error)

func (*Store) Set

func (s *Store) Set(nodePath string, value string, expireTime time.Time, index uint64, term uint64) (*store.Event, error)

func (*Store) Update

func (s *Store) Update(nodePath string, newValue string, expireTime time.Time, index uint64, term uint64) (*store.Event, error)

func (*Store) Watch

func (s *Store) Watch(prefix string, recursive bool, sinceIndex uint64, index uint64, term uint64) (<-chan *store.Event, error)

Jump to

Keyboard shortcuts

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