Documentation
¶
Overview ¶
Package kv is an interface for key-value storage.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( GossipTopic = "go.micro.kv.announce" GossipEvent = time.Second * 1 ReaperEvent = time.Second * 10 )
View Source
var (
ErrNotFound = errors.New("not found")
)
Functions ¶
Types ¶
type Announcement ¶
type Announcement struct {
// Which namespace does it belong to
Namespace string
Address string
Timestamp int64
}
func (*Announcement) ContentType ¶
func (a *Announcement) ContentType() string
func (*Announcement) Message ¶
func (a *Announcement) Message() interface{}
func (*Announcement) Topic ¶
func (a *Announcement) Topic() string
type KV ¶
type Option ¶
type Option func(o *Options)
type Options ¶
type Options struct {
// Servers that store values for access
Servers []string
// Limit the scope of queries to a namespace
// In the case of platform it essentially
// means the topic we pub to for "gossip"
// For memcache and redis it could be key/prefix
Namespace string
// Number of replicas
// Default is 1 ofcourse
Replicas int
// Use a service rather than gossip
Service bool
// Whether handlers should be internal
Internal bool
// Replace with go-micro.Service?
Client client.Client
Server server.Server
// Alternative options set using Context
Context context.Context
}
Click to show internal directories.
Click to hide internal directories.