Versions in this module Expand all Collapse all v1 v1.0.2 Jul 4, 2025 Changes in this version + var ErrTokenExpired = errors.New("token is expired") + var ErrTokenNotFound = errors.New("token not found") + func NewConnection(config *gormpg.Conf) (*gorm.DB, error) + func Seed(db *gorm.DB) error + type AuthzFilterApplier func(scope *auth.IdentityScope, db *gorm.DB) *gorm.DB + type FilterFieldApplier func(db *gorm.DB, vv []string) (*gorm.DB, error) + func ParserInFilterFieldApplier[T any](f string, t func(string) (T, error)) FilterFieldApplier + func StringInFilterFieldApplier(f string) FilterFieldApplier + type GormAgentRepository struct + func NewAgentRepository(db *gorm.DB) *GormAgentRepository + func (r *GormAgentRepository) AuthScope(ctx context.Context, id properties.UUID) (auth.ObjectScope, error) + func (r *GormAgentRepository) CountByProvider(ctx context.Context, providerID properties.UUID) (int64, error) + func (r *GormAgentRepository) FindByServiceTypeAndTags(ctx context.Context, serviceTypeID properties.UUID, tags []string) ([]*domain.Agent, error) + func (r *GormAgentRepository) MarkInactiveAgentsAsDisconnected(ctx context.Context, inactiveDuration time.Duration) (int64, error) + type GormAgentTypeRepository struct + func NewAgentTypeRepository(db *gorm.DB) *GormAgentTypeRepository + func (r *GormAgentTypeRepository) AuthScope(ctx context.Context, id properties.UUID) (auth.ObjectScope, error) + func (r *GormAgentTypeRepository) Count(ctx context.Context) (int64, error) + type GormEventRepository struct + func NewEventRepository(db *gorm.DB) *GormEventRepository + func (r *GormEventRepository) AuthScope(ctx context.Context, id properties.UUID) (auth.ObjectScope, error) + func (r *GormEventRepository) ListFromSequence(ctx context.Context, fromSequenceNumber int64, limit int) ([]*domain.Event, error) + func (r *GormEventRepository) ServiceUptime(ctx context.Context, serviceID properties.UUID, start time.Time, end time.Time) (uptimeSeconds uint64, downtimeSeconds uint64, err error) + type GormEventSubscriptionRepository struct + func NewEventSubscriptionRepository(db *gorm.DB) *GormEventSubscriptionRepository + func (r *GormEventSubscriptionRepository) AuthScope(ctx context.Context, id properties.UUID) (auth.ObjectScope, error) + func (r *GormEventSubscriptionRepository) DeleteBySubscriberID(ctx context.Context, subscriberID string) error + func (r *GormEventSubscriptionRepository) ExistsBySubscriberID(ctx context.Context, subscriberID string) (bool, error) + func (r *GormEventSubscriptionRepository) FindBySubscriberID(ctx context.Context, subscriberID string) (*domain.EventSubscription, error) + func (r *GormEventSubscriptionRepository) ListExpiredLeases(ctx context.Context) ([]*domain.EventSubscription, error) + type GormJobRepository struct + func NewJobRepository(db *gorm.DB) *GormJobRepository + func (r *GormJobRepository) AuthScope(ctx context.Context, id properties.UUID) (auth.ObjectScope, error) + func (r *GormJobRepository) DeleteOldCompletedJobs(ctx context.Context, olderThan time.Duration) (int, error) + func (r *GormJobRepository) GetPendingJobsForAgent(ctx context.Context, agentID properties.UUID, limit int) ([]*domain.Job, error) + func (r *GormJobRepository) GetTimeOutJobs(ctx context.Context, olderThan time.Duration) ([]*domain.Job, error) + type GormMetricEntryRepository struct + func NewMetricEntryRepository(db *gorm.DB) *GormMetricEntryRepository + func (r *GormMetricEntryRepository) Aggregate(ctx context.Context, aggregateType domain.AggregateType, ...) (float64, error) + func (r *GormMetricEntryRepository) AuthScope(ctx context.Context, id properties.UUID) (auth.ObjectScope, error) + func (r *GormMetricEntryRepository) CountByMetricType(ctx context.Context, typeID properties.UUID) (int64, error) + type GormMetricTypeRepository struct + func NewMetricTypeRepository(db *gorm.DB) *GormMetricTypeRepository + func (r *GormMetricTypeRepository) AuthScope(ctx context.Context, id properties.UUID) (auth.ObjectScope, error) + func (r *GormMetricTypeRepository) FindByName(ctx context.Context, name string) (*domain.MetricType, error) + type GormParticipantRepository struct + func NewParticipantRepository(db *gorm.DB) *GormParticipantRepository + func (r *GormParticipantRepository) AuthScope(ctx context.Context, id properties.UUID) (auth.ObjectScope, error) + type GormRepository struct + func NewGormRepository[T Tabler](db *gorm.DB, filterApplier PageFilterApplier, sortApplier PageFilterApplier, ...) *GormRepository[T] + func (r *GormRepository[T]) AuthScopeByFields(ctx context.Context, id properties.UUID, scopeFields ...string) (auth.ObjectScope, error) + func (r *GormRepository[T]) Count(ctx context.Context) (int64, error) + func (r *GormRepository[T]) Create(ctx context.Context, entity *T) error + func (r *GormRepository[T]) Delete(ctx context.Context, id properties.UUID) error + func (r *GormRepository[T]) Exists(ctx context.Context, id properties.UUID) (bool, error) + func (r *GormRepository[T]) Get(ctx context.Context, id properties.UUID) (*T, error) + func (r *GormRepository[T]) List(ctx context.Context, authIdentityScope *auth.IdentityScope, ...) (*domain.PageRes[T], error) + func (r *GormRepository[T]) Save(ctx context.Context, entity *T) error + type GormServiceGroupRepository struct + func NewServiceGroupRepository(db *gorm.DB) *GormServiceGroupRepository + func (r *GormServiceGroupRepository) AuthScope(ctx context.Context, id properties.UUID) (auth.ObjectScope, error) + func (r *GormServiceGroupRepository) CountByService(ctx context.Context, serviceID properties.UUID) (int64, error) + type GormServiceRepository struct + func NewServiceRepository(db *gorm.DB) *GormServiceRepository + func (r *GormServiceRepository) AuthScope(ctx context.Context, id properties.UUID) (auth.ObjectScope, error) + func (r *GormServiceRepository) CountByAgent(ctx context.Context, agentID properties.UUID) (int64, error) + func (r *GormServiceRepository) CountByGroup(ctx context.Context, groupID properties.UUID) (int64, error) + func (r *GormServiceRepository) FindByExternalID(ctx context.Context, agentID properties.UUID, externalID string) (*domain.Service, error) + type GormServiceTypeRepository struct + func NewServiceTypeRepository(db *gorm.DB) *GormServiceTypeRepository + func (r *GormServiceTypeRepository) AuthScope(ctx context.Context, id properties.UUID) (auth.ObjectScope, error) + func (r *GormServiceTypeRepository) Count(ctx context.Context) (int64, error) + type GormStore struct + func NewGormStore(db *gorm.DB) *GormStore + func (s *GormStore) AgentRepo() domain.AgentRepository + func (s *GormStore) AgentTypeRepo() domain.AgentTypeRepository + func (s *GormStore) Atomic(ctx context.Context, fn func(domain.Store) error) error + func (s *GormStore) EventRepo() domain.EventRepository + func (s *GormStore) EventSubscriptionRepo() domain.EventSubscriptionRepository + func (s *GormStore) JobRepo() domain.JobRepository + func (s *GormStore) MetricEntryRepo() domain.MetricEntryRepository + func (s *GormStore) MetricTypeRepo() domain.MetricTypeRepository + func (s *GormStore) ParticipantRepo() domain.ParticipantRepository + func (s *GormStore) ServiceGroupRepo() domain.ServiceGroupRepository + func (s *GormStore) ServiceRepo() domain.ServiceRepository + func (s *GormStore) ServiceTypeRepo() domain.ServiceTypeRepository + func (s *GormStore) TokenRepo() domain.TokenRepository + type GormTokenAuthenticator struct + func NewTokenAuthenticator(store domain.Store) *GormTokenAuthenticator + func (a *GormTokenAuthenticator) Authenticate(ctx context.Context, tokenValue string) (*auth.Identity, error) + func (a *GormTokenAuthenticator) Health(ctx context.Context) error + type GormTokenRepository struct + func NewTokenRepository(db *gorm.DB) *GormTokenRepository + func (r *GormTokenRepository) AuthScope(ctx context.Context, id properties.UUID) (auth.ObjectScope, error) + func (r *GormTokenRepository) DeleteByAgentID(ctx context.Context, agentID properties.UUID) error + func (r *GormTokenRepository) DeleteByParticipantID(ctx context.Context, participantID properties.UUID) error + func (r *GormTokenRepository) FindByHashedValue(ctx context.Context, hashedValue string) (*domain.Token, error) + type PageFilterApplier func(db *gorm.DB, r *domain.PageReq) (*gorm.DB, error) + func MapFilterApplier(fields map[string]FilterFieldApplier) PageFilterApplier + func MapSortApplier(fields map[string]string) PageFilterApplier + type Tabler interface + TableName func() string + type TestDB struct + DB *gorm.DB + DBName string + func NewTestDB(t *testing.T) *TestDB + func (tdb *TestDB) Cleanup(t *testing.T)