Documentation
¶
Index ¶
- Variables
- func Commit(ctx context.Context) (context.Context, error)
- func FromContext(ctx context.Context) *gorm.DB
- func InitDB(cfg *config.Config) (*gorm.DB, error)
- func Rollback(ctx context.Context) (context.Context, error)
- type Agent
- type AgentQueryFilter
- type AgentQueryOptions
- type AgentStore
- func (a *AgentStore) Create(ctx context.Context, agent model.Agent) (*model.Agent, error)
- func (a *AgentStore) Get(ctx context.Context, id uuid.UUID) (*model.Agent, error)
- func (a *AgentStore) List(ctx context.Context, filter *AgentQueryFilter, opts *AgentQueryOptions) (model.AgentList, error)
- func (a *AgentStore) Update(ctx context.Context, agent model.Agent) (*model.Agent, error)
- type Assessment
- type AssessmentQueryFilter
- func (f *AssessmentQueryFilter) WithNameLike(pattern string) *AssessmentQueryFilter
- func (f *AssessmentQueryFilter) WithOrgID(orgID string) *AssessmentQueryFilter
- func (f *AssessmentQueryFilter) WithSourceID(sourceID string) *AssessmentQueryFilter
- func (f *AssessmentQueryFilter) WithSourceType(sourceType string) *AssessmentQueryFilter
- func (f *AssessmentQueryFilter) WithUsername(username string) *AssessmentQueryFilter
- type AssessmentQueryOptions
- type AssessmentStore
- func (a *AssessmentStore) Create(ctx context.Context, assessment model.Assessment, inventory []byte) (*model.Assessment, error)
- func (a *AssessmentStore) Delete(ctx context.Context, id uuid.UUID) error
- func (a *AssessmentStore) Get(ctx context.Context, id uuid.UUID) (*model.Assessment, error)
- func (a *AssessmentStore) List(ctx context.Context, filter *AssessmentQueryFilter) (model.AssessmentList, error)
- func (a *AssessmentStore) Update(ctx context.Context, assessmentID uuid.UUID, name *string, inventory []byte) (*model.Assessment, error)
- type BaseQuerier
- type CacheKeyStore
- func (p *CacheKeyStore) Create(ctx context.Context, privateKey model.Key) (*model.Key, error)
- func (p *CacheKeyStore) Delete(ctx context.Context, orgID string) error
- func (p *CacheKeyStore) Get(ctx context.Context, orgID string) (*model.Key, error)
- func (p *CacheKeyStore) GetPublicKey(ctx context.Context, id string) (crypto.PublicKey, error)
- type DataStore
- func (s *DataStore) Agent() Agent
- func (s *DataStore) Assessment() Assessment
- func (s *DataStore) Close() error
- func (s *DataStore) ImageInfra() ImageInfra
- func (s *DataStore) Job() Job
- func (s *DataStore) Label() Label
- func (s *DataStore) NewTransactionContext(ctx context.Context) (context.Context, error)
- func (s *DataStore) PrivateKey() PrivateKey
- func (s *DataStore) Source() Source
- func (s *DataStore) Statistics(ctx context.Context) (model.InventoryStats, error)
- type ImageInfra
- type ImageInfraStore
- type Job
- type JobRow
- type JobStore
- type Label
- type PrivateKey
- type PrivateKeyStore
- func (p *PrivateKeyStore) Create(ctx context.Context, privateKey model.Key) (*model.Key, error)
- func (p *PrivateKeyStore) Delete(ctx context.Context, orgID string) error
- func (p *PrivateKeyStore) Get(ctx context.Context, orgID string) (*model.Key, error)
- func (p *PrivateKeyStore) GetPublicKey(ctx context.Context, kid string) (crypto.PublicKey, error)
- type SortOrder
- type Source
- type SourceQueryFilter
- type SourceStore
- func (s *SourceStore) Create(ctx context.Context, source model.Source) (*model.Source, error)
- func (s *SourceStore) Delete(ctx context.Context, id uuid.UUID) error
- func (s *SourceStore) DeleteAll(ctx context.Context) error
- func (s *SourceStore) Get(ctx context.Context, id uuid.UUID) (*model.Source, error)
- func (s *SourceStore) List(ctx context.Context, filter *SourceQueryFilter) (model.SourceList, error)
- func (s *SourceStore) Update(ctx context.Context, source model.Source) (*model.Source, error)
- type Store
- type Tx
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRecordNotFound = errors.New("record not found") ErrDuplicateKey = errors.New("already exists") )
Functions ¶
Types ¶
type Agent ¶
type Agent interface {
List(ctx context.Context, filter *AgentQueryFilter, opts *AgentQueryOptions) (model.AgentList, error)
Get(ctx context.Context, id uuid.UUID) (*model.Agent, error)
Update(ctx context.Context, agent model.Agent) (*model.Agent, error)
Create(ctx context.Context, agent model.Agent) (*model.Agent, error)
}
func NewAgentSource ¶
type AgentQueryFilter ¶
type AgentQueryFilter BaseQuerier
func NewAgentQueryFilter ¶
func NewAgentQueryFilter() *AgentQueryFilter
func (*AgentQueryFilter) ByID ¶
func (qf *AgentQueryFilter) ByID(ids []string) *AgentQueryFilter
func (*AgentQueryFilter) BySourceID ¶
func (qf *AgentQueryFilter) BySourceID(sourceID string) *AgentQueryFilter
type AgentQueryOptions ¶
type AgentQueryOptions BaseQuerier
func NewAgentQueryOptions ¶
func NewAgentQueryOptions() *AgentQueryOptions
func (*AgentQueryOptions) WithSortOrder ¶
func (o *AgentQueryOptions) WithSortOrder(sort SortOrder) *AgentQueryOptions
type AgentStore ¶
type AgentStore struct {
// contains filtered or unexported fields
}
func (*AgentStore) List ¶
func (a *AgentStore) List(ctx context.Context, filter *AgentQueryFilter, opts *AgentQueryOptions) (model.AgentList, error)
List lists all the agents.
type Assessment ¶
type Assessment interface {
List(ctx context.Context, filter *AssessmentQueryFilter) (model.AssessmentList, error)
Get(ctx context.Context, id uuid.UUID) (*model.Assessment, error)
Create(ctx context.Context, assessment model.Assessment, inventory []byte) (*model.Assessment, error)
Update(ctx context.Context, assessmentID uuid.UUID, name *string, inventory []byte) (*model.Assessment, error)
Delete(ctx context.Context, id uuid.UUID) error
}
func NewAssessmentStore ¶
func NewAssessmentStore(db *gorm.DB) Assessment
type AssessmentQueryFilter ¶
func NewAssessmentQueryFilter ¶
func NewAssessmentQueryFilter() *AssessmentQueryFilter
func (*AssessmentQueryFilter) WithNameLike ¶
func (f *AssessmentQueryFilter) WithNameLike(pattern string) *AssessmentQueryFilter
Filter by name pattern
func (*AssessmentQueryFilter) WithOrgID ¶
func (f *AssessmentQueryFilter) WithOrgID(orgID string) *AssessmentQueryFilter
Filter by organization ID
func (*AssessmentQueryFilter) WithSourceID ¶
func (f *AssessmentQueryFilter) WithSourceID(sourceID string) *AssessmentQueryFilter
Filter by source ID
func (*AssessmentQueryFilter) WithSourceType ¶
func (f *AssessmentQueryFilter) WithSourceType(sourceType string) *AssessmentQueryFilter
Filter by source
func (*AssessmentQueryFilter) WithUsername ¶ added in v0.3.0
func (f *AssessmentQueryFilter) WithUsername(username string) *AssessmentQueryFilter
Filter by username
type AssessmentQueryOptions ¶
func NewAssessmentQueryOptions ¶
func NewAssessmentQueryOptions() *AssessmentQueryOptions
func (*AssessmentQueryOptions) WithLimit ¶
func (o *AssessmentQueryOptions) WithLimit(limit int) *AssessmentQueryOptions
Limit results
func (*AssessmentQueryOptions) WithOffset ¶
func (o *AssessmentQueryOptions) WithOffset(offset int) *AssessmentQueryOptions
Offset results
func (*AssessmentQueryOptions) WithOrder ¶
func (o *AssessmentQueryOptions) WithOrder(order string) *AssessmentQueryOptions
Order by specific field
type AssessmentStore ¶
type AssessmentStore struct {
// contains filtered or unexported fields
}
func (*AssessmentStore) Create ¶
func (a *AssessmentStore) Create(ctx context.Context, assessment model.Assessment, inventory []byte) (*model.Assessment, error)
func (*AssessmentStore) Get ¶
func (a *AssessmentStore) Get(ctx context.Context, id uuid.UUID) (*model.Assessment, error)
func (*AssessmentStore) List ¶
func (a *AssessmentStore) List(ctx context.Context, filter *AssessmentQueryFilter) (model.AssessmentList, error)
type CacheKeyStore ¶
type CacheKeyStore struct {
// contains filtered or unexported fields
}
CacheKeyStore is wrapper around PrivateKeyStore which provide basic caching of the public keys.
func (*CacheKeyStore) Delete ¶
func (p *CacheKeyStore) Delete(ctx context.Context, orgID string) error
func (*CacheKeyStore) GetPublicKey ¶ added in v0.2.2
type DataStore ¶
type DataStore struct {
// contains filtered or unexported fields
}
func (*DataStore) Assessment ¶
func (s *DataStore) Assessment() Assessment
func (*DataStore) ImageInfra ¶
func (s *DataStore) ImageInfra() ImageInfra
func (*DataStore) NewTransactionContext ¶
func (*DataStore) PrivateKey ¶
func (s *DataStore) PrivateKey() PrivateKey
func (*DataStore) Statistics ¶
type ImageInfra ¶
type ImageInfra interface {
Create(ctx context.Context, imageInfra model.ImageInfra) (*model.ImageInfra, error)
Update(ctx context.Context, imageInfra model.ImageInfra) (*model.ImageInfra, error)
}
func NewImageInfraStore ¶
func NewImageInfraStore(db *gorm.DB) ImageInfra
type ImageInfraStore ¶
type ImageInfraStore struct {
// contains filtered or unexported fields
}
func (*ImageInfraStore) Create ¶
func (i *ImageInfraStore) Create(ctx context.Context, image model.ImageInfra) (*model.ImageInfra, error)
func (*ImageInfraStore) Update ¶
func (i *ImageInfraStore) Update(ctx context.Context, image model.ImageInfra) (*model.ImageInfra, error)
type Job ¶ added in v0.3.0
type Job interface {
Get(ctx context.Context, id int64) (*JobRow, error)
UpdateMetadata(ctx context.Context, id int64, metadataJSON []byte) error
}
Job interface for job-related database operations
func NewJobStore ¶ added in v0.3.0
NewJobStore creates a new job store
type JobRow ¶ added in v0.3.0
type JobRow struct {
ID int64 `gorm:"column:id;primaryKey"`
State rivertype.JobState `gorm:"column:state"`
ArgsJSON []byte `gorm:"column:args"`
MetadataJSON []byte `gorm:"column:metadata"`
}
JobRow represents a row from the river_job table
type JobStore ¶ added in v0.3.0
type JobStore struct {
// contains filtered or unexported fields
}
JobStore implements the Job interface
type Label ¶
type Label interface {
DeleteBySourceID(ctx context.Context, sourceID string) error
UpdateLabels(ctx context.Context, sourceID uuid.UUID, labels []model.Label) error
}
func NewLabelStore ¶
type PrivateKey ¶
type PrivateKey interface {
Create(ctx context.Context, privateKey model.Key) (*model.Key, error)
Get(ctx context.Context, orgID string) (*model.Key, error)
Delete(ctx context.Context, orgID string) error
GetPublicKey(ctx context.Context, id string) (crypto.PublicKey, error)
}
func NewCacheKeyStore ¶
func NewCacheKeyStore(delegate PrivateKey) PrivateKey
func NewPrivateKey ¶
func NewPrivateKey(db *gorm.DB) PrivateKey
type PrivateKeyStore ¶
type PrivateKeyStore struct {
// contains filtered or unexported fields
}
func (*PrivateKeyStore) Delete ¶
func (p *PrivateKeyStore) Delete(ctx context.Context, orgID string) error
func (*PrivateKeyStore) GetPublicKey ¶ added in v0.2.2
type Source ¶
type Source interface {
List(ctx context.Context, filter *SourceQueryFilter) (model.SourceList, error)
Create(ctx context.Context, source model.Source) (*model.Source, error)
DeleteAll(ctx context.Context) error
Get(ctx context.Context, id uuid.UUID) (*model.Source, error)
Delete(ctx context.Context, id uuid.UUID) error
Update(ctx context.Context, source model.Source) (*model.Source, error)
}
type SourceQueryFilter ¶
type SourceQueryFilter BaseQuerier
func NewSourceQueryFilter ¶
func NewSourceQueryFilter() *SourceQueryFilter
func (*SourceQueryFilter) ByOnPremises ¶
func (qf *SourceQueryFilter) ByOnPremises(isOnPremises bool) *SourceQueryFilter
func (*SourceQueryFilter) ByOrgID ¶
func (sf *SourceQueryFilter) ByOrgID(id string) *SourceQueryFilter
func (*SourceQueryFilter) ByUsername ¶
func (sf *SourceQueryFilter) ByUsername(username string) *SourceQueryFilter
type SourceStore ¶
type SourceStore struct {
// contains filtered or unexported fields
}
func (*SourceStore) List ¶
func (s *SourceStore) List(ctx context.Context, filter *SourceQueryFilter) (model.SourceList, error)
type Store ¶
type Store interface {
NewTransactionContext(ctx context.Context) (context.Context, error)
Agent() Agent
Source() Source
ImageInfra() ImageInfra
PrivateKey() PrivateKey
Label() Label
Assessment() Assessment
Job() Job
Statistics(ctx context.Context) (model.InventoryStats, error)
Close() error
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.