inmem

package
v0.0.0-...-98a7958 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore

type Datastore struct {
	Driver string

	// Embedded interface to avoid implementing new methods for (now
	// deprecated) inmem.
	kolide.Datastore
	// contains filtered or unexported fields
}

func New

func New(config config.KolideConfig) (*Datastore, error)

func (*Datastore) AddHostToPack

func (d *Datastore) AddHostToPack(hid, pid uint) error

func (*Datastore) AddLabelToPack

func (d *Datastore) AddLabelToPack(lid, pid uint, opts ...kolide.OptionalArg) error

func (*Datastore) AppConfig

func (d *Datastore) AppConfig() (*kolide.AppConfig, error)

func (*Datastore) AuthenticateHost

func (d *Datastore) AuthenticateHost(nodeKey string) (*kolide.Host, error)

func (*Datastore) Begin

func (d *Datastore) Begin() (kolide.Transaction, error)

func (*Datastore) CleanupDistributedQueryCampaigns

func (d *Datastore) CleanupDistributedQueryCampaigns(now time.Time) (expired uint, err error)

func (*Datastore) ConfirmPendingEmailChange

func (ds *Datastore) ConfirmPendingEmailChange(uid uint, token string) (string, error)

func (*Datastore) CountHostsInTargets

func (d *Datastore) CountHostsInTargets(hostIDs, labelIDs []uint, now time.Time) (kolide.TargetMetrics, error)

func (*Datastore) DeleteHost

func (d *Datastore) DeleteHost(hid uint) error

func (*Datastore) DeleteInvite

func (d *Datastore) DeleteInvite(id uint) error

DeleteInvite deletes an invitation.

func (*Datastore) DeletePasswordResetRequest

func (d *Datastore) DeletePasswordResetRequest(req *kolide.PasswordResetRequest) error

func (*Datastore) DeletePasswordResetRequestsForUser

func (d *Datastore) DeletePasswordResetRequestsForUser(userID uint) error

func (*Datastore) DeleteQueries

func (d *Datastore) DeleteQueries(ids []uint) (uint, error)

DeleteQueries deletes the existing query objects with the provided IDs. The number of deleted queries is returned along with any error.

func (*Datastore) DestroyAllSessionsForUser

func (d *Datastore) DestroyAllSessionsForUser(id uint) error

func (*Datastore) DestroySession

func (d *Datastore) DestroySession(session *kolide.Session) error

func (*Datastore) DistributedQueryCampaign

func (d *Datastore) DistributedQueryCampaign(id uint) (*kolide.DistributedQueryCampaign, error)

func (*Datastore) DistributedQueryCampaignTargetIDs

func (d *Datastore) DistributedQueryCampaignTargetIDs(id uint) (hostIDs []uint, labelIDs []uint, err error)

func (*Datastore) Drop

func (d *Datastore) Drop() error

func (*Datastore) EnrollHost

func (d *Datastore) EnrollHost(osQueryHostID, nodeKey, secretName string) (*kolide.Host, error)

func (*Datastore) FindPassswordResetByID

func (d *Datastore) FindPassswordResetByID(id uint) (*kolide.PasswordResetRequest, error)

func (*Datastore) FindPassswordResetByToken

func (d *Datastore) FindPassswordResetByToken(token string) (*kolide.PasswordResetRequest, error)

func (*Datastore) FindPassswordResetByTokenAndUserID

func (d *Datastore) FindPassswordResetByTokenAndUserID(token string, userID uint) (*kolide.PasswordResetRequest, error)

func (*Datastore) FindPassswordResetsByUserID

func (d *Datastore) FindPassswordResetsByUserID(userID uint) ([]*kolide.PasswordResetRequest, error)

func (*Datastore) GenerateHostStatusStatistics

func (d *Datastore) GenerateHostStatusStatistics(now time.Time) (online, offline, mia, new uint, err error)

func (*Datastore) Host

func (d *Datastore) Host(id uint) (*kolide.Host, error)

func (*Datastore) Initialize

func (d *Datastore) Initialize() error

func (*Datastore) Invite

func (d *Datastore) Invite(id uint) (*kolide.Invite, error)

func (*Datastore) InviteByEmail

func (d *Datastore) InviteByEmail(email string) (*kolide.Invite, error)

InviteByEmail retrieves an invite for a specific email address.

func (*Datastore) InviteByToken

func (d *Datastore) InviteByToken(token string) (*kolide.Invite, error)

InviteByToken retrieves an invite given the invite token.

func (*Datastore) Label

func (d *Datastore) Label(lid uint) (*kolide.Label, error)

func (*Datastore) LabelQueriesForHost

func (d *Datastore) LabelQueriesForHost(host *kolide.Host, cutoff time.Time) (map[string]string, error)

func (*Datastore) ListExplicitHostsInPack

func (d *Datastore) ListExplicitHostsInPack(pid uint, opt kolide.ListOptions) ([]uint, error)

func (*Datastore) ListHosts

func (d *Datastore) ListHosts(opt kolide.HostListOptions) ([]*kolide.Host, error)

func (*Datastore) ListHostsInLabel

func (d *Datastore) ListHostsInLabel(lid uint, opt kolide.ListOptions) ([]kolide.Host, error)

func (*Datastore) ListHostsInPack

func (d *Datastore) ListHostsInPack(pid uint, opt kolide.ListOptions) ([]uint, error)

func (*Datastore) ListInvites

func (d *Datastore) ListInvites(opt kolide.ListOptions) ([]*kolide.Invite, error)

Invites lists all invites in the datastore.

func (*Datastore) ListLabels

func (d *Datastore) ListLabels(opt kolide.ListOptions) ([]*kolide.Label, error)

func (*Datastore) ListLabelsForHost

func (d *Datastore) ListLabelsForHost(hid uint) ([]kolide.Label, error)

func (*Datastore) ListLabelsForPack

func (d *Datastore) ListLabelsForPack(pid uint) ([]*kolide.Label, error)

func (*Datastore) ListPacks

func (d *Datastore) ListPacks(opt kolide.ListOptions) ([]*kolide.Pack, error)

func (*Datastore) ListQueries

func (d *Datastore) ListQueries(opt kolide.ListOptions) ([]*kolide.Query, error)

func (*Datastore) ListSessionsForUser

func (d *Datastore) ListSessionsForUser(id uint) ([]*kolide.Session, error)

func (*Datastore) ListUniqueHostsInLabels

func (d *Datastore) ListUniqueHostsInLabels(labels []uint) ([]kolide.Host, error)

func (*Datastore) ListUsers

func (d *Datastore) ListUsers(opt kolide.ListOptions) ([]*kolide.User, error)

func (*Datastore) MarkHostSeen

func (d *Datastore) MarkHostSeen(host *kolide.Host, t time.Time) error

func (*Datastore) MarkSessionAccessed

func (d *Datastore) MarkSessionAccessed(session *kolide.Session) error

func (*Datastore) MigrateData

func (d *Datastore) MigrateData() error

func (*Datastore) MigrateTables

func (d *Datastore) MigrateTables() error

func (*Datastore) MigrationStatus

func (m *Datastore) MigrationStatus() (kolide.MigrationStatus, error)

func (*Datastore) Name

func (d *Datastore) Name() string

func (*Datastore) NewAppConfig

func (d *Datastore) NewAppConfig(info *kolide.AppConfig) (*kolide.AppConfig, error)

func (*Datastore) NewDistributedQueryCampaign

func (d *Datastore) NewDistributedQueryCampaign(camp *kolide.DistributedQueryCampaign) (*kolide.DistributedQueryCampaign, error)

func (*Datastore) NewDistributedQueryCampaignTarget

func (d *Datastore) NewDistributedQueryCampaignTarget(target *kolide.DistributedQueryCampaignTarget) (*kolide.DistributedQueryCampaignTarget, error)

func (*Datastore) NewHost

func (d *Datastore) NewHost(host *kolide.Host) (*kolide.Host, error)

func (*Datastore) NewInvite

func (d *Datastore) NewInvite(invite *kolide.Invite) (*kolide.Invite, error)

NewInvite creates and stores a new invitation in a DB.

func (*Datastore) NewLabel

func (d *Datastore) NewLabel(label *kolide.Label, opts ...kolide.OptionalArg) (*kolide.Label, error)

func (*Datastore) NewPack

func (d *Datastore) NewPack(pack *kolide.Pack, opts ...kolide.OptionalArg) (*kolide.Pack, error)

func (*Datastore) NewPasswordResetRequest

func (d *Datastore) NewPasswordResetRequest(req *kolide.PasswordResetRequest) (*kolide.PasswordResetRequest, error)

func (*Datastore) NewQuery

func (d *Datastore) NewQuery(query *kolide.Query, opts ...kolide.OptionalArg) (*kolide.Query, error)

func (*Datastore) NewSession

func (d *Datastore) NewSession(session *kolide.Session) (*kolide.Session, error)

func (*Datastore) NewUser

func (d *Datastore) NewUser(user *kolide.User) (*kolide.User, error)

func (*Datastore) Pack

func (d *Datastore) Pack(id uint) (*kolide.Pack, error)

func (*Datastore) PackByName

func (d *Datastore) PackByName(name string, opts ...kolide.OptionalArg) (*kolide.Pack, bool, error)

func (*Datastore) PendingEmailChange

func (ds *Datastore) PendingEmailChange(uid uint, newEmail, token string) error

func (*Datastore) Query

func (d *Datastore) Query(id uint) (*kolide.Query, error)

func (*Datastore) RecordLabelQueryExecutions

func (d *Datastore) RecordLabelQueryExecutions(host *kolide.Host, results map[uint]bool, t time.Time) error

func (*Datastore) RemoveHostFromPack

func (d *Datastore) RemoveHostFromPack(hid, pid uint) error

func (*Datastore) RemoveLabelFromPack

func (d *Datastore) RemoveLabelFromPack(lid, pid uint) error

func (*Datastore) SaveAppConfig

func (d *Datastore) SaveAppConfig(info *kolide.AppConfig) error

func (*Datastore) SaveDistributedQueryCampaign

func (d *Datastore) SaveDistributedQueryCampaign(camp *kolide.DistributedQueryCampaign) error

func (*Datastore) SaveHost

func (d *Datastore) SaveHost(host *kolide.Host) error

func (*Datastore) SaveInvite

func (d *Datastore) SaveInvite(invite *kolide.Invite) error

SaveInvite saves an invitation in the datastore.

func (*Datastore) SaveLabel

func (d *Datastore) SaveLabel(label *kolide.Label) (*kolide.Label, error)

func (*Datastore) SavePack

func (d *Datastore) SavePack(pack *kolide.Pack) error

func (*Datastore) SavePasswordResetRequest

func (d *Datastore) SavePasswordResetRequest(req *kolide.PasswordResetRequest) error

func (*Datastore) SaveQuery

func (d *Datastore) SaveQuery(query *kolide.Query) error

func (*Datastore) SaveUser

func (d *Datastore) SaveUser(user *kolide.User) error

func (*Datastore) SearchHosts

func (d *Datastore) SearchHosts(query string, omit ...uint) ([]*kolide.Host, error)

func (*Datastore) SearchLabels

func (d *Datastore) SearchLabels(query string, omit ...uint) ([]kolide.Label, error)

func (*Datastore) SessionByID

func (d *Datastore) SessionByID(id uint) (*kolide.Session, error)

func (*Datastore) SessionByKey

func (d *Datastore) SessionByKey(key string) (*kolide.Session, error)

func (*Datastore) User

func (d *Datastore) User(username string) (*kolide.User, error)

func (*Datastore) UserByEmail

func (d *Datastore) UserByEmail(email string) (*kolide.User, error)

func (*Datastore) UserByID

func (d *Datastore) UserByID(id uint) (*kolide.User, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL