Documentation ¶
Index ¶
- Variables
- func RegisterLazaretteServer(s *grpc.Server, srv LazaretteServer)
- type Cache
- func (c *Cache) Clean() error
- func (c *Cache) Close() error
- func (c *Cache) Get(ctx context.Context, key *Key) (*Value, error)
- func (c *Cache) NewSubscription(prefix string) (*Subscription, error)
- func (c *Cache) Replicate(ctx context.Context, prefix, addr string) error
- func (c *Cache) Set(ctx context.Context, kv *KeyValue) (*empty.Empty, error)
- func (c *Cache) Subscribe(prefix *Key, stream Lazarette_SubscribeServer) error
- type Key
- func (*Key) Descriptor() ([]byte, []int)
- func (m *Key) GetKey() string
- func (*Key) ProtoMessage()
- func (m *Key) Reset()
- func (m *Key) String() string
- func (m *Key) XXX_DiscardUnknown()
- func (m *Key) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Key) XXX_Merge(src proto.Message)
- func (m *Key) XXX_Size() int
- func (m *Key) XXX_Unmarshal(b []byte) error
- type KeyValue
- func (*KeyValue) Descriptor() ([]byte, []int)
- func (m *KeyValue) GetData() []byte
- func (m *KeyValue) GetKey() string
- func (m *KeyValue) GetTimestamp() *timestamp.Timestamp
- func (*KeyValue) ProtoMessage()
- func (m *KeyValue) Reset()
- func (m *KeyValue) String() string
- func (m *KeyValue) XXX_DiscardUnknown()
- func (m *KeyValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *KeyValue) XXX_Merge(src proto.Message)
- func (m *KeyValue) XXX_Size() int
- func (m *KeyValue) XXX_Unmarshal(b []byte) error
- type LazaretteClient
- type LazaretteServer
- type Lazarette_SubscribeClient
- type Lazarette_SubscribeServer
- type Option
- type Subscription
- type UnimplementedLazaretteServer
- type Value
- func (*Value) Descriptor() ([]byte, []int)
- func (m *Value) GetData() []byte
- func (m *Value) GetTimestamp() *timestamp.Timestamp
- func (*Value) ProtoMessage()
- func (m *Value) Reset()
- func (m *Value) String() string
- func (m *Value) XXX_DiscardUnknown()
- func (m *Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Value) XXX_Merge(src proto.Message)
- func (m *Value) XXX_Size() int
- func (m *Value) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrKeyNotFound = errors.New("key not found in cache")
View Source
var ErrNotNew = errors.New("a newer value was found; not setting")
ErrNotNew is returned when a newer value is found and a value is not set
Functions ¶
func RegisterLazaretteServer ¶
func RegisterLazaretteServer(s *grpc.Server, srv LazaretteServer)
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache .
func (*Cache) NewSubscription ¶
func (c *Cache) NewSubscription(prefix string) (*Subscription, error)
type Key ¶
type Key struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Key) Descriptor ¶
func (*Key) ProtoMessage ¶
func (*Key) ProtoMessage()
func (*Key) XXX_DiscardUnknown ¶
func (m *Key) XXX_DiscardUnknown()
func (*Key) XXX_Unmarshal ¶
type KeyValue ¶
type KeyValue struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Timestamp *timestamp.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*KeyValue) Descriptor ¶
func (*KeyValue) GetTimestamp ¶
func (*KeyValue) ProtoMessage ¶
func (*KeyValue) ProtoMessage()
func (*KeyValue) XXX_DiscardUnknown ¶
func (m *KeyValue) XXX_DiscardUnknown()
func (*KeyValue) XXX_Marshal ¶
func (*KeyValue) XXX_Unmarshal ¶
type LazaretteClient ¶
type LazaretteClient interface { Get(ctx context.Context, in *Key, opts ...grpc.CallOption) (*Value, error) Set(ctx context.Context, in *KeyValue, opts ...grpc.CallOption) (*empty.Empty, error) Subscribe(ctx context.Context, in *Key, opts ...grpc.CallOption) (Lazarette_SubscribeClient, error) }
LazaretteClient is the client API for Lazarette service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewLazaretteClient ¶
func NewLazaretteClient(cc *grpc.ClientConn) LazaretteClient
type LazaretteServer ¶
type LazaretteServer interface { Get(context.Context, *Key) (*Value, error) Set(context.Context, *KeyValue) (*empty.Empty, error) Subscribe(*Key, Lazarette_SubscribeServer) error }
LazaretteServer is the server API for Lazarette service.
type Lazarette_SubscribeClient ¶
type Lazarette_SubscribeClient interface { Recv() (*KeyValue, error) grpc.ClientStream }
type Lazarette_SubscribeServer ¶
type Lazarette_SubscribeServer interface { Send(*KeyValue) error grpc.ServerStream }
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is an option to the cache struct
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
func (*Subscription) Changes ¶
func (s *Subscription) Changes() chan *KeyValue
func (*Subscription) Done ¶
func (s *Subscription) Done() chan struct{}
func (*Subscription) Stop ¶
func (s *Subscription) Stop()
type UnimplementedLazaretteServer ¶
type UnimplementedLazaretteServer struct { }
UnimplementedLazaretteServer can be embedded to have forward compatible implementations.
func (*UnimplementedLazaretteServer) Subscribe ¶
func (*UnimplementedLazaretteServer) Subscribe(req *Key, srv Lazarette_SubscribeServer) error
type Value ¶
type Value struct { Timestamp *timestamp.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Value) Descriptor ¶
func (*Value) GetTimestamp ¶
func (*Value) ProtoMessage ¶
func (*Value) ProtoMessage()
func (*Value) XXX_DiscardUnknown ¶
func (m *Value) XXX_DiscardUnknown()
func (*Value) XXX_Marshal ¶
func (*Value) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.