Documentation ¶
Index ¶
- Constants
- Variables
- type Audit
- type AuditRepository
- type Domain
- type DomainRepository
- func (s *DomainRepository) Create(ctx context.Context, toCreate domain.Domain) (domain.Domain, error)
- func (s *DomainRepository) Delete(ctx context.Context, id string) error
- func (s *DomainRepository) DeleteExpiredDomainRequests(ctx context.Context) error
- func (s *DomainRepository) Get(ctx context.Context, id string) (domain.Domain, error)
- func (s *DomainRepository) List(ctx context.Context, flt domain.Filter) ([]domain.Domain, error)
- func (s *DomainRepository) Update(ctx context.Context, toUpdate domain.Domain) (domain.Domain, error)
- type Flow
- type FlowRepository
- func (s *FlowRepository) Delete(ctx context.Context, id uuid.UUID) error
- func (s *FlowRepository) DeleteExpiredFlows(ctx context.Context) error
- func (s *FlowRepository) Get(ctx context.Context, id uuid.UUID) (*authenticate.Flow, error)
- func (s *FlowRepository) Set(ctx context.Context, flow *authenticate.Flow) error
- type Group
- type GroupRepository
- func (r GroupRepository) Create(ctx context.Context, grp group.Group) (group.Group, error)
- func (r GroupRepository) Delete(ctx context.Context, id string) error
- func (r GroupRepository) GetByID(ctx context.Context, id string) (group.Group, error)
- func (r GroupRepository) GetByIDs(ctx context.Context, groupIDs []string, flt group.Filter) ([]group.Group, error)
- func (r GroupRepository) List(ctx context.Context, flt group.Filter) ([]group.Group, error)
- func (r GroupRepository) ListGroupRelations(ctx context.Context, objectId string, subject_type string, role string) ([]relation.Relation, error)
- func (r GroupRepository) SetState(ctx context.Context, id string, state group.State) error
- func (r GroupRepository) UpdateByID(ctx context.Context, grp group.Group) (group.Group, error)
- type Invitation
- type InvitationRepository
- func (s *InvitationRepository) Delete(ctx context.Context, id uuid.UUID) error
- func (s *InvitationRepository) GarbageCollect(ctx context.Context) error
- func (s *InvitationRepository) Get(ctx context.Context, id uuid.UUID) (invitation.Invitation, error)
- func (s *InvitationRepository) List(ctx context.Context, flt invitation.Filter) ([]invitation.Invitation, error)
- func (s *InvitationRepository) ListByUser(ctx context.Context, id string) ([]invitation.Invitation, error)
- func (s *InvitationRepository) Set(ctx context.Context, invite invitation.Invitation) (invitation.Invitation, error)
- type MetaSchema
- type MetaSchemaRepository
- func (m MetaSchemaRepository) Create(ctx context.Context, mschema metaschema.MetaSchema) (metaschema.MetaSchema, error)
- func (m MetaSchemaRepository) Delete(ctx context.Context, id string) (string, error)
- func (m MetaSchemaRepository) Get(ctx context.Context, id string) (metaschema.MetaSchema, error)
- func (m MetaSchemaRepository) List(ctx context.Context) ([]metaschema.MetaSchema, error)
- func (m MetaSchemaRepository) MigrateDefaults(ctx context.Context) error
- func (m MetaSchemaRepository) Update(ctx context.Context, id string, mschema metaschema.MetaSchema) (metaschema.MetaSchema, error)
- type Namespace
- type NamespaceRepository
- func (r NamespaceRepository) Get(ctx context.Context, id string) (namespace.Namespace, error)
- func (r NamespaceRepository) List(ctx context.Context) ([]namespace.Namespace, error)
- func (r NamespaceRepository) Update(ctx context.Context, ns namespace.Namespace) (namespace.Namespace, error)
- func (r NamespaceRepository) Upsert(ctx context.Context, ns namespace.Namespace) (namespace.Namespace, error)
- type Organization
- type OrganizationRepository
- func (r OrganizationRepository) Create(ctx context.Context, org organization.Organization) (organization.Organization, error)
- func (r OrganizationRepository) Delete(ctx context.Context, id string) error
- func (r OrganizationRepository) GetByID(ctx context.Context, id string) (organization.Organization, error)
- func (r OrganizationRepository) GetByIDs(ctx context.Context, ids []string) ([]organization.Organization, error)
- func (r OrganizationRepository) GetByName(ctx context.Context, name string) (organization.Organization, error)
- func (r OrganizationRepository) List(ctx context.Context, flt organization.Filter) ([]organization.Organization, error)
- func (r OrganizationRepository) SetState(ctx context.Context, id string, state organization.State) error
- func (r OrganizationRepository) UpdateByID(ctx context.Context, org organization.Organization) (organization.Organization, error)
- func (r OrganizationRepository) UpdateByName(ctx context.Context, org organization.Organization) (organization.Organization, error)
- type Permission
- type PermissionRepository
- func (r PermissionRepository) Delete(ctx context.Context, id string) error
- func (r PermissionRepository) Get(ctx context.Context, id string) (permission.Permission, error)
- func (r PermissionRepository) GetBySlug(ctx context.Context, slug string) (permission.Permission, error)
- func (r PermissionRepository) List(ctx context.Context, flt permission.Filter) ([]permission.Permission, error)
- func (r PermissionRepository) Update(ctx context.Context, act permission.Permission) (permission.Permission, error)
- func (r PermissionRepository) Upsert(ctx context.Context, perm permission.Permission) (permission.Permission, error)
- type Policy
- type PolicyCols
- type PolicyRepository
- func (r PolicyRepository) Delete(ctx context.Context, id string) error
- func (r PolicyRepository) Get(ctx context.Context, id string) (policy.Policy, error)
- func (r PolicyRepository) List(ctx context.Context, flt policy.Filter) ([]policy.Policy, error)
- func (r PolicyRepository) Update(ctx context.Context, toUpdate policy.Policy) (string, error)
- func (r PolicyRepository) Upsert(ctx context.Context, pol policy.Policy) (policy.Policy, error)
- type Preference
- type PreferenceRepository
- func (s *PreferenceRepository) Get(ctx context.Context, id uuid.UUID) (preference.Preference, error)
- func (s *PreferenceRepository) List(ctx context.Context, flt preference.Filter) ([]preference.Preference, error)
- func (s *PreferenceRepository) Set(ctx context.Context, pref preference.Preference) (preference.Preference, error)
- type Project
- type ProjectRepository
- func (r ProjectRepository) Create(ctx context.Context, prj project.Project) (project.Project, error)
- func (r ProjectRepository) Delete(ctx context.Context, id string) error
- func (r ProjectRepository) GetByID(ctx context.Context, id string) (project.Project, error)
- func (r ProjectRepository) GetByIDs(ctx context.Context, ids []string, flt project.Filter) ([]project.Project, error)
- func (r ProjectRepository) GetByName(ctx context.Context, name string) (project.Project, error)
- func (r ProjectRepository) List(ctx context.Context, flt project.Filter) ([]project.Project, error)
- func (r ProjectRepository) SetState(ctx context.Context, id string, state project.State) error
- func (r ProjectRepository) UpdateByID(ctx context.Context, prj project.Project) (project.Project, error)
- func (r ProjectRepository) UpdateByName(ctx context.Context, prj project.Project) (project.Project, error)
- type Relation
- type RelationRepository
- func (r RelationRepository) DeleteByID(ctx context.Context, id string) error
- func (r RelationRepository) Get(ctx context.Context, id string) (relation.Relation, error)
- func (r RelationRepository) GetByFields(ctx context.Context, rel relation.Relation) ([]relation.Relation, error)
- func (r RelationRepository) List(ctx context.Context) ([]relation.Relation, error)
- func (r RelationRepository) ListByFields(ctx context.Context, rel relation.Relation) ([]relation.Relation, error)
- func (r RelationRepository) Upsert(ctx context.Context, relationToCreate relation.Relation) (relation.Relation, error)
- type Resource
- type ResourceCols
- type ResourceRepository
- func (r ResourceRepository) Create(ctx context.Context, res resource.Resource) (resource.Resource, error)
- func (r ResourceRepository) Delete(ctx context.Context, id string) error
- func (r ResourceRepository) GetByID(ctx context.Context, id string) (resource.Resource, error)
- func (r ResourceRepository) GetByURN(ctx context.Context, urn string) (resource.Resource, error)
- func (r ResourceRepository) List(ctx context.Context, flt resource.Filter) ([]resource.Resource, error)
- func (r ResourceRepository) Update(ctx context.Context, res resource.Resource) (resource.Resource, error)
- type Role
- type RoleRepository
- func (r RoleRepository) Delete(ctx context.Context, id string) error
- func (r RoleRepository) Get(ctx context.Context, id string) (role.Role, error)
- func (r RoleRepository) GetByName(ctx context.Context, orgID, name string) (role.Role, error)
- func (r RoleRepository) List(ctx context.Context, flt role.Filter) ([]role.Role, error)
- func (r RoleRepository) Update(ctx context.Context, rl role.Role) (role.Role, error)
- func (r RoleRepository) Upsert(ctx context.Context, rl role.Role) (role.Role, error)
- type ServiceUser
- type ServiceUserCredential
- type ServiceUserCredentialRepository
- func (s ServiceUserCredentialRepository) Create(ctx context.Context, credential serviceuser.Credential) (serviceuser.Credential, error)
- func (s ServiceUserCredentialRepository) Delete(ctx context.Context, id string) error
- func (s ServiceUserCredentialRepository) Get(ctx context.Context, id string) (serviceuser.Credential, error)
- func (s ServiceUserCredentialRepository) List(ctx context.Context, flt serviceuser.Filter) ([]serviceuser.Credential, error)
- type ServiceUserRepository
- func (s ServiceUserRepository) Create(ctx context.Context, serviceUser serviceuser.ServiceUser) (serviceuser.ServiceUser, error)
- func (s ServiceUserRepository) Delete(ctx context.Context, id string) error
- func (s ServiceUserRepository) GetByID(ctx context.Context, id string) (serviceuser.ServiceUser, error)
- func (s ServiceUserRepository) GetByIDs(ctx context.Context, ids []string) ([]serviceuser.ServiceUser, error)
- func (s ServiceUserRepository) List(ctx context.Context, flt serviceuser.Filter) ([]serviceuser.ServiceUser, error)
- type Session
- type SessionRepository
- func (s *SessionRepository) Delete(ctx context.Context, id uuid.UUID) error
- func (s *SessionRepository) DeleteExpiredSessions(ctx context.Context) error
- func (s *SessionRepository) Get(ctx context.Context, id uuid.UUID) (*frontiersession.Session, error)
- func (s *SessionRepository) Set(ctx context.Context, session *frontiersession.Session) error
- func (s *SessionRepository) UpdateValidity(ctx context.Context, id uuid.UUID, validity time.Duration) error
- type User
- type UserRepository
- func (r UserRepository) Create(ctx context.Context, usr user.User) (user.User, error)
- func (r UserRepository) Delete(ctx context.Context, id string) error
- func (r UserRepository) GetByEmail(ctx context.Context, email string) (user.User, error)
- func (r UserRepository) GetByID(ctx context.Context, id string) (user.User, error)
- func (r UserRepository) GetByIDs(ctx context.Context, userIDs []string) ([]user.User, error)
- func (r UserRepository) GetByName(ctx context.Context, name string) (user.User, error)
- func (r UserRepository) List(ctx context.Context, flt user.Filter) ([]user.User, error)
- func (r UserRepository) SetState(ctx context.Context, id string, state user.State) error
- func (r UserRepository) UpdateByEmail(ctx context.Context, usr user.User) (user.User, error)
- func (r UserRepository) UpdateByID(ctx context.Context, usr user.User) (user.User, error)
- func (r UserRepository) UpdateByName(ctx context.Context, usr user.User) (user.User, error)
Constants ¶
View Source
const ( TABLE_PERMISSIONS = "permissions" TABLE_GROUPS = "groups" TABLE_NAMESPACES = "namespaces" TABLE_ORGANIZATIONS = "organizations" TABLE_POLICIES = "policies" TABLE_PROJECTS = "projects" TABLE_RELATIONS = "relations" TABLE_RESOURCES = "resources" TABLE_ROLES = "roles" TABLE_USERS = "users" TABLE_METASCHEMA = "metaschema" TABLE_FLOWS = "flows" TABLE_SESSIONS = "sessions" TABLE_INVITATIONS = "invitations" TABLE_SERVICEUSER = "serviceusers" TABLE_SERVICEUSERCREDENTIALS = "serviceuser_credentials" TABLE_AUDITLOGS = "auditlogs" TABLE_DOMAINS = "domains" TABLE_PREFERENCES = "preferences" )
Variables ¶
View Source
var ( ErrDuplicateKey = errors.New("duplicate key") ErrCheckViolation = errors.New("check constraint violation") ErrForeignKeyViolation = errors.New("foreign key violation") ErrInvalidTextRepresentation = errors.New("invalid input syntax type") ErrInvalidID = errors.New("invalid id") )
View Source
var (
ErrInvalidSlug = fmt.Errorf("invalid slug")
)
Functions ¶
This section is empty.
Types ¶
type Audit ¶
type Audit struct { ID string `db:"id"` OrgID string `db:"org_id"` Source string `db:"source"` Action string `db:"action"` Actor types.NullJSONText `db:"actor"` Target types.NullJSONText `db:"target"` Metadata types.NullJSONText `db:"metadata"` CreatedAt time.Time `db:"created_at"` }
type AuditRepository ¶
type AuditRepository struct {
// contains filtered or unexported fields
}
func NewAuditRepository ¶
func NewAuditRepository(dbc *db.Client) *AuditRepository
type DomainRepository ¶ added in v0.7.2
func NewDomainRepository ¶ added in v0.7.2
func NewDomainRepository(logger log.Logger, dbc *db.Client) *DomainRepository
func (*DomainRepository) Delete ¶ added in v0.7.2
func (s *DomainRepository) Delete(ctx context.Context, id string) error
func (*DomainRepository) DeleteExpiredDomainRequests ¶ added in v0.7.2
func (s *DomainRepository) DeleteExpiredDomainRequests(ctx context.Context) error
type FlowRepository ¶
func NewFlowRepository ¶
func NewFlowRepository(logger log.Logger, dbc *db.Client) *FlowRepository
func (*FlowRepository) DeleteExpiredFlows ¶
func (s *FlowRepository) DeleteExpiredFlows(ctx context.Context) error
func (*FlowRepository) Get ¶
func (s *FlowRepository) Get(ctx context.Context, id uuid.UUID) (*authenticate.Flow, error)
func (*FlowRepository) Set ¶
func (s *FlowRepository) Set(ctx context.Context, flow *authenticate.Flow) error
type Group ¶
type Group struct { ID string `db:"id"` Name string `db:"name"` Title sql.NullString `db:"title"` OrgID string `db:"org_id"` Metadata []byte `db:"metadata"` State sql.NullString `db:"state"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt sql.NullTime `db:"deleted_at"` }
type GroupRepository ¶
type GroupRepository struct {
// contains filtered or unexported fields
}
func NewGroupRepository ¶
func NewGroupRepository(dbc *db.Client) *GroupRepository
func (GroupRepository) Delete ¶
func (r GroupRepository) Delete(ctx context.Context, id string) error
func (GroupRepository) ListGroupRelations ¶
func (r GroupRepository) ListGroupRelations(ctx context.Context, objectId string, subject_type string, role string) ([]relation.Relation, error)
TODO(kushsharma): no longer in use, delete if needed
func (GroupRepository) UpdateByID ¶
type Invitation ¶
type InvitationRepository ¶
func NewInvitationRepository ¶
func NewInvitationRepository(logger log.Logger, dbc *db.Client) *InvitationRepository
func (*InvitationRepository) GarbageCollect ¶
func (s *InvitationRepository) GarbageCollect(ctx context.Context) error
TODO(kushsharma): schedue a cron for it
func (*InvitationRepository) Get ¶
func (s *InvitationRepository) Get(ctx context.Context, id uuid.UUID) (invitation.Invitation, error)
func (*InvitationRepository) List ¶
func (s *InvitationRepository) List(ctx context.Context, flt invitation.Filter) ([]invitation.Invitation, error)
func (*InvitationRepository) ListByUser ¶
func (s *InvitationRepository) ListByUser(ctx context.Context, id string) ([]invitation.Invitation, error)
func (*InvitationRepository) Set ¶
func (s *InvitationRepository) Set(ctx context.Context, invite invitation.Invitation) (invitation.Invitation, error)
type MetaSchema ¶
type MetaSchemaRepository ¶
type MetaSchemaRepository struct {
// contains filtered or unexported fields
}
func NewMetaSchemaRepository ¶
func NewMetaSchemaRepository(logger log.Logger, dbc *db.Client) *MetaSchemaRepository
func (MetaSchemaRepository) Create ¶
func (m MetaSchemaRepository) Create(ctx context.Context, mschema metaschema.MetaSchema) (metaschema.MetaSchema, error)
func (MetaSchemaRepository) Get ¶
func (m MetaSchemaRepository) Get(ctx context.Context, id string) (metaschema.MetaSchema, error)
func (MetaSchemaRepository) List ¶
func (m MetaSchemaRepository) List(ctx context.Context) ([]metaschema.MetaSchema, error)
func (MetaSchemaRepository) MigrateDefaults ¶
func (m MetaSchemaRepository) MigrateDefaults(ctx context.Context) error
add default schemas to db once during database migration
func (MetaSchemaRepository) Update ¶
func (m MetaSchemaRepository) Update(ctx context.Context, id string, mschema metaschema.MetaSchema) (metaschema.MetaSchema, error)
type NamespaceRepository ¶
type NamespaceRepository struct {
// contains filtered or unexported fields
}
func NewNamespaceRepository ¶
func NewNamespaceRepository(dbc *db.Client) *NamespaceRepository
type Organization ¶
type Organization struct { ID string `db:"id"` Name string `db:"name"` Title sql.NullString `db:"title"` Avatar sql.NullString `db:"avatar"` Metadata []byte `db:"metadata"` State sql.NullString `db:"state"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt sql.NullTime `db:"deleted_at"` }
type OrganizationRepository ¶
type OrganizationRepository struct {
// contains filtered or unexported fields
}
func NewOrganizationRepository ¶
func NewOrganizationRepository(dbc *db.Client) *OrganizationRepository
func (OrganizationRepository) Create ¶
func (r OrganizationRepository) Create(ctx context.Context, org organization.Organization) (organization.Organization, error)
func (OrganizationRepository) Delete ¶
func (r OrganizationRepository) Delete(ctx context.Context, id string) error
func (OrganizationRepository) GetByID ¶
func (r OrganizationRepository) GetByID(ctx context.Context, id string) (organization.Organization, error)
func (OrganizationRepository) GetByIDs ¶
func (r OrganizationRepository) GetByIDs(ctx context.Context, ids []string) ([]organization.Organization, error)
func (OrganizationRepository) GetByName ¶
func (r OrganizationRepository) GetByName(ctx context.Context, name string) (organization.Organization, error)
func (OrganizationRepository) List ¶
func (r OrganizationRepository) List(ctx context.Context, flt organization.Filter) ([]organization.Organization, error)
func (OrganizationRepository) SetState ¶
func (r OrganizationRepository) SetState(ctx context.Context, id string, state organization.State) error
func (OrganizationRepository) UpdateByID ¶
func (r OrganizationRepository) UpdateByID(ctx context.Context, org organization.Organization) (organization.Organization, error)
func (OrganizationRepository) UpdateByName ¶
func (r OrganizationRepository) UpdateByName(ctx context.Context, org organization.Organization) (organization.Organization, error)
type Permission ¶
type PermissionRepository ¶
type PermissionRepository struct {
// contains filtered or unexported fields
}
func NewPermissionRepository ¶
func NewPermissionRepository(dbc *db.Client) *PermissionRepository
func (PermissionRepository) Delete ¶
func (r PermissionRepository) Delete(ctx context.Context, id string) error
func (PermissionRepository) Get ¶
func (r PermissionRepository) Get(ctx context.Context, id string) (permission.Permission, error)
func (PermissionRepository) GetBySlug ¶
func (r PermissionRepository) GetBySlug(ctx context.Context, slug string) (permission.Permission, error)
func (PermissionRepository) List ¶
func (r PermissionRepository) List(ctx context.Context, flt permission.Filter) ([]permission.Permission, error)
func (PermissionRepository) Update ¶
func (r PermissionRepository) Update(ctx context.Context, act permission.Permission) (permission.Permission, error)
func (PermissionRepository) Upsert ¶
func (r PermissionRepository) Upsert(ctx context.Context, perm permission.Permission) (permission.Permission, error)
type Policy ¶
type Policy struct { ID string `db:"id"` Role Role RoleID string `db:"role_id"` ResourceID string `db:"resource_id"` ResourceType string `db:"resource_type"` PrincipalID string `db:"principal_id"` PrincipalType string `db:"principal_type"` Metadata []byte `db:"metadata"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` }
type PolicyCols ¶
type PolicyCols struct { ID string `db:"id"` RoleID string `db:"role_id"` ResourceType string `db:"resource_type"` ResourceID string `db:"resource_id"` PrincipalID string `db:"principal_id"` PrincipalType string `db:"principal_type"` Metadata []byte `db:"metadata"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` }
type PolicyRepository ¶
type PolicyRepository struct {
// contains filtered or unexported fields
}
func NewPolicyRepository ¶
func NewPolicyRepository(dbc *db.Client) *PolicyRepository
func (PolicyRepository) Delete ¶
func (r PolicyRepository) Delete(ctx context.Context, id string) error
type Preference ¶ added in v0.7.3
type PreferenceRepository ¶ added in v0.7.3
type PreferenceRepository struct {
// contains filtered or unexported fields
}
func NewPreferenceRepository ¶ added in v0.7.3
func NewPreferenceRepository(dbc *db.Client) *PreferenceRepository
func (*PreferenceRepository) Get ¶ added in v0.7.3
func (s *PreferenceRepository) Get(ctx context.Context, id uuid.UUID) (preference.Preference, error)
func (*PreferenceRepository) List ¶ added in v0.7.3
func (s *PreferenceRepository) List(ctx context.Context, flt preference.Filter) ([]preference.Preference, error)
func (*PreferenceRepository) Set ¶ added in v0.7.3
func (s *PreferenceRepository) Set(ctx context.Context, pref preference.Preference) (preference.Preference, error)
type Project ¶
type Project struct { ID string `db:"id"` Name string `db:"name"` Title sql.NullString `db:"title"` OrgID string `db:"org_id"` Metadata []byte `db:"metadata"` State sql.NullString `db:"state"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt sql.NullTime `db:"deleted_at"` }
type ProjectRepository ¶
type ProjectRepository struct {
// contains filtered or unexported fields
}
func NewProjectRepository ¶
func NewProjectRepository(dbc *db.Client) *ProjectRepository
func (ProjectRepository) Delete ¶
func (r ProjectRepository) Delete(ctx context.Context, id string) error
func (ProjectRepository) UpdateByID ¶
func (ProjectRepository) UpdateByName ¶
type Relation ¶
type Relation struct { ID string `db:"id"` SubjectNamespaceID string `db:"subject_namespace_name"` SubjectNamespace Namespace `db:"subject_namespace"` SubjectID string `db:"subject_id"` SubjectSubRelationID sql.NullString `db:"subject_subrelation_name"` ObjectNamespaceID string `db:"object_namespace_name"` ObjectNamespace Namespace `db:"object_namespace"` ObjectID string `db:"object_id"` RelationName string `db:"relation_name"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt sql.NullTime `db:"deleted_at"` }
type RelationRepository ¶
type RelationRepository struct {
// contains filtered or unexported fields
}
func NewRelationRepository ¶
func NewRelationRepository(dbc *db.Client) *RelationRepository
func (RelationRepository) DeleteByID ¶
func (r RelationRepository) DeleteByID(ctx context.Context, id string) error
func (RelationRepository) GetByFields ¶
func (RelationRepository) ListByFields ¶
type Resource ¶
type Resource struct { ID string `db:"id"` URN string `db:"urn"` Name string `db:"name"` Title string `db:"title"` ProjectID string `db:"project_id"` Project Project `db:"project"` Metadata []byte `db:"metadata"` NamespaceID string `db:"namespace_name"` Namespace Namespace `db:"namespace"` PrincipalID sql.NullString `db:"principal_id"` PrincipalType sql.NullString `db:"principal_type"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt sql.NullTime `db:"deleted_at"` }
type ResourceCols ¶
type ResourceCols struct { ID string `db:"id"` URN string `db:"urn"` Title string `db:"title"` Name string `db:"name"` ProjectID string `db:"project_id"` NamespaceID string `db:"namespace_name"` PrincipalID sql.NullString `db:"principal_id"` PrincipalType sql.NullString `db:"principal_type"` Metadata []byte `db:"metadata"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` }
type ResourceRepository ¶
type ResourceRepository struct {
// contains filtered or unexported fields
}
func NewResourceRepository ¶
func NewResourceRepository(dbc *db.Client) *ResourceRepository
func (ResourceRepository) Delete ¶
func (r ResourceRepository) Delete(ctx context.Context, id string) error
type Role ¶
type Role struct { ID string `db:"id"` OrgID string `db:"org_id"` Name string `db:"name"` Title sql.NullString `db:"title"` Permissions []byte `db:"permissions"` State string `db:"state"` Scopes pq.StringArray `db:"scopes"` Metadata []byte `db:"metadata"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt sql.NullTime `db:"deleted_at"` }
type RoleRepository ¶
type RoleRepository struct {
// contains filtered or unexported fields
}
func NewRoleRepository ¶
func NewRoleRepository(dbc *db.Client) *RoleRepository
type ServiceUser ¶
type ServiceUserCredential ¶
type ServiceUserCredential struct { ID string `db:"id"` ServiceUserID string `db:"serviceuser_id"` SecretHash sql.NullString `db:"secret_hash"` PublicKey []byte `db:"public_key"` Title sql.NullString `db:"title"` Metadata []byte `db:"metadata"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt sql.NullTime `db:"deleted_at"` }
type ServiceUserCredentialRepository ¶
type ServiceUserCredentialRepository struct {
// contains filtered or unexported fields
}
func NewServiceUserCredentialRepository ¶
func NewServiceUserCredentialRepository(dbc *db.Client) *ServiceUserCredentialRepository
func (ServiceUserCredentialRepository) Create ¶
func (s ServiceUserCredentialRepository) Create(ctx context.Context, credential serviceuser.Credential) (serviceuser.Credential, error)
func (ServiceUserCredentialRepository) Delete ¶
func (s ServiceUserCredentialRepository) Delete(ctx context.Context, id string) error
func (ServiceUserCredentialRepository) Get ¶
func (s ServiceUserCredentialRepository) Get(ctx context.Context, id string) (serviceuser.Credential, error)
func (ServiceUserCredentialRepository) List ¶
func (s ServiceUserCredentialRepository) List(ctx context.Context, flt serviceuser.Filter) ([]serviceuser.Credential, error)
type ServiceUserRepository ¶
type ServiceUserRepository struct {
// contains filtered or unexported fields
}
func NewServiceUserRepository ¶
func NewServiceUserRepository(dbc *db.Client) *ServiceUserRepository
func (ServiceUserRepository) Create ¶
func (s ServiceUserRepository) Create(ctx context.Context, serviceUser serviceuser.ServiceUser) (serviceuser.ServiceUser, error)
func (ServiceUserRepository) Delete ¶
func (s ServiceUserRepository) Delete(ctx context.Context, id string) error
func (ServiceUserRepository) GetByID ¶
func (s ServiceUserRepository) GetByID(ctx context.Context, id string) (serviceuser.ServiceUser, error)
func (ServiceUserRepository) GetByIDs ¶
func (s ServiceUserRepository) GetByIDs(ctx context.Context, ids []string) ([]serviceuser.ServiceUser, error)
GetByIDs returns a list of service users by their IDs.
func (ServiceUserRepository) List ¶
func (s ServiceUserRepository) List(ctx context.Context, flt serviceuser.Filter) ([]serviceuser.ServiceUser, error)
type SessionRepository ¶
func NewSessionRepository ¶
func NewSessionRepository(logger log.Logger, dbc *db.Client) *SessionRepository
func (*SessionRepository) DeleteExpiredSessions ¶
func (s *SessionRepository) DeleteExpiredSessions(ctx context.Context) error
func (*SessionRepository) Get ¶
func (s *SessionRepository) Get(ctx context.Context, id uuid.UUID) (*frontiersession.Session, error)
func (*SessionRepository) Set ¶
func (s *SessionRepository) Set(ctx context.Context, session *frontiersession.Session) error
func (*SessionRepository) UpdateValidity ¶
type User ¶
type User struct { ID string `db:"id"` Name string `db:"name"` Email string `db:"email"` Title sql.NullString `db:"title"` Avatar sql.NullString `db:"avatar"` Metadata []byte `db:"metadata"` State sql.NullString `db:"state"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt sql.NullTime `db:"deleted_at"` }
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
func NewUserRepository ¶
func NewUserRepository(dbc *db.Client) *UserRepository
func (UserRepository) GetByEmail ¶
func (UserRepository) UpdateByEmail ¶
func (UserRepository) UpdateByID ¶
func (UserRepository) UpdateByName ¶
Source Files ¶
- audit.go
- audit_repository.go
- domain.go
- domain_repository.go
- errors.go
- flow.go
- flow_repository.go
- group.go
- group_repository.go
- invitation.go
- invitation_repository.go
- metaschema.go
- metaschema_repository.go
- namespace.go
- namespace_repository.go
- organization.go
- organization_repository.go
- permission.go
- permission_repository.go
- policy.go
- policy_repository.go
- postgres.go
- preference.go
- preference_repository.go
- project.go
- project_repository.go
- relation.go
- relation_repository.go
- resource.go
- resource_repository.go
- role.go
- role_repository.go
- serviceuser.go
- serviceuser_credential_repository.go
- serviceuser_repository.go
- session.go
- session_repository.go
- user.go
- user_repository.go
Click to show internal directories.
Click to hide internal directories.