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, agentUpdate apiAgent.AgentStatusUpdate) (*api.Agent, error)
- func (a *AgentStore) Delete(ctx context.Context, id string, softDeletion bool) error
- func (a *AgentStore) Get(ctx context.Context, id string) (*api.Agent, error)
- func (a *AgentStore) InitialMigration(ctx context.Context) error
- func (a *AgentStore) List(ctx context.Context, filter *AgentQueryFilter, opts *AgentQueryOptions) (api.AgentList, error)
- func (a *AgentStore) Update(ctx context.Context, agentUpdate apiAgent.AgentStatusUpdate) (*api.Agent, error)
- func (a *AgentStore) UpdateSourceID(ctx context.Context, agentID string, sourceID string, associated bool) (*api.Agent, error)
- type BaseAgentQuerier
- type DataStore
- type SortOrder
- type Source
- type SourceStore
- func (s *SourceStore) Create(ctx context.Context, id uuid.UUID) (*api.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) (*api.Source, error)
- func (s *SourceStore) InitialMigration(ctx context.Context) error
- func (s *SourceStore) List(ctx context.Context) (api.SourceList, error)
- func (s *SourceStore) Update(ctx context.Context, id uuid.UUID, inventory *api.Inventory) (*api.Source, error)
- type Store
- type Tx
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrRecordNotFound error = errors.New("record not found")
)
Functions ¶
Types ¶
type Agent ¶
type Agent interface { List(ctx context.Context, filter *AgentQueryFilter, opts *AgentQueryOptions) (api.AgentList, error) Get(ctx context.Context, id string) (*api.Agent, error) Update(ctx context.Context, agentUpdate apiAgent.AgentStatusUpdate) (*api.Agent, error) UpdateSourceID(ctx context.Context, agentID string, sourceID string, associated bool) (*api.Agent, error) Create(ctx context.Context, agentUpdate apiAgent.AgentStatusUpdate) (*api.Agent, error) Delete(ctx context.Context, id string, softDeletion bool) error InitialMigration(context.Context) error }
func NewAgentSource ¶
type AgentQueryFilter ¶
type AgentQueryFilter = BaseAgentQuerier
func NewAgentQueryFilter ¶
func NewAgentQueryFilter() *AgentQueryFilter
func (*AgentQueryFilter) ByID ¶
func (qf *AgentQueryFilter) ByID(ids []string) *AgentQueryFilter
func (*AgentQueryFilter) BySoftDeleted ¶
func (qf *AgentQueryFilter) BySoftDeleted(isSoftDeleted bool) *AgentQueryFilter
func (*AgentQueryFilter) BySourceID ¶
func (qf *AgentQueryFilter) BySourceID(sourceID string) *AgentQueryFilter
type AgentQueryOptions ¶
type AgentQueryOptions = BaseAgentQuerier
func NewAgentQueryOptions ¶
func NewAgentQueryOptions() *AgentQueryOptions
func (*AgentQueryOptions) WithIncludeSoftDeleted ¶
func (o *AgentQueryOptions) WithIncludeSoftDeleted(includeSoftDeleted bool) *AgentQueryOptions
func (*AgentQueryOptions) WithSortOrder ¶
func (o *AgentQueryOptions) WithSortOrder(sort SortOrder) *AgentQueryOptions
type AgentStore ¶
type AgentStore struct {
// contains filtered or unexported fields
}
func (*AgentStore) Create ¶
func (a *AgentStore) Create(ctx context.Context, agentUpdate apiAgent.AgentStatusUpdate) (*api.Agent, error)
Create creates an agent from api model.
func (*AgentStore) Delete ¶
Delete removes an agent. If softDeletion is true, the agent is soft-deleted.
func (*AgentStore) InitialMigration ¶
func (a *AgentStore) InitialMigration(ctx context.Context) error
func (*AgentStore) List ¶
func (a *AgentStore) List(ctx context.Context, filter *AgentQueryFilter, opts *AgentQueryOptions) (api.AgentList, error)
List lists all the agents.
If includeSoftDeleted is true, it lists the agents soft-deleted.
func (*AgentStore) Update ¶
func (a *AgentStore) Update(ctx context.Context, agentUpdate apiAgent.AgentStatusUpdate) (*api.Agent, error)
Update updates an agent from api model.
type DataStore ¶
type DataStore struct {
// contains filtered or unexported fields
}
func (*DataStore) InitialMigration ¶
func (*DataStore) NewTransactionContext ¶
type Source ¶
type Source interface { List(ctx context.Context) (api.SourceList, error) Create(ctx context.Context, id uuid.UUID) (*api.Source, error) DeleteAll(ctx context.Context) error Get(ctx context.Context, id uuid.UUID) (*api.Source, error) Delete(ctx context.Context, id uuid.UUID) error Update(ctx context.Context, id uuid.UUID, inventory *api.Inventory) (*api.Source, error) InitialMigration(context.Context) error }
type SourceStore ¶
type SourceStore struct {
// contains filtered or unexported fields
}
func (*SourceStore) InitialMigration ¶
func (s *SourceStore) InitialMigration(ctx context.Context) error
func (*SourceStore) List ¶
func (s *SourceStore) List(ctx context.Context) (api.SourceList, error)
Click to show internal directories.
Click to hide internal directories.