Documentation ¶
Index ¶
- Constants
- func GetAll(ctx context.Context) ([]resource.YAML, error)
- type Action
- type ActionRepository
- func (r ActionRepository) Get(ctx context.Context, id string) (action.Action, error)
- func (r ActionRepository) List(ctx context.Context) ([]action.Action, error)
- func (r ActionRepository) Update(ctx context.Context, act action.Action) (action.Action, error)
- func (r ActionRepository) Upsert(ctx context.Context, act action.Action) (action.Action, error)
- type ActivityRepository
- type Config
- type Group
- type GroupRepository
- func (r GroupRepository) Create(ctx context.Context, grp group.Group) (group.Group, error)
- func (r GroupRepository) GetByID(ctx context.Context, id string) (group.Group, error)
- func (r GroupRepository) GetByIDs(ctx context.Context, groupIDs []string) ([]group.Group, error)
- func (r GroupRepository) GetBySlug(ctx context.Context, slug string) (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.RelationV2, error)
- func (r GroupRepository) ListUserGroups(ctx context.Context, userID string, roleID string) ([]group.Group, error)
- func (r GroupRepository) UpdateByID(ctx context.Context, grp group.Group) (group.Group, error)
- func (r GroupRepository) UpdateBySlug(ctx context.Context, grp group.Group) (group.Group, error)
- type Key
- 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) GetByID(ctx context.Context, id string) (organization.Organization, error)
- func (r OrganizationRepository) GetBySlug(ctx context.Context, slug string) (organization.Organization, error)
- func (r OrganizationRepository) List(ctx context.Context) ([]organization.Organization, error)
- func (r OrganizationRepository) ListAdminsByOrgID(ctx context.Context, orgID string) ([]user.User, error)
- func (r OrganizationRepository) UpdateByID(ctx context.Context, org organization.Organization) (organization.Organization, error)
- func (r OrganizationRepository) UpdateBySlug(ctx context.Context, org organization.Organization) (organization.Organization, error)
- type Policy
- type PolicyCols
- type PolicyRepository
- func (r PolicyRepository) Get(ctx context.Context, id string) (policy.Policy, error)
- func (r PolicyRepository) List(ctx context.Context, filter policy.Filters) ([]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) (string, error)
- type Project
- type ProjectRepository
- func (r ProjectRepository) Create(ctx context.Context, prj project.Project) (project.Project, error)
- func (r ProjectRepository) GetByID(ctx context.Context, id string) (project.Project, error)
- func (r ProjectRepository) GetBySlug(ctx context.Context, slug string) (project.Project, error)
- func (r ProjectRepository) List(ctx context.Context) ([]project.Project, error)
- func (r ProjectRepository) ListAdmins(ctx context.Context, projectID string) ([]user.User, error)
- func (r ProjectRepository) UpdateByID(ctx context.Context, prj project.Project) (project.Project, error)
- func (r ProjectRepository) UpdateBySlug(ctx context.Context, prj project.Project) (project.Project, error)
- type Relation
- type RelationRepository
- func (r RelationRepository) Create(ctx context.Context, relationToCreate relation.RelationV2) (relation.RelationV2, error)
- func (r RelationRepository) DeleteByID(ctx context.Context, id string) error
- func (r RelationRepository) Get(ctx context.Context, id string) (relation.RelationV2, error)
- func (r RelationRepository) GetByFields(ctx context.Context, rel relation.RelationV2) (relation.RelationV2, error)
- func (r RelationRepository) List(ctx context.Context) ([]relation.RelationV2, error)
- func (r RelationRepository) Update(ctx context.Context, rel relation.Relation) (relation.Relation, error)
- type Resource
- type ResourceCols
- type ResourceConfig
- type ResourceRepository
- func (r *ResourceRepository) Commit(ctx context.Context) error
- func (r ResourceRepository) Create(ctx context.Context, res resource.Resource) (resource.Resource, error)
- func (r ResourceRepository) GetByID(ctx context.Context, id string) (resource.Resource, error)
- func (r ResourceRepository) GetByNamespace(ctx context.Context, name string, ns string) (resource.Resource, error)
- func (r ResourceRepository) GetByURN(ctx context.Context, urn string) (resource.Resource, error)
- func (r ResourceRepository) GetSchema(ctx context.Context) (schema.NamespaceConfigMapType, error)
- func (r ResourceRepository) List(ctx context.Context, flt resource.Filter) ([]resource.Resource, error)
- func (r *ResourceRepository) Rollback(ctx context.Context, err error) error
- func (r ResourceRepository) Update(ctx context.Context, id string, res resource.Resource) (resource.Resource, error)
- func (r ResourceRepository) Upsert(ctx context.Context, res resource.Resource) (resource.Resource, error)
- func (r ResourceRepository) UpsertConfig(ctx context.Context, name string, config schema.NamespaceConfigMapType) (schema.Config, error)
- func (r *ResourceRepository) WithTransaction(ctx context.Context) context.Context
- type Role
- type RoleRepository
- func (r RoleRepository) Get(ctx context.Context, id string) (role.Role, error)
- func (r RoleRepository) List(ctx context.Context) ([]role.Role, error)
- func (r RoleRepository) Update(ctx context.Context, rl role.Role) (string, error)
- func (r RoleRepository) Upsert(ctx context.Context, rl role.Role) (string, error)
- type RuleConfig
- type RuleRepository
- func (r *RuleRepository) Commit(ctx context.Context) error
- func (r *RuleRepository) GetAll(ctx context.Context) ([]rule.Ruleset, error)
- func (r *RuleRepository) InitCache(ctx context.Context) error
- func (r *RuleRepository) Rollback(ctx context.Context, err error) error
- func (r *RuleRepository) Upsert(ctx context.Context, name string, config rule.Ruleset) (rule.Config, error)
- func (r *RuleRepository) WithTransaction(ctx context.Context) context.Context
- type ServiceData
- type ServiceDataRepository
- func (r ServiceDataRepository) Commit(ctx context.Context) error
- func (r ServiceDataRepository) CreateKey(ctx context.Context, key servicedata.Key) (servicedata.Key, error)
- func (r ServiceDataRepository) Get(ctx context.Context, filter servicedata.Filter) ([]servicedata.ServiceData, error)
- func (r ServiceDataRepository) GetKeyByURN(ctx context.Context, URN string) (servicedata.Key, error)
- func (r ServiceDataRepository) Rollback(ctx context.Context, err error) error
- func (r ServiceDataRepository) Upsert(ctx context.Context, data servicedata.ServiceData) (servicedata.ServiceData, error)
- func (r ServiceDataRepository) WithTransaction(ctx context.Context) context.Context
- type User
- type UserMetadataKey
- type UserRepository
- func (r UserRepository) Create(ctx context.Context, usr user.User) (user.User, error)
- func (r UserRepository) CreateMetadataKey(ctx context.Context, key user.UserMetadataKey) (user.UserMetadataKey, error)
- func (r UserRepository) DeleteByEmail(ctx context.Context, email string, emailTag string) error
- func (r UserRepository) DeleteByID(ctx context.Context, id string, emailTag 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) List(ctx context.Context, flt user.Filter) ([]user.User, 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)
Constants ¶
View Source
const ( TABLE_ACTIONS = "actions" 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_METADATA = "metadata" TABLE_METADATA_KEYS = "metadata_keys" TABLE_ACTIVITY = "activities" TABLE_SERVICE_DATA = "servicedata" TABLE_SERVICE_DATA_KEYS = "servicedata_keys" TABLE_RULE_CONFIGS = "rule_configs" TABLE_RESOURCE_CONFIGS = "resource_configs" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActionRepository ¶
type ActionRepository struct {
// contains filtered or unexported fields
}
func NewActionRepository ¶
func NewActionRepository(dbc *db.Client) *ActionRepository
type ActivityRepository ¶ added in v0.6.15
type ActivityRepository struct {
// contains filtered or unexported fields
}
func NewActivityRepository ¶ added in v0.6.15
func NewActivityRepository(dbc *db.Client) *ActivityRepository
type Config ¶
type Config struct { Driver string `yaml:"driver" mapstructure:"driver"` URL string `yaml:"url" mapstructure:"url"` MaxIdleConns int `yaml:"max_idle_conns" mapstructure:"max_idle_conns" default:"10"` MaxOpenConns int `yaml:"max_open_conns" mapstructure:"max_open_conns" default:"10"` ConnMaxLifeTime time.Duration `yaml:"conn_max_life_time" mapstructure:"conn_max_life_time" default:"300s"` MaxQueryTimeout time.Duration `yaml:"max_query_timeout" mapstructure:"max_query_timeout" default:"1s"` }
type GroupRepository ¶
type GroupRepository struct {
// contains filtered or unexported fields
}
func NewGroupRepository ¶
func NewGroupRepository(dbc *db.Client) *GroupRepository
func (GroupRepository) ListGroupRelations ¶
func (r GroupRepository) ListGroupRelations(ctx context.Context, objectId string, subject_type string, role string) ([]relation.RelationV2, error)
func (GroupRepository) ListUserGroups ¶
func (GroupRepository) UpdateByID ¶
func (GroupRepository) UpdateBySlug ¶
type Key ¶ added in v0.6.20
type Key struct { ID string `db:"id"` URN string `db:"urn"` ProjectID string `db:"project_id"` Name string `db:"name"` Description string `db:"description"` ResourceID string `db:"resource_id"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt sql.NullTime `db:"deleted_at"` }
type NamespaceRepository ¶
type NamespaceRepository struct {
// contains filtered or unexported fields
}
func NewNamespaceRepository ¶
func NewNamespaceRepository(dbc *db.Client) *NamespaceRepository
type Organization ¶
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) GetByID ¶
func (r OrganizationRepository) GetByID(ctx context.Context, id string) (organization.Organization, error)
func (OrganizationRepository) GetBySlug ¶
func (r OrganizationRepository) GetBySlug(ctx context.Context, slug string) (organization.Organization, error)
func (OrganizationRepository) List ¶
func (r OrganizationRepository) List(ctx context.Context) ([]organization.Organization, error)
func (OrganizationRepository) ListAdminsByOrgID ¶
func (OrganizationRepository) UpdateByID ¶
func (r OrganizationRepository) UpdateByID(ctx context.Context, org organization.Organization) (organization.Organization, error)
func (OrganizationRepository) UpdateBySlug ¶
func (r OrganizationRepository) UpdateBySlug(ctx context.Context, org organization.Organization) (organization.Organization, error)
type Policy ¶
type Policy struct { ID string `db:"id"` Role Role `db:"role"` RoleID string `db:"role_id"` Namespace Namespace `db:"namespace"` NamespaceID string `db:"namespace_id"` Action Action `db:"action"` ActionID sql.NullString `db:"action_id"` 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"` NamespaceID string `db:"namespace_id"` ActionID sql.NullString `db:"action_id"` }
type PolicyRepository ¶
type PolicyRepository struct {
// contains filtered or unexported fields
}
func NewPolicyRepository ¶
func NewPolicyRepository(dbc *db.Client) *PolicyRepository
type ProjectRepository ¶
type ProjectRepository struct {
// contains filtered or unexported fields
}
func NewProjectRepository ¶
func NewProjectRepository(dbc *db.Client) *ProjectRepository
func (ProjectRepository) ListAdmins ¶
func (ProjectRepository) UpdateByID ¶
func (ProjectRepository) UpdateBySlug ¶
type Relation ¶
type Relation struct { ID string `db:"id"` SubjectNamespaceID string `db:"subject_namespace_id"` SubjectNamespace Namespace `db:"subject_namespace"` SubjectID string `db:"subject_id"` ObjectNamespaceID string `db:"object_namespace_id"` ObjectNamespace Namespace `db:"object_namespace"` ObjectID string `db:"object_id"` RoleID string `db:"role_id"` Role Role `db:"role"` 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) Create ¶
func (r RelationRepository) Create(ctx context.Context, relationToCreate relation.RelationV2) (relation.RelationV2, error)
func (RelationRepository) DeleteByID ¶
func (r RelationRepository) DeleteByID(ctx context.Context, id string) error
func (RelationRepository) Get ¶
func (r RelationRepository) Get(ctx context.Context, id string) (relation.RelationV2, error)
func (RelationRepository) GetByFields ¶
func (r RelationRepository) GetByFields(ctx context.Context, rel relation.RelationV2) (relation.RelationV2, error)
func (RelationRepository) List ¶
func (r RelationRepository) List(ctx context.Context) ([]relation.RelationV2, error)
type Resource ¶
type Resource struct { ID string `db:"id"` URN string `db:"urn"` Name string `db:"name"` ProjectID string `db:"project_id"` Project Project `db:"project"` OrganizationID string `db:"org_id"` Organization Organization `db:"organization"` NamespaceID string `db:"namespace_id"` Namespace Namespace `db:"namespace"` User User `db:"user"` UserID sql.NullString `db:"user_id"` 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"` Name string `db:"name"` ProjectID string `db:"project_id"` OrganizationID string `db:"org_id"` NamespaceID string `db:"namespace_id"` UserID sql.NullString `db:"user_id"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` }
type ResourceConfig ¶ added in v0.6.34
type ResourceRepository ¶
type ResourceRepository struct {
// contains filtered or unexported fields
}
func NewResourceRepository ¶
func NewResourceRepository(dbc *db.Client) *ResourceRepository
func (*ResourceRepository) Commit ¶ added in v0.6.34
func (r *ResourceRepository) Commit(ctx context.Context) error
func (ResourceRepository) GetByNamespace ¶
func (ResourceRepository) GetSchema ¶ added in v0.6.34
func (r ResourceRepository) GetSchema(ctx context.Context) (schema.NamespaceConfigMapType, error)
func (*ResourceRepository) Rollback ¶ added in v0.6.34
func (r *ResourceRepository) Rollback(ctx context.Context, err error) error
func (ResourceRepository) UpsertConfig ¶ added in v0.6.34
func (r ResourceRepository) UpsertConfig(ctx context.Context, name string, config schema.NamespaceConfigMapType) (schema.Config, error)
func (*ResourceRepository) WithTransaction ¶ added in v0.6.34
func (r *ResourceRepository) WithTransaction(ctx context.Context) context.Context
type RoleRepository ¶
type RoleRepository struct {
// contains filtered or unexported fields
}
func NewRoleRepository ¶
func NewRoleRepository(dbc *db.Client) *RoleRepository
type RuleConfig ¶ added in v0.6.34
type RuleRepository ¶ added in v0.6.34
type RuleRepository struct {
// contains filtered or unexported fields
}
func NewRuleRepository ¶ added in v0.6.34
func NewRuleRepository(dbc *db.Client) *RuleRepository
func (*RuleRepository) Commit ¶ added in v0.6.34
func (r *RuleRepository) Commit(ctx context.Context) error
func (*RuleRepository) InitCache ¶ added in v0.6.34
func (r *RuleRepository) InitCache(ctx context.Context) error
func (*RuleRepository) Rollback ¶ added in v0.6.34
func (r *RuleRepository) Rollback(ctx context.Context, err error) error
func (*RuleRepository) WithTransaction ¶ added in v0.6.34
func (r *RuleRepository) WithTransaction(ctx context.Context) context.Context
type ServiceData ¶ added in v0.6.22
type ServiceDataRepository ¶ added in v0.6.20
type ServiceDataRepository struct {
// contains filtered or unexported fields
}
func NewServiceDataRepository ¶ added in v0.6.20
func NewServiceDataRepository(dbc *db.Client) *ServiceDataRepository
func (ServiceDataRepository) Commit ¶ added in v0.6.20
func (r ServiceDataRepository) Commit(ctx context.Context) error
func (ServiceDataRepository) CreateKey ¶ added in v0.6.20
func (r ServiceDataRepository) CreateKey(ctx context.Context, key servicedata.Key) (servicedata.Key, error)
func (ServiceDataRepository) Get ¶ added in v0.6.22
func (r ServiceDataRepository) Get(ctx context.Context, filter servicedata.Filter) ([]servicedata.ServiceData, error)
func (ServiceDataRepository) GetKeyByURN ¶ added in v0.6.22
func (r ServiceDataRepository) GetKeyByURN(ctx context.Context, URN string) (servicedata.Key, error)
func (ServiceDataRepository) Rollback ¶ added in v0.6.20
func (r ServiceDataRepository) Rollback(ctx context.Context, err error) error
func (ServiceDataRepository) Upsert ¶ added in v0.6.22
func (r ServiceDataRepository) Upsert(ctx context.Context, data servicedata.ServiceData) (servicedata.ServiceData, error)
func (ServiceDataRepository) WithTransaction ¶ added in v0.6.20
func (r ServiceDataRepository) WithTransaction(ctx context.Context) context.Context
type UserMetadataKey ¶
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
func NewUserRepository ¶
func NewUserRepository(dbc *db.Client) *UserRepository
func (UserRepository) CreateMetadataKey ¶
func (r UserRepository) CreateMetadataKey(ctx context.Context, key user.UserMetadataKey) (user.UserMetadataKey, error)
func (UserRepository) DeleteByEmail ¶ added in v0.6.35
func (UserRepository) DeleteByID ¶ added in v0.6.35
func (UserRepository) GetByEmail ¶
func (UserRepository) UpdateByEmail ¶
func (UserRepository) UpdateByID ¶
Source Files ¶
- action.go
- action_repository.go
- activity_repository.go
- config.go
- errors.go
- group.go
- group_repository.go
- namespace.go
- namespace_repository.go
- organization.go
- organization_repository.go
- policy.go
- policy_repository.go
- postgres.go
- project.go
- project_repository.go
- relation.go
- relation_repository.go
- resource.go
- resource_repository.go
- role.go
- role_repository.go
- rule.go
- rule_repository.go
- servicedata.go
- servicedata_repository.go
- user.go
- user_repository.go
Click to show internal directories.
Click to hide internal directories.