Documentation ¶
Index ¶
- Variables
- func HostOfURL(rawurl string) string
- type HTTPGetter
- type HTTPGetterFunc
- type HTTPPoster
- type HTTPPosterFunc
- type Meta
- type RPCClient
- type RPCClientFunc
- type Store
- func (s *Store) Add(key, value string) error
- func (s *Store) Get(key string) (string, error)
- func (s *Store) Join(addr string) error
- func (s *Store) Leader() string
- func (s *Store) Open(singleMode bool) error
- func (s *Store) Peers() ([]string, error)
- func (s *Store) SetLeader(leader string)
- func (s *Store) Stats() map[string]string
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultMeta = &Meta{data: map[string]string{}}
DefaultMeta for default mock meta
View Source
var DefaultWatchPeriod = time.Millisecond * 500
DefaultWatchPeriod for value changing period
Functions ¶
Types ¶
type HTTPGetter ¶
HTTPGetter for mock http.Get
func HTTPGetterCluster ¶
func HTTPGetterCluster(getterMap map[string]HTTPGetter) HTTPGetter
HTTPGetterCluster combine getters into one getter
func MakeHTTPGetter ¶
MakeHTTPGetter makes a HTTPGetter using the given params
type HTTPGetterFunc ¶
HTTPGetterFunc implements HTTPGetter
type HTTPPoster ¶
type HTTPPoster interface {
Post(url string, contentType string, body io.Reader) (resp *http.Response, err error)
}
HTTPPoster fot mock http.Post
func HTTPPosterCluster ¶
func HTTPPosterCluster(posterMap map[string]HTTPPoster) HTTPPoster
HTTPPosterCluster combine poster into one poster
func MakeHTTPPoster ¶
MakeHTTPPoster makes a HTTPPoster using the given params
type HTTPPosterFunc ¶
type HTTPPosterFunc func(url string, contentType string, body io.Reader) (resp *http.Response, err error)
HTTPPosterFunc implements HTTPPoster
type Meta ¶
Meta a meta.Meta mock
func (*Meta) WatchModify ¶
WatchModify watch the modification event of the value the given key and execute the do
type RPCClientFunc ¶
RPCClientFunc defines Call method of RPCClient interface
func (RPCClientFunc) Call ¶
func (f RPCClientFunc) Call(serviceMethod string, args interface{}, reply interface{}) error
Call implements RPCClient interface
type Store ¶
Store mocks the db/node.Store
Click to show internal directories.
Click to hide internal directories.