Documentation ¶
Overview ¶
Package table implements lookup table interfaces for protobufs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoSuchKey = errors.New("no such key")
ErrNoSuchKey is returned when a value was not found for a particular key.
Functions ¶
This section is empty.
Types ¶
type BufferedProto ¶ added in v0.0.16
type BufferedProto interface { // Put marshals msg and writes it as the value for the given key. Put(ctx context.Context, key []byte, msg proto.Message) error // Flush sends all buffered writes to the underlying table. Flush(ctx context.Context) error }
BufferedProto buffers calls to Put to provide a high throughput write interface to a Proto table.
type KVProto ¶
KVProto implements a Proto table using a keyvalue.DB.
func (*KVProto) Buffered ¶ added in v0.0.16
func (t *KVProto) Buffered() BufferedProto
Buffered implements part of the Proto interface.
type Proto ¶
type Proto interface { ProtoLookup // Put marshals msg and writes it as the value for the given key. Put(ctx context.Context, key []byte, msg proto.Message) error // Buffered returns a buffered write interface. Buffered() BufferedProto // Close release the underlying resources for the table. Close(context.Context) error }
Proto is a key-value direct lookup table with protobuf values.
type ProtoLookup ¶ added in v0.0.28
type ProtoLookup interface { // Lookup unmarshals the value for the given key into msg, returning any // error. If the key was not found, ErrNoSuchKey is returned. Lookup(ctx context.Context, key []byte, msg proto.Message) error }
ProtoLookup is a read-only key-value direct lookup table with protobuf values.
Click to show internal directories.
Click to hide internal directories.