Documentation ¶
Overview ¶
Package sqlite implements the fleetspeak datastore interface using an sqlite database. It is meant for testing for small single-server deployments. In particular, having multiple servers using the same sqlite datastore is not supported.
Index ¶
- type Datastore
- func (d *Datastore) AddClient(ctx context.Context, id common.ClientID, data *db.ClientData) error
- func (d *Datastore) AddClientLabel(ctx context.Context, id common.ClientID, l *fspb.Label) error
- func (d *Datastore) BlacklistClient(ctx context.Context, id common.ClientID) error
- func (d *Datastore) CleanupAllocation(ctx context.Context, bID ids.BroadcastID, aID ids.AllocationID) error
- func (d *Datastore) ClientMessagesForProcessing(ctx context.Context, id common.ClientID, lim uint64, ...) ([]*fspb.Message, error)
- func (d *Datastore) Close() error
- func (d *Datastore) CreateAllocation(ctx context.Context, id ids.BroadcastID, frac float32, expiry time.Time) (*db.AllocationInfo, error)
- func (d *Datastore) CreateBroadcast(ctx context.Context, b *spb.Broadcast, limit uint64) error
- func (d *Datastore) DeletePendingMessages(ctx context.Context, ids []common.ClientID) error
- func (d *Datastore) FetchResourceUsageRecords(ctx context.Context, id common.ClientID, ...) ([]*spb.ClientResourceUsageRecord, error)
- func (d *Datastore) GetClientData(ctx context.Context, id common.ClientID) (*db.ClientData, error)
- func (d *Datastore) GetMessageResult(ctx context.Context, id common.MessageID) (*fspb.MessageResult, error)
- func (d *Datastore) GetMessages(ctx context.Context, ids []common.MessageID, wantData bool) ([]*fspb.Message, error)
- func (d *Datastore) GetPendingMessageCount(ctx context.Context, ids []common.ClientID) (uint64, error)
- func (d *Datastore) GetPendingMessages(ctx context.Context, ids []common.ClientID, offset uint64, limit uint64, ...) ([]*fspb.Message, error)
- func (d *Datastore) IsNotFound(err error) bool
- func (d *Datastore) LinkMessagesToContact(ctx context.Context, contact db.ContactID, ids []common.MessageID) error
- func (d *Datastore) ListActiveBroadcasts(ctx context.Context) ([]*db.BroadcastInfo, error)
- func (d *Datastore) ListClientContacts(ctx context.Context, id common.ClientID) ([]*spb.ClientContact, error)
- func (d *Datastore) ListClients(ctx context.Context, ids []common.ClientID) ([]*spb.Client, error)
- func (d *Datastore) ListSentBroadcasts(ctx context.Context, id common.ClientID) ([]ids.BroadcastID, error)
- func (d *Datastore) ReadFile(ctx context.Context, service, name string) (data db.ReadSeekerCloser, modtime time.Time, err error)
- func (d *Datastore) RecordClientContact(ctx context.Context, data db.ContactData) (db.ContactID, error)
- func (d *Datastore) RecordResourceUsageData(ctx context.Context, id common.ClientID, rud *mpb.ResourceUsageData) error
- func (d *Datastore) RegisterMessageProcessor(mp db.MessageProcessor)
- func (d *Datastore) RemoveClientLabel(ctx context.Context, id common.ClientID, l *fspb.Label) error
- func (d *Datastore) SaveBroadcastMessage(ctx context.Context, msg *fspb.Message, bID ids.BroadcastID, ...) error
- func (d *Datastore) SetBroadcastLimit(ctx context.Context, id ids.BroadcastID, limit uint64) error
- func (d *Datastore) SetMessageResult(ctx context.Context, dest common.ClientID, id common.MessageID, ...) error
- func (d *Datastore) StatFile(ctx context.Context, service, name string) (time.Time, error)
- func (d *Datastore) StopMessageProcessor()
- func (d *Datastore) StoreFile(ctx context.Context, service, name string, data io.Reader) error
- func (d *Datastore) StoreMessages(ctx context.Context, msgs []*fspb.Message, contact db.ContactID) error
- func (d *Datastore) StreamClientContacts(ctx context.Context, id common.ClientID, ...) error
- func (d *Datastore) StreamClientIds(ctx context.Context, includeBlacklisted bool, lastContactAfter *time.Time, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Datastore ¶
type Datastore struct {
// contains filtered or unexported fields
}
Datastore wraps an sqlite database and implements db.Store.
func MakeDatastore ¶
MakeDatastore opens the given sqlite database file and creates any missing tables.
func (*Datastore) AddClientLabel ¶
func (*Datastore) BlacklistClient ¶
func (*Datastore) CleanupAllocation ¶
func (d *Datastore) CleanupAllocation(ctx context.Context, bID ids.BroadcastID, aID ids.AllocationID) error
func (*Datastore) ClientMessagesForProcessing ¶
func (d *Datastore) ClientMessagesForProcessing(ctx context.Context, id common.ClientID, lim uint64, serviceLimits map[string]uint64) ([]*fspb.Message, error)
ClientMessagesForProcessing implements db.MessageStore.
func (*Datastore) CreateAllocation ¶
func (*Datastore) CreateBroadcast ¶
func (*Datastore) DeletePendingMessages ¶
func (*Datastore) FetchResourceUsageRecords ¶
func (*Datastore) GetClientData ¶
func (*Datastore) GetMessageResult ¶
func (*Datastore) GetMessages ¶
func (*Datastore) GetPendingMessageCount ¶
func (*Datastore) GetPendingMessages ¶
func (*Datastore) IsNotFound ¶
IsNotFound implements db.Store.
func (*Datastore) LinkMessagesToContact ¶
func (*Datastore) ListActiveBroadcasts ¶
func (*Datastore) ListClientContacts ¶
func (*Datastore) ListClients ¶
func (*Datastore) ListSentBroadcasts ¶
func (*Datastore) RecordClientContact ¶
func (*Datastore) RecordResourceUsageData ¶
func (*Datastore) RegisterMessageProcessor ¶
func (d *Datastore) RegisterMessageProcessor(mp db.MessageProcessor)
func (*Datastore) RemoveClientLabel ¶
func (*Datastore) SaveBroadcastMessage ¶
func (*Datastore) SetBroadcastLimit ¶
func (*Datastore) SetMessageResult ¶
func (*Datastore) StopMessageProcessor ¶
func (d *Datastore) StopMessageProcessor()
func (*Datastore) StoreMessages ¶
func (*Datastore) StreamClientContacts ¶
Click to show internal directories.
Click to hide internal directories.