Documentation
¶
Index ¶
- type Batch
- type Config
- type KV
- type Store
- func (s *Store) Close() error
- func (s *Store) GetCandidates(_ context.Context, fp uint64, max int) ([]template.Candidate, error)
- func (s *Store) GetTemplateDef(_ context.Context, id uint64) ([]byte, error)
- func (s *Store) PutTemplateDef(_ context.Context, defBytes []byte, routeFPs []uint64) (uint64, error)
- func (s *Store) PutTemplateDefs(_ context.Context, defs []template.PublishSpec) ([]uint64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch interface {
Set(key, value []byte) error
Delete(key []byte) error
WriteSync() error
Close() error
}
Batch is the minimal batch interface used by templatedb.
type KV ¶
type KV interface {
Get(key []byte) ([]byte, error)
SetSync(key, value []byte) error
DeleteSync(key []byte) error
NewBatch() Batch
}
KV is the minimal public DB interface used by templatedb.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store provides access to template storage backed by a TreeDB public DB.
func (*Store) GetCandidates ¶
GetCandidates loads the candidate list for a fingerprint.
func (*Store) GetTemplateDef ¶
GetTemplateDef loads TemplateDefBytes for a template ID.
func (*Store) PutTemplateDef ¶
func (s *Store) PutTemplateDef(_ context.Context, defBytes []byte, routeFPs []uint64) (uint64, error)
PutTemplateDef stores a template definition and updates routing indices.
func (*Store) PutTemplateDefs ¶
PutTemplateDefs stores multiple template definitions and updates routing indices in a single durable batch.
This is an optional acceleration used by the template engine when publishing bursts of templates; it is equivalent to calling PutTemplateDef for each template, but coalesces WriteSync.