Documentation
¶
Index ¶
- Variables
- type ActivityFilter
- type CollectionRepository
- type CollectionTeamRepository
- type CollectionUserRepository
- type ExcludedDomainRepository
- type InvitationRepository
- type ItemFilter
- type ItemRepository
- type ItemShareRepository
- type ListFilter
- type ListResult
- type OrganizationFolderRepository
- type OrganizationItemFilter
- type OrganizationItemRepository
- type OrganizationRepository
- type OrganizationUserRepository
- type PermissionRepository
- type PreferencesRepository
- type RoleRepository
- type SCIMTokenRepository
- type SSOConnectionRepository
- type SSOStateRepository
- type TeamRepository
- type TeamUserRepository
- type TokenRepository
- type UserActivityRepository
- type UserAppearancePreferencesRepository
- type UserNotificationPreferencesRepository
- type UserRepository
- type VerificationRepository
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotFound = errors.New("record not found") ErrAlreadyExists = errors.New("record already exists") ErrInvalidInput = errors.New("invalid input") ErrForbidden = errors.New("operation forbidden") )
Common errors
Functions ¶
This section is empty.
Types ¶
type ActivityFilter ¶
type ActivityFilter struct {
UserID *uint
ActivityType *domain.ActivityType
Limit int
Offset int
}
ActivityFilter for filtering activities
type CollectionRepository ¶
type CollectionRepository interface {
Create(ctx context.Context, collection *domain.Collection) error
GetByID(ctx context.Context, id uint) (*domain.Collection, error)
GetByUUID(ctx context.Context, uuid string) (*domain.Collection, error)
GetByName(ctx context.Context, orgID uint, name string) (*domain.Collection, error)
GetDefaultByOrganization(ctx context.Context, orgID uint) (*domain.Collection, error)
ListByOrganization(ctx context.Context, orgID uint) ([]*domain.Collection, error)
ListForUser(ctx context.Context, orgID, userID uint) ([]*domain.Collection, error)
Update(ctx context.Context, collection *domain.Collection) error
Delete(ctx context.Context, id uint) error
SoftDelete(ctx context.Context, id uint) error
// Stats
GetItemCount(ctx context.Context, collectionID uint) (int, error)
GetUserCount(ctx context.Context, collectionID uint) (int, error)
GetTeamCount(ctx context.Context, collectionID uint) (int, error)
}
CollectionRepository defines collection data access methods
type CollectionTeamRepository ¶
type CollectionTeamRepository interface {
Create(ctx context.Context, ct *domain.CollectionTeam) error
GetByID(ctx context.Context, id uint) (*domain.CollectionTeam, error)
GetByCollectionAndTeam(ctx context.Context, collectionID, teamID uint) (*domain.CollectionTeam, error)
ListByCollection(ctx context.Context, collectionID uint) ([]*domain.CollectionTeam, error)
ListByTeam(ctx context.Context, teamID uint) ([]*domain.CollectionTeam, error)
Update(ctx context.Context, ct *domain.CollectionTeam) error
Delete(ctx context.Context, id uint) error
DeleteByCollectionAndTeam(ctx context.Context, collectionID, teamID uint) error
}
CollectionTeamRepository defines collection team access
type CollectionUserRepository ¶
type CollectionUserRepository interface {
Create(ctx context.Context, cu *domain.CollectionUser) error
GetByID(ctx context.Context, id uint) (*domain.CollectionUser, error)
GetByCollectionAndOrgUser(ctx context.Context, collectionID, orgUserID uint) (*domain.CollectionUser, error)
ListByCollection(ctx context.Context, collectionID uint) ([]*domain.CollectionUser, error)
ListByOrgUser(ctx context.Context, orgUserID uint) ([]*domain.CollectionUser, error)
Update(ctx context.Context, cu *domain.CollectionUser) error
Delete(ctx context.Context, id uint) error
DeleteByCollectionAndOrgUser(ctx context.Context, collectionID, orgUserID uint) error
}
CollectionUserRepository defines collection user access
type ExcludedDomainRepository ¶
type ExcludedDomainRepository interface {
// Create adds a new excluded domain for a user
Create(ctx context.Context, excludedDomain *domain.ExcludedDomain) error
// GetByUserID returns all excluded domains for a user
GetByUserID(ctx context.Context, userID uint) ([]*domain.ExcludedDomain, error)
// GetByUserIDAndDomain checks if a domain is excluded for a user
GetByUserIDAndDomain(ctx context.Context, userID uint, domain string) (*domain.ExcludedDomain, error)
// Delete removes an excluded domain by ID (only if it belongs to the user)
Delete(ctx context.Context, id uint, userID uint) error
// DeleteByDomain removes an excluded domain by domain name (only if it belongs to the user)
DeleteByDomain(ctx context.Context, userID uint, domain string) error
}
ExcludedDomainRepository defines the interface for excluded domain operations
type InvitationRepository ¶
type InvitationRepository interface {
Create(ctx context.Context, invitation *domain.Invitation) error
GetByEmail(ctx context.Context, email string) (*domain.Invitation, error)
GetByCode(ctx context.Context, code string) (*domain.Invitation, error)
GetByID(ctx context.Context, id uint) (*domain.Invitation, error)
GetAllByEmail(ctx context.Context, email string) ([]*domain.Invitation, error)
GetByCreator(ctx context.Context, createdBy uint) ([]*domain.Invitation, error)
Update(ctx context.Context, invitation *domain.Invitation) error
Delete(ctx context.Context, id uint) error
DeleteByEmail(ctx context.Context, email string) error
DeleteExpired(ctx context.Context) error
}
InvitationRepository defines the interface for invitation data access
type ItemFilter ¶
type ItemFilter struct {
ItemType *domain.ItemType
IsFavorite *bool
FolderID *uint
Tags []string
Search string
// URIHints filters by metadata.uri_hint (domain only, no paths).
// If multiple are provided, the result matches ANY of them.
URIHints []string
AutoFill *bool
AutoLogin *bool
Page int
PerPage int
}
ItemFilter - Filter options for listing items
type ItemRepository ¶
type ItemRepository interface {
Create(ctx context.Context, schema string, item *domain.Item) error
FindByID(ctx context.Context, schema string, id uint) (*domain.Item, error)
FindByUUID(ctx context.Context, schema string, uuid string) (*domain.Item, error)
FindBySupportID(ctx context.Context, schema string, supportID int64) (*domain.Item, error)
FindAll(ctx context.Context, schema string, filter ItemFilter) ([]*domain.Item, int64, error)
Update(ctx context.Context, schema string, item *domain.Item) error
Delete(ctx context.Context, schema string, id uint) error
HardDelete(ctx context.Context, schema string, id uint) error
}
ItemRepository defines the interface for item data access
type ItemShareRepository ¶
type ItemShareRepository interface {
}
ItemShareRepository defines item share data access methods
type ListFilter ¶
ListFilter represents common list filter parameters
type ListResult ¶
ListResult represents list query results with pagination info
type OrganizationFolderRepository ¶
type OrganizationFolderRepository interface {
Create(ctx context.Context, folder *domain.OrganizationFolder) error
GetByID(ctx context.Context, id uint) (*domain.OrganizationFolder, error)
GetByOrganization(ctx context.Context, orgID uint) ([]*domain.OrganizationFolder, error)
GetByOrganizationAndName(ctx context.Context, orgID uint, name string) (*domain.OrganizationFolder, error)
Update(ctx context.Context, folder *domain.OrganizationFolder) error
Delete(ctx context.Context, id uint) error
}
OrganizationFolderRepository defines organization folder data access methods
type OrganizationItemFilter ¶
type OrganizationItemFilter struct {
OrganizationID uint
CollectionID *uint
ItemType *domain.ItemType
IsFavorite *bool
FolderID *uint
AutoFill *bool
AutoLogin *bool
Search string
Tags []string
Page int
PerPage int
}
OrganizationItemFilter represents filter options for organization items
type OrganizationItemRepository ¶
type OrganizationItemRepository interface {
Create(ctx context.Context, item *domain.OrganizationItem) error
GetByID(ctx context.Context, id uint) (*domain.OrganizationItem, error)
GetByUUID(ctx context.Context, uuid string) (*domain.OrganizationItem, error)
GetBySupportID(ctx context.Context, supportID int64) (*domain.OrganizationItem, error)
ListByOrganization(ctx context.Context, filter OrganizationItemFilter) ([]*domain.OrganizationItem, int64, error)
ListByCollection(ctx context.Context, collectionID uint) ([]*domain.OrganizationItem, error)
MoveItemsToCollection(ctx context.Context, fromCollectionID uint, toCollectionID uint) error
Update(ctx context.Context, item *domain.OrganizationItem) error
Delete(ctx context.Context, id uint) error
SoftDelete(ctx context.Context, id uint) error
HardDelete(ctx context.Context, id uint) error
}
OrganizationItemRepository defines organization item data access methods
type OrganizationRepository ¶
type OrganizationRepository interface {
Create(ctx context.Context, org *domain.Organization) error
GetByID(ctx context.Context, id uint) (*domain.Organization, error)
GetByUUID(ctx context.Context, uuid string) (*domain.Organization, error)
GetDefaultByOwnerID(ctx context.Context, ownerUserID uint) (*domain.Organization, error)
List(ctx context.Context, filter ListFilter) ([]*domain.Organization, *ListResult, error)
ListForUser(ctx context.Context, userID uint) ([]*domain.Organization, error)
Update(ctx context.Context, org *domain.Organization) error
Delete(ctx context.Context, id uint) error
// Stats
GetMemberCount(ctx context.Context, orgID uint) (int, error)
GetTeamCount(ctx context.Context, orgID uint) (int, error)
GetCollectionCount(ctx context.Context, orgID uint) (int, error)
GetItemCount(ctx context.Context, orgID uint) (int, error)
}
OrganizationRepository defines organization data access methods
type OrganizationUserRepository ¶
type OrganizationUserRepository interface {
Create(ctx context.Context, orgUser *domain.OrganizationUser) error
GetByID(ctx context.Context, id uint) (*domain.OrganizationUser, error)
GetByUUID(ctx context.Context, uuid string) (*domain.OrganizationUser, error)
GetByOrgAndUser(ctx context.Context, orgID, userID uint) (*domain.OrganizationUser, error)
ListByOrganization(ctx context.Context, orgID uint) ([]*domain.OrganizationUser, error)
ListByUser(ctx context.Context, userID uint) ([]*domain.OrganizationUser, error)
Update(ctx context.Context, orgUser *domain.OrganizationUser) error
Delete(ctx context.Context, id uint) error
// Invitations
CountInvited(ctx context.Context, orgID uint) (int, error)
ListPendingInvitations(ctx context.Context, userEmail string) ([]*domain.OrganizationUser, error)
}
OrganizationUserRepository defines organization user data access methods
type PermissionRepository ¶
type PermissionRepository interface {
GetByID(ctx context.Context, id uint) (*domain.Permission, error)
GetByName(ctx context.Context, name string) (*domain.Permission, error)
List(ctx context.Context) ([]*domain.Permission, error)
Migrate() error
}
PermissionRepository defines permission data access methods
type PreferencesRepository ¶
type PreferencesRepository interface {
ListByOwner(ctx context.Context, ownerType string, ownerID uint, section string) ([]*domain.Preference, error)
UpsertMany(ctx context.Context, prefs []*domain.Preference) error
}
PreferencesRepository defines data access for generic preferences (user/org scoped).
type RoleRepository ¶
type RoleRepository interface {
GetByID(ctx context.Context, id uint) (*domain.Role, error)
GetByName(ctx context.Context, name string) (*domain.Role, error)
List(ctx context.Context) ([]*domain.Role, error)
GetPermissions(ctx context.Context, roleID uint) ([]string, error)
Migrate() error
}
RoleRepository defines role data access methods
type SCIMTokenRepository ¶
type SCIMTokenRepository interface {
Create(ctx context.Context, token *domain.SCIMToken) error
GetByID(ctx context.Context, id uint) (*domain.SCIMToken, error)
GetByTokenHash(ctx context.Context, tokenHash string) (*domain.SCIMToken, error)
ListByOrganization(ctx context.Context, orgID uint) ([]*domain.SCIMToken, error)
Update(ctx context.Context, token *domain.SCIMToken) error
Delete(ctx context.Context, id uint) error
}
SCIMTokenRepository defines SCIM token data access methods
type SSOConnectionRepository ¶
type SSOConnectionRepository interface {
Create(ctx context.Context, conn *domain.SSOConnection) error
GetByID(ctx context.Context, id uint) (*domain.SSOConnection, error)
GetByUUID(ctx context.Context, uuid string) (*domain.SSOConnection, error)
GetAnyByDomain(ctx context.Context, domain string) (*domain.SSOConnection, error)
GetByDomain(ctx context.Context, domain string) (*domain.SSOConnection, error)
GetByOrganizationID(ctx context.Context, orgID uint) (*domain.SSOConnection, error)
ListByOrganization(ctx context.Context, orgID uint) ([]*domain.SSOConnection, error)
Update(ctx context.Context, conn *domain.SSOConnection) error
Delete(ctx context.Context, id uint) error
}
SSOConnectionRepository defines SSO connection data access methods
type SSOStateRepository ¶
type SSOStateRepository interface {
Create(ctx context.Context, state *domain.SSOState) error
GetByState(ctx context.Context, state string) (*domain.SSOState, error)
Delete(ctx context.Context, id uint) error
DeleteExpired(ctx context.Context) (int64, error)
}
SSOStateRepository defines SSO transient state data access methods
type TeamRepository ¶
type TeamRepository interface {
Create(ctx context.Context, team *domain.Team) error
GetByID(ctx context.Context, id uint) (*domain.Team, error)
GetByUUID(ctx context.Context, uuid string) (*domain.Team, error)
GetByName(ctx context.Context, orgID uint, name string) (*domain.Team, error)
GetDefaultByOrganization(ctx context.Context, orgID uint) (*domain.Team, error)
ListByOrganization(ctx context.Context, orgID uint) ([]*domain.Team, error)
Update(ctx context.Context, team *domain.Team) error
Delete(ctx context.Context, id uint) error
// Stats
GetMemberCount(ctx context.Context, teamID uint) (int, error)
}
TeamRepository defines team data access methods
type TeamUserRepository ¶
type TeamUserRepository interface {
Create(ctx context.Context, teamUser *domain.TeamUser) error
GetByID(ctx context.Context, id uint) (*domain.TeamUser, error)
GetByTeamAndOrgUser(ctx context.Context, teamID, orgUserID uint) (*domain.TeamUser, error)
ListByTeam(ctx context.Context, teamID uint) ([]*domain.TeamUser, error)
ListByOrgUser(ctx context.Context, orgUserID uint) ([]*domain.TeamUser, error)
Update(ctx context.Context, teamUser *domain.TeamUser) error
Delete(ctx context.Context, id uint) error
DeleteByTeamAndOrgUser(ctx context.Context, teamID, orgUserID uint) error
}
TeamUserRepository defines team user data access methods
type TokenRepository ¶
type TokenRepository interface {
Create(ctx context.Context, userID int, sessionUUID uuid.UUID, deviceID uuid.UUID, app string, kind string, tokenUUID uuid.UUID, token string, expiresAt time.Time) error
GetByUUID(ctx context.Context, uuid string) (*domain.Token, error)
CountActiveSessionsByUserID(ctx context.Context, userID int) (int, error)
Delete(ctx context.Context, userID int) error
DeleteByUUID(ctx context.Context, uuid string) error
DeleteBySessionUUID(ctx context.Context, sessionUUID string) error
DeleteExpired(ctx context.Context) (int64, error)
Cleanup(ctx context.Context) error
Migrate() error
}
TokenRepository defines token data access methods
type UserActivityRepository ¶
type UserActivityRepository interface {
Create(ctx context.Context, activity *domain.UserActivity) error
GetByUserID(ctx context.Context, userID uint, limit int) ([]*domain.UserActivity, error)
GetLastActivity(ctx context.Context, userID uint, activityType domain.ActivityType) (*domain.UserActivity, error)
List(ctx context.Context, filter ActivityFilter) ([]*domain.UserActivity, int64, error)
ListByUserIDs(ctx context.Context, userIDs []uint, limit int, offset int) ([]*domain.UserActivity, error)
DeleteByUserID(ctx context.Context, userID uint) error
DeleteOldActivities(ctx context.Context, olderThan time.Duration) (int64, error)
}
UserActivityRepository defines the interface for user activity operations
type UserAppearancePreferencesRepository ¶
type UserAppearancePreferencesRepository interface {
GetByUserID(ctx context.Context, userID uint) (*domain.UserAppearancePreferences, error)
Upsert(ctx context.Context, prefs *domain.UserAppearancePreferences) error
}
UserAppearancePreferencesRepository defines data access for user appearance preferences.
type UserNotificationPreferencesRepository ¶
type UserNotificationPreferencesRepository interface {
GetByUserID(ctx context.Context, userID uint) (*domain.UserNotificationPreferences, error)
Upsert(ctx context.Context, prefs *domain.UserNotificationPreferences) error
}
UserNotificationPreferencesRepository defines data access for user notification preferences.
type UserRepository ¶
type UserRepository interface {
GetByID(ctx context.Context, id uint) (*domain.User, error)
GetByUUID(ctx context.Context, uuid string) (*domain.User, error)
GetByEmail(ctx context.Context, email string) (*domain.User, error)
GetBySchema(ctx context.Context, schema string) (*domain.User, error)
List(ctx context.Context, filter ListFilter) ([]*domain.User, *ListResult, error)
GetItemCount(ctx context.Context, schema string) (int, error)
Create(ctx context.Context, user *domain.User) error
Update(ctx context.Context, user *domain.User) error
Delete(ctx context.Context, id uint, schema string) error
Migrate() error
CreateSchema(schema string) error
MigrateUserSchema(schema string) error
}
UserRepository defines user data access methods
type VerificationRepository ¶
type VerificationRepository interface {
Create(ctx context.Context, code *domain.VerificationCode) error
GetByEmailAndCode(ctx context.Context, email, code string) (*domain.VerificationCode, error)
DeleteByEmail(ctx context.Context, email string) error
DeleteExpired(ctx context.Context) (int64, error)
Migrate() error
}
VerificationRepository defines verification code data access methods