Documentation
¶
Index ¶
- func NewStores(ctx context.Context, dsn string, maxOpen, maxIdle int) (*store.Stores, error)
- func NewStoresFromDB(db *DB) (*store.Stores, error)
- type ApprovalStore
- func (s *ApprovalStore) CountByDecisionAndStage(ctx context.Context, requestID uuid.UUID, decision model.Decision, ...) (int, error)
- func (s *ApprovalStore) Create(ctx context.Context, approval *model.Approval) error
- func (s *ApprovalStore) ExistsByCheckerAndStage(ctx context.Context, requestID uuid.UUID, checkerID string, stageIndex int) (bool, error)
- func (s *ApprovalStore) ListByRequestID(ctx context.Context, requestID uuid.UUID) ([]model.Approval, error)
- type AuditStore
- type DB
- type DBTX
- type OperatorStore
- func (s *OperatorStore) Count(ctx context.Context) (int, error)
- func (s *OperatorStore) Create(ctx context.Context, operator *model.Operator) error
- func (s *OperatorStore) Delete(ctx context.Context, id uuid.UUID) error
- func (s *OperatorStore) GetByID(ctx context.Context, id uuid.UUID) (*model.Operator, error)
- func (s *OperatorStore) GetByUsername(ctx context.Context, username string) (*model.Operator, error)
- func (s *OperatorStore) List(ctx context.Context, filter store.OperatorFilter) ([]model.Operator, int, error)
- func (s *OperatorStore) Update(ctx context.Context, operator *model.Operator) error
- type OutboxStore
- func (s *OutboxStore) ClaimBatch(ctx context.Context, limit int) ([]model.OutboxEntry, error)
- func (s *OutboxStore) CountByStatus(ctx context.Context, tenantID *string, since *time.Time) (map[string]int, error)
- func (s *OutboxStore) CreateBatch(ctx context.Context, entries []model.OutboxEntry) error
- func (s *OutboxStore) DeleteDelivered(ctx context.Context, olderThan time.Time) (int64, error)
- func (s *OutboxStore) GetByID(ctx context.Context, id uuid.UUID) (*model.OutboxEntry, error)
- func (s *OutboxStore) List(ctx context.Context, filter store.OutboxFilter) ([]model.OutboxEntry, int, error)
- func (s *OutboxStore) MarkDelivered(ctx context.Context, id uuid.UUID) error
- func (s *OutboxStore) MarkFailed(ctx context.Context, id uuid.UUID, attempts int, lastError string) error
- func (s *OutboxStore) MarkRetry(ctx context.Context, id uuid.UUID, attempts int, lastError string, ...) error
- func (s *OutboxStore) ResetAllFailed(ctx context.Context, tenantID *string) (int64, error)
- func (s *OutboxStore) ResetAllFailedForRequest(ctx context.Context, requestID uuid.UUID) (int64, error)
- func (s *OutboxStore) ResetForRetry(ctx context.Context, id uuid.UUID) error
- type PolicyStore
- func (s *PolicyStore) Create(ctx context.Context, policy *model.Policy) error
- func (s *PolicyStore) Delete(ctx context.Context, id uuid.UUID) error
- func (s *PolicyStore) DistinctRequestTypes(ctx context.Context) ([]string, error)
- func (s *PolicyStore) GetByID(ctx context.Context, id uuid.UUID) (*model.Policy, error)
- func (s *PolicyStore) GetByRequestType(ctx context.Context, requestType string) (*model.Policy, error)
- func (s *PolicyStore) List(ctx context.Context, filter store.PolicyFilter) ([]model.Policy, int, error)
- func (s *PolicyStore) Update(ctx context.Context, policy *model.Policy) error
- type RequestStore
- func (s *RequestStore) Create(ctx context.Context, req *model.Request) error
- func (s *RequestStore) FindPendingByFingerprint(ctx context.Context, reqType string, fingerprint string) (*model.Request, error)
- func (s *RequestStore) GetByID(ctx context.Context, id uuid.UUID) (*model.Request, error)
- func (s *RequestStore) GetByIDForUpdate(ctx context.Context, id uuid.UUID) (*model.Request, error)
- func (s *RequestStore) GetByIdempotencyKey(ctx context.Context, key string) (*model.Request, error)
- func (s *RequestStore) List(ctx context.Context, filter store.RequestFilter) ([]model.Request, int, error)
- func (s *RequestStore) ListExpired(ctx context.Context) ([]model.Request, error)
- func (s *RequestStore) UpdateStageAndStatus(ctx context.Context, id uuid.UUID, stage int, status model.RequestStatus) error
- func (s *RequestStore) UpdateStatus(ctx context.Context, id uuid.UUID, status model.RequestStatus) error
- type TenantStore
- func (s *TenantStore) Create(ctx context.Context, tenant *model.Tenant) error
- func (s *TenantStore) Delete(ctx context.Context, id uuid.UUID) error
- func (s *TenantStore) GetByID(ctx context.Context, id uuid.UUID) (*model.Tenant, error)
- func (s *TenantStore) GetBySlug(ctx context.Context, slug string) (*model.Tenant, error)
- func (s *TenantStore) List(ctx context.Context, filter store.TenantFilter) ([]model.Tenant, int, error)
- type WebhookStore
- func (s *WebhookStore) Create(ctx context.Context, webhook *model.Webhook) error
- func (s *WebhookStore) Delete(ctx context.Context, id uuid.UUID) error
- func (s *WebhookStore) GetByID(ctx context.Context, id uuid.UUID) (*model.Webhook, error)
- func (s *WebhookStore) List(ctx context.Context, filter store.WebhookFilter) ([]model.Webhook, int, error)
- func (s *WebhookStore) ListByEventAndType(ctx context.Context, event string, requestType string) ([]model.Webhook, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApprovalStore ¶
type ApprovalStore struct {
// contains filtered or unexported fields
}
func NewApprovalStore ¶
func NewApprovalStore(db *DB) *ApprovalStore
func (*ApprovalStore) CountByDecisionAndStage ¶
func (*ApprovalStore) ExistsByCheckerAndStage ¶
func (*ApprovalStore) ListByRequestID ¶
type AuditStore ¶
type AuditStore struct {
// contains filtered or unexported fields
}
func NewAuditStore ¶
func NewAuditStore(db *DB) *AuditStore
func (*AuditStore) ListByRequestID ¶
type DB ¶
type DB struct {
Pool DBTX // public: used by stores — can be pool or tx
// contains filtered or unexported fields
}
type DBTX ¶
type DBTX interface {
Exec(ctx context.Context, sql string, arguments ...any) (pgconn.CommandTag, error)
Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
QueryRow(ctx context.Context, sql string, args ...any) pgx.Row
}
DBTX is the common query interface shared by *pgxpool.Pool and pgx.Tx. All postgres stores use this interface for their queries, allowing them to operate on either a connection pool or a transaction.
type OperatorStore ¶
type OperatorStore struct {
// contains filtered or unexported fields
}
func NewOperatorStore ¶
func NewOperatorStore(db *DB) *OperatorStore
func (*OperatorStore) GetByUsername ¶
type OutboxStore ¶
type OutboxStore struct {
// contains filtered or unexported fields
}
func NewOutboxStore ¶
func NewOutboxStore(db *DB) *OutboxStore
func (*OutboxStore) ClaimBatch ¶
func (s *OutboxStore) ClaimBatch(ctx context.Context, limit int) ([]model.OutboxEntry, error)
func (*OutboxStore) CountByStatus ¶
func (*OutboxStore) CreateBatch ¶
func (s *OutboxStore) CreateBatch(ctx context.Context, entries []model.OutboxEntry) error
func (*OutboxStore) DeleteDelivered ¶
func (*OutboxStore) GetByID ¶
func (s *OutboxStore) GetByID(ctx context.Context, id uuid.UUID) (*model.OutboxEntry, error)
func (*OutboxStore) List ¶
func (s *OutboxStore) List(ctx context.Context, filter store.OutboxFilter) ([]model.OutboxEntry, int, error)
func (*OutboxStore) MarkDelivered ¶
func (*OutboxStore) MarkFailed ¶
func (*OutboxStore) ResetAllFailed ¶ added in v0.1.2
func (*OutboxStore) ResetAllFailedForRequest ¶
func (*OutboxStore) ResetForRetry ¶
type PolicyStore ¶
type PolicyStore struct {
// contains filtered or unexported fields
}
func NewPolicyStore ¶
func NewPolicyStore(db *DB) *PolicyStore
func (*PolicyStore) DistinctRequestTypes ¶ added in v0.1.2
func (s *PolicyStore) DistinctRequestTypes(ctx context.Context) ([]string, error)
func (*PolicyStore) GetByRequestType ¶
type RequestStore ¶
type RequestStore struct {
// contains filtered or unexported fields
}
func NewRequestStore ¶
func NewRequestStore(db *DB) *RequestStore
func (*RequestStore) FindPendingByFingerprint ¶
func (*RequestStore) GetByIDForUpdate ¶
func (*RequestStore) GetByIdempotencyKey ¶
func (*RequestStore) List ¶
func (s *RequestStore) List(ctx context.Context, filter store.RequestFilter) ([]model.Request, int, error)
func (*RequestStore) ListExpired ¶
func (*RequestStore) UpdateStageAndStatus ¶
func (s *RequestStore) UpdateStageAndStatus(ctx context.Context, id uuid.UUID, stage int, status model.RequestStatus) error
func (*RequestStore) UpdateStatus ¶
func (s *RequestStore) UpdateStatus(ctx context.Context, id uuid.UUID, status model.RequestStatus) error
type TenantStore ¶
type TenantStore struct {
// contains filtered or unexported fields
}
func NewTenantStore ¶
func NewTenantStore(db *DB) *TenantStore
type WebhookStore ¶
type WebhookStore struct {
// contains filtered or unexported fields
}
func NewWebhookStore ¶
func NewWebhookStore(db *DB) *WebhookStore
func (*WebhookStore) List ¶
func (s *WebhookStore) List(ctx context.Context, filter store.WebhookFilter) ([]model.Webhook, int, error)
func (*WebhookStore) ListByEventAndType ¶
Click to show internal directories.
Click to hide internal directories.