Documentation ¶
Index ¶
- Constants
- Variables
- type Bucket
- func (b *Bucket) Cursor(opts ...kv.CursorHint) (kv.Cursor, error)
- func (b *Bucket) Delete(key []byte) error
- func (b *Bucket) ForwardCursor(seek []byte, opts ...kv.CursorOption) (kv.ForwardCursor, error)
- func (b *Bucket) Get(key []byte) ([]byte, error)
- func (b *Bucket) GetBatch(keys ...[]byte) ([][]byte, error)
- func (b *Bucket) Put(key []byte, value []byte) error
- type ForwardCursor
- type KVStore
- func (s *KVStore) Backup(ctx context.Context, w io.Writer) error
- func (s *KVStore) Buckets(ctx context.Context) [][]byte
- func (s *KVStore) CreateBucket(ctx context.Context, name []byte) error
- func (s *KVStore) DeleteBucket(ctx context.Context, name []byte) error
- func (s *KVStore) Flush(ctx context.Context)
- func (s *KVStore) Restore(ctx context.Context, r io.Reader) error
- func (s *KVStore) Update(ctx context.Context, fn func(kv.Tx) error) error
- func (s *KVStore) View(ctx context.Context, fn func(kv.Tx) error) error
- type Service
- func (s *Service) Create(ctx context.Context, m *influxdb.DBRPMapping) error
- func (s *Service) DefaultSource(ctx context.Context) (*platform.Source, error)
- func (s *Service) Delete(ctx context.Context, cluster, db, rp string) error
- func (s *Service) Find(ctx context.Context, filter influxdb.DBRPMappingFilter) (*influxdb.DBRPMapping, error)
- func (s *Service) FindBy(ctx context.Context, cluster, db, rp string) (*influxdb.DBRPMapping, error)
- func (s *Service) FindMany(ctx context.Context, filter influxdb.DBRPMappingFilter, ...) ([]*influxdb.DBRPMapping, int, error)
- func (s *Service) FindSourceByID(ctx context.Context, id platform.ID) (*platform.Source, error)
- func (s *Service) FindSources(ctx context.Context, opt platform.FindOptions) ([]*platform.Source, int, error)
- func (s *Service) Flush()
- func (s *Service) PutDBRPMapping(ctx context.Context, m *influxdb.DBRPMapping) error
- func (s *Service) PutSource(ctx context.Context, src *platform.Source) error
- type SessionStore
- type Tx
Constants ¶
const ( // DefaultSourceID it the default source identifier DefaultSourceID = "020f755c3c082000" // DefaultSourceOrganizationID is the default source's organization identifier DefaultSourceOrganizationID = "50616e67652c206c" )
const OpPrefix = "inmem/"
OpPrefix is the op prefix.
Variables ¶
var DefaultSource = platform.Source{ Default: true, Name: "autogen", Type: platform.SelfSourceType, }
DefaultSource is the default source.
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
Bucket is a btree that implements kv.Bucket.
func (*Bucket) ForwardCursor ¶
func (b *Bucket) ForwardCursor(seek []byte, opts ...kv.CursorOption) (kv.ForwardCursor, error)
ForwardCursor returns a directional cursor which starts at the provided seeked key
type ForwardCursor ¶
type ForwardCursor struct {
// contains filtered or unexported fields
}
ForwardCursor is a kv.ForwardCursor which iterates over an in-memory btree
func (*ForwardCursor) Close ¶
func (c *ForwardCursor) Close() error
Close releases the producing goroutines for the forward cursor. It blocks until the producing goroutine exits.
func (*ForwardCursor) Err ¶
func (c *ForwardCursor) Err() error
Err returns a non-nil error when an error occurred during cursor iteration.
func (*ForwardCursor) Next ¶
func (c *ForwardCursor) Next() ([]byte, []byte)
Next returns the next key/value pair in the cursor
type KVStore ¶
type KVStore struct {
// contains filtered or unexported fields
}
KVStore is an in memory btree backed kv.Store.
func (*KVStore) CreateBucket ¶
CreateBucket creates a bucket with the provided name if one does not exist.
func (*KVStore) DeleteBucket ¶
DeleteBucket creates a bucket with the provided name if one does not exist.
type Service ¶
type Service struct { TokenGenerator platform.TokenGenerator IDGenerator platform.IDGenerator platform.TimeGenerator // contains filtered or unexported fields }
Service implements various top level services.
func (*Service) DefaultSource ¶
DefaultSource retrieves the default source.
func (*Service) Find ¶
func (s *Service) Find(ctx context.Context, filter influxdb.DBRPMappingFilter) (*influxdb.DBRPMapping, error)
Find returns the first dbrp mapping that matches filter.
func (*Service) FindBy ¶
func (s *Service) FindBy(ctx context.Context, cluster, db, rp string) (*influxdb.DBRPMapping, error)
FindBy returns a single dbrp mapping by cluster, db and rp.
func (*Service) FindMany ¶
func (s *Service) FindMany(ctx context.Context, filter influxdb.DBRPMappingFilter, opt ...influxdb.FindOptions) ([]*influxdb.DBRPMapping, int, error)
FindMany returns a list of dbrpMappings that match filter and the total count of matching dbrp mappings. Additional options provide pagination & sorting.
func (*Service) FindSourceByID ¶
FindSourceByID retrieves a source by id.
func (*Service) FindSources ¶
func (s *Service) FindSources(ctx context.Context, opt platform.FindOptions) ([]*platform.Source, int, error)
FindSources retrives all sources that match an arbitrary source filter. Filters using ID, or OrganizationID and source Name should be efficient. Other filters will do a linear scan across all sources searching for a match.
func (*Service) PutDBRPMapping ¶
PutDBRPMapping sets dbrpMapping with the current ID.
type SessionStore ¶
type SessionStore struct {
// contains filtered or unexported fields
}
func NewSessionStore ¶
func NewSessionStore() *SessionStore
func (*SessionStore) Delete ¶
func (s *SessionStore) Delete(key string) error
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
Tx is an in memory transaction. TODO: make transactions actually transactional
func (*Tx) WithContext ¶
WithContext sets the context for the transaction.