Documentation ¶
Index ¶
- Variables
- func AddIdentity(ctx context.Context, identity *domain.Identity) error
- func AddNamespace(ctx context.Context, namespace *domain.Namespace) error
- func AddRole(ctx context.Context, role *domain.Role) error
- func AddRule(ctx context.Context, rule *domain.Rule) error
- func AddSession(ctx context.Context, session *domain.Session) error
- func AddUser(ctx context.Context, user *domain.User) error
- func GetIdentity(ctx context.Context, identityID uint) (*domain.Identity, error)
- func GetIdentityByName(ctx context.Context, namespace, name string) (*domain.Identity, error)
- func GetIdentityByUserPass(ctx context.Context, namespace string, username string, password string) (*domain.Identity, error)
- func GetNamespace(ctx context.Context, namespaceID uint) (*domain.Namespace, error)
- func GetNamespaceByName(ctx context.Context, name string) (*domain.Namespace, error)
- func GetNamespaceFromIdentity(ctx context.Context, identityId uint) (*domain.Namespace, error)
- func GetRole(ctx context.Context, roleID uint) (*domain.Role, error)
- func GetRoleByName(ctx context.Context, namespace string, name string) (*domain.Role, error)
- func GetRule(ctx context.Context, ruleID uint) (*domain.Rule, error)
- func GetRuleByName(ctx context.Context, namespace string, name string) (*domain.Rule, error)
- func GetSession(ctx context.Context, sessionID uint) (*domain.Session, error)
- func GetSessionFromIdentity(ctx context.Context, identityID uint) (*domain.Session, error)
- func GetSoidConfig(ctx context.Context) (*domain.SOIDConfig, error)
- func GetUser(ctx context.Context, userID uint) (*domain.User, error)
- func GetUserByName(ctx context.Context, namespace string, name string) (*domain.User, error)
- func GetUserFromIdentity(ctx context.Context, identityId uint) (*domain.User, error)
- func InitializeDefaultRepo(cfgFile string) error
- func RemoveIdentity(ctx context.Context, identityID uint) error
- func RemoveNamespace(ctx context.Context, namespaceID uint) error
- func RemoveRole(ctx context.Context, roleID uint) error
- func RemoveRule(ctx context.Context, ruleID uint) error
- func RemoveSession(ctx context.Context, sessionID uint) error
- func RemoveUser(ctx context.Context, userID uint) error
- func SetSoidConfig(ctx context.Context, cfg *domain.SOIDConfig) error
- func UpdateIdentity(ctx context.Context, identity *domain.Identity) error
- func UpdateNamespace(ctx context.Context, namespace *domain.Namespace) error
- func UpdateRole(ctx context.Context, role *domain.Role) error
- func UpdateRule(ctx context.Context, rule *domain.Rule) error
- func UpdateSession(ctx context.Context, session *domain.Session) error
- func UpdateUser(ctx context.Context, user *domain.User) error
- type FileSoidConfigRepo
- type IdentityRepo
- type ListIdentitiesResult
- type ListNamespacesResult
- type ListRolesResult
- type ListRulesResult
- type ListSessionsResult
- type ListUsersResult
- type NamespaceRepo
- type Query
- type RoleRepo
- type RuleRepo
- type SOIDConfigRepo
- type SQLIdentityRepo
- func (r *SQLIdentityRepo) AddIdentity(ctx context.Context, identity *domain.Identity) error
- func (r *SQLIdentityRepo) GetIdentity(ctx context.Context, identityID uint) (*domain.Identity, error)
- func (r *SQLIdentityRepo) GetIdentityByName(ctx context.Context, namespace, name string) (*domain.Identity, error)
- func (r *SQLIdentityRepo) GetIdentityByUserPass(ctx context.Context, namespace string, username string, password string) (*domain.Identity, error)
- func (r *SQLIdentityRepo) ListIdentities(ctx context.Context, query string, queryParams []interface{}, orderBy string, ...) (*ListIdentitiesResult, error)
- func (r *SQLIdentityRepo) Migrate() error
- func (r *SQLIdentityRepo) RemoveIdentity(ctx context.Context, identityID uint) error
- func (r *SQLIdentityRepo) UpdateIdentity(ctx context.Context, identity *domain.Identity) error
- type SQLNamespaceRepo
- func (r *SQLNamespaceRepo) AddNamespace(ctx context.Context, namespace *domain.Namespace) error
- func (r *SQLNamespaceRepo) GetNamespace(ctx context.Context, namespaceID uint) (*domain.Namespace, error)
- func (r *SQLNamespaceRepo) GetNamespaceByName(ctx context.Context, name string) (*domain.Namespace, error)
- func (r *SQLNamespaceRepo) GetNamespaceFromIdentity(ctx context.Context, identityId uint) (*domain.Namespace, error)
- func (r *SQLNamespaceRepo) ListNamespaces(ctx context.Context, query string, queryParams []interface{}, orderBy string, ...) (*ListNamespacesResult, error)
- func (r *SQLNamespaceRepo) Migrate() error
- func (r *SQLNamespaceRepo) RemoveNamespace(ctx context.Context, namespaceID uint) error
- func (r *SQLNamespaceRepo) UpdateNamespace(ctx context.Context, namespace *domain.Namespace) error
- type SQLRepository
- func (r *SQLRepository) DB() *gorm.DB
- func (r *SQLRepository) Identities() IdentityRepo
- func (r *SQLRepository) Migrate() error
- func (r *SQLRepository) Namespaces() NamespaceRepo
- func (r *SQLRepository) Roles() RoleRepo
- func (r *SQLRepository) Rules() RuleRepo
- func (r *SQLRepository) SOIDConfig() SOIDConfigRepo
- func (r *SQLRepository) Sessions() SessionRepo
- func (r *SQLRepository) Users() UserRepo
- type SQLRoleRepo
- func (r *SQLRoleRepo) AddRole(ctx context.Context, role *domain.Role) error
- func (r *SQLRoleRepo) GetRole(ctx context.Context, roleID uint) (*domain.Role, error)
- func (r *SQLRoleRepo) GetRoleByName(ctx context.Context, namespace string, name string) (*domain.Role, error)
- func (r *SQLRoleRepo) ListRoles(ctx context.Context, query string, queryParams []interface{}, orderBy string, ...) (*ListRolesResult, error)
- func (r *SQLRoleRepo) Migrate() error
- func (r *SQLRoleRepo) RemoveRole(ctx context.Context, roleID uint) error
- func (r *SQLRoleRepo) UpdateRole(ctx context.Context, role *domain.Role) error
- type SQLRuleRepo
- func (r *SQLRuleRepo) AddRule(ctx context.Context, rule *domain.Rule) error
- func (r *SQLRuleRepo) FindRulesForName(ctx context.Context, namespace string, name string) ([]*domain.Rule, error)
- func (r *SQLRuleRepo) GetRule(ctx context.Context, ruleID uint) (*domain.Rule, error)
- func (r *SQLRuleRepo) GetRuleByName(ctx context.Context, namespace string, name string) (*domain.Rule, error)
- func (r *SQLRuleRepo) ListRules(ctx context.Context, query string, queryParams []interface{}, orderBy string, ...) (*ListRulesResult, error)
- func (r *SQLRuleRepo) Migrate() error
- func (r *SQLRuleRepo) RemoveRule(ctx context.Context, ruleID uint) error
- func (r *SQLRuleRepo) UpdateRule(ctx context.Context, rule *domain.Rule) error
- type SQLSessionRepo
- func (r *SQLSessionRepo) AddSession(ctx context.Context, session *domain.Session) error
- func (r *SQLSessionRepo) GetSession(ctx context.Context, sessionID uint) (*domain.Session, error)
- func (r *SQLSessionRepo) GetSessionFromIdentity(ctx context.Context, identityId uint) (*domain.Session, error)
- func (r *SQLSessionRepo) ListSessions(ctx context.Context, query string, queryParams []interface{}, orderBy string, ...) (*ListSessionsResult, error)
- func (r *SQLSessionRepo) Migrate() error
- func (r *SQLSessionRepo) RemoveSession(ctx context.Context, sessionID uint) error
- func (r *SQLSessionRepo) UpdateSession(ctx context.Context, session *domain.Session) error
- type SQLUserRepo
- func (r *SQLUserRepo) AddUser(ctx context.Context, user *domain.User) error
- func (r *SQLUserRepo) GetUser(ctx context.Context, userID uint) (*domain.User, error)
- func (r *SQLUserRepo) GetUserByName(ctx context.Context, namespace, name string) (*domain.User, error)
- func (r *SQLUserRepo) GetUserFromIdentity(ctx context.Context, identityId uint) (*domain.User, error)
- func (r *SQLUserRepo) ListUsers(ctx context.Context, query string, queryParams []interface{}, orderBy string, ...) (*ListUsersResult, error)
- func (r *SQLUserRepo) Migrate() error
- func (r *SQLUserRepo) RemoveUser(ctx context.Context, userID uint) error
- func (r *SQLUserRepo) UpdateUser(ctx context.Context, user *domain.User) error
- type SessionRepo
- type UserRepo
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidConfig = errors.New("invalid config")
)
Functions ¶
func GetIdentityByName ¶
func GetIdentityByUserPass ¶
func GetNamespace ¶
func GetNamespaceByName ¶
func GetRoleByName ¶
func GetRuleByName ¶
func GetSessionFromIdentity ¶
func GetSoidConfig ¶
func GetSoidConfig(ctx context.Context) (*domain.SOIDConfig, error)
SOIDConfigRepo
func GetUserByName ¶
func GetUserFromIdentity ¶
func InitializeDefaultRepo ¶
func SetSoidConfig ¶
func SetSoidConfig(ctx context.Context, cfg *domain.SOIDConfig) error
Types ¶
type FileSoidConfigRepo ¶
type FileSoidConfigRepo struct {
// contains filtered or unexported fields
}
func (*FileSoidConfigRepo) GetSoidConfig ¶
func (r *FileSoidConfigRepo) GetSoidConfig(ctx context.Context) (*domain.SOIDConfig, error)
func (*FileSoidConfigRepo) SetSoidConfig ¶
func (r *FileSoidConfigRepo) SetSoidConfig(ctx context.Context, cfg *domain.SOIDConfig) error
type IdentityRepo ¶
type IdentityRepo interface { Migrate() error AddIdentity(ctx context.Context, identity *domain.Identity) error RemoveIdentity(ctx context.Context, identityID uint) error UpdateIdentity(ctx context.Context, identity *domain.Identity) error GetIdentity(ctx context.Context, identityID uint) (*domain.Identity, error) GetIdentityByName(ctx context.Context, namespace, name string) (*domain.Identity, error) ListIdentities(ctx context.Context, query string, queryParams []interface{}, orderBy string, pageSize int, page int, nextPageToken string, preload string) (*ListIdentitiesResult, error) GetIdentityByUserPass(ctx context.Context, namespace string, username string, password string) (*domain.Identity, error) }
func NewSQLIdentityRepo ¶
func NewSQLIdentityRepo(db *gorm.DB) IdentityRepo
type ListIdentitiesResult ¶
type ListNamespacesResult ¶
type ListRolesResult ¶
type ListRulesResult ¶
type ListSessionsResult ¶
type ListUsersResult ¶
type NamespaceRepo ¶
type NamespaceRepo interface { Migrate() error AddNamespace(ctx context.Context, namespace *domain.Namespace) error RemoveNamespace(ctx context.Context, namespaceID uint) error UpdateNamespace(ctx context.Context, namespace *domain.Namespace) error GetNamespace(ctx context.Context, namespaceID uint) (*domain.Namespace, error) GetNamespaceByName(ctx context.Context, name string) (*domain.Namespace, error) GetNamespaceFromIdentity(ctx context.Context, identityID uint) (*domain.Namespace, error) ListNamespaces(ctx context.Context, query string, queryParams []interface{}, orderBy string, pageSize int, nextPageToken string, preload string) (*ListNamespacesResult, error) }
func NewSQLNamespaceRepo ¶
func NewSQLNamespaceRepo(db *gorm.DB) NamespaceRepo
type Query ¶
type Query struct { Query string QueryParams []interface{} OrderBy string PageSize int Page int // contains filtered or unexported fields }
func (*Query) IsCompatibleWith ¶
type RoleRepo ¶
type RoleRepo interface { Migrate() error AddRole(ctx context.Context, role *domain.Role) error RemoveRole(ctx context.Context, roleID uint) error UpdateRole(ctx context.Context, role *domain.Role) error GetRole(ctx context.Context, roleID uint) (*domain.Role, error) GetRoleByName(ctx context.Context, namespace string, name string) (*domain.Role, error) ListRoles(ctx context.Context, query string, queryParams []interface{}, orderBy string, pageSize int, page int, nextPageToken string, preload string) (*ListRolesResult, error) }
type RuleRepo ¶
type RuleRepo interface { Migrate() error AddRule(ctx context.Context, rule *domain.Rule) error RemoveRule(ctx context.Context, ruleID uint) error UpdateRule(ctx context.Context, rule *domain.Rule) error GetRule(ctx context.Context, ruleID uint) (*domain.Rule, error) GetRuleByName(ctx context.Context, namespace string, name string) (*domain.Rule, error) FindRulesForName(ctx context.Context, namespace string, name string) ([]*domain.Rule, error) ListRules(ctx context.Context, query string, queryParams []interface{}, orderBy string, pageSize int, page int, nextPageToken string, preload string) (*ListRulesResult, error) }
func NewSQLRuleRepo ¶
type SOIDConfigRepo ¶
type SOIDConfigRepo interface { GetSoidConfig(ctx context.Context) (*domain.SOIDConfig, error) SetSoidConfig(ctx context.Context, cfg *domain.SOIDConfig) error }
func NewFileSoidConfigRepo ¶
func NewFileSoidConfigRepo(filePath string) (SOIDConfigRepo, error)
type SQLIdentityRepo ¶
type SQLIdentityRepo struct {
// contains filtered or unexported fields
}
func (*SQLIdentityRepo) AddIdentity ¶
func (*SQLIdentityRepo) GetIdentity ¶
func (*SQLIdentityRepo) GetIdentityByName ¶
func (*SQLIdentityRepo) GetIdentityByUserPass ¶
func (*SQLIdentityRepo) ListIdentities ¶
func (*SQLIdentityRepo) Migrate ¶
func (r *SQLIdentityRepo) Migrate() error
func (*SQLIdentityRepo) RemoveIdentity ¶
func (r *SQLIdentityRepo) RemoveIdentity(ctx context.Context, identityID uint) error
func (*SQLIdentityRepo) UpdateIdentity ¶
type SQLNamespaceRepo ¶
type SQLNamespaceRepo struct {
// contains filtered or unexported fields
}
func (*SQLNamespaceRepo) AddNamespace ¶
func (*SQLNamespaceRepo) GetNamespace ¶
func (*SQLNamespaceRepo) GetNamespaceByName ¶
func (*SQLNamespaceRepo) GetNamespaceFromIdentity ¶
func (*SQLNamespaceRepo) ListNamespaces ¶
func (r *SQLNamespaceRepo) ListNamespaces(ctx context.Context, query string, queryParams []interface{}, orderBy string, pageSize int, nextPageToken string, preload string) (*ListNamespacesResult, error)
func (*SQLNamespaceRepo) Migrate ¶
func (r *SQLNamespaceRepo) Migrate() error
func (*SQLNamespaceRepo) RemoveNamespace ¶
func (r *SQLNamespaceRepo) RemoveNamespace(ctx context.Context, namespaceID uint) error
func (*SQLNamespaceRepo) UpdateNamespace ¶
type SQLRepository ¶
type SQLRepository struct {
// contains filtered or unexported fields
}
func GetDefaultRepo ¶
func GetDefaultRepo() *SQLRepository
func NewSqlRepository ¶
func NewSqlRepository(soidCfgFile string) (*SQLRepository, error)
func (*SQLRepository) DB ¶
func (r *SQLRepository) DB() *gorm.DB
func (*SQLRepository) Identities ¶
func (r *SQLRepository) Identities() IdentityRepo
func (*SQLRepository) Migrate ¶
func (r *SQLRepository) Migrate() error
func (*SQLRepository) Namespaces ¶
func (r *SQLRepository) Namespaces() NamespaceRepo
func (*SQLRepository) Roles ¶
func (r *SQLRepository) Roles() RoleRepo
func (*SQLRepository) Rules ¶
func (r *SQLRepository) Rules() RuleRepo
func (*SQLRepository) SOIDConfig ¶
func (r *SQLRepository) SOIDConfig() SOIDConfigRepo
func (*SQLRepository) Sessions ¶
func (r *SQLRepository) Sessions() SessionRepo
func (*SQLRepository) Users ¶
func (r *SQLRepository) Users() UserRepo
type SQLRoleRepo ¶
type SQLRoleRepo struct {
// contains filtered or unexported fields
}
func NewSQLRoleRepo ¶
func NewSQLRoleRepo(db *gorm.DB) *SQLRoleRepo
func (*SQLRoleRepo) GetRoleByName ¶
func (*SQLRoleRepo) Migrate ¶
func (r *SQLRoleRepo) Migrate() error
func (*SQLRoleRepo) RemoveRole ¶
func (r *SQLRoleRepo) RemoveRole(ctx context.Context, roleID uint) error
func (*SQLRoleRepo) UpdateRole ¶
type SQLRuleRepo ¶
type SQLRuleRepo struct {
// contains filtered or unexported fields
}
func (*SQLRuleRepo) FindRulesForName ¶
func (r *SQLRuleRepo) FindRulesForName(ctx context.Context, namespace string, name string) ([]*domain.Rule, error)
Find all rules that apply for the namespace/name combination
func (*SQLRuleRepo) GetRuleByName ¶
func (*SQLRuleRepo) Migrate ¶
func (r *SQLRuleRepo) Migrate() error
func (*SQLRuleRepo) RemoveRule ¶
func (r *SQLRuleRepo) RemoveRule(ctx context.Context, ruleID uint) error
func (*SQLRuleRepo) UpdateRule ¶
type SQLSessionRepo ¶
type SQLSessionRepo struct {
// contains filtered or unexported fields
}
func (*SQLSessionRepo) AddSession ¶
func (*SQLSessionRepo) GetSession ¶
func (*SQLSessionRepo) GetSessionFromIdentity ¶
func (*SQLSessionRepo) ListSessions ¶
func (*SQLSessionRepo) Migrate ¶
func (r *SQLSessionRepo) Migrate() error
func (*SQLSessionRepo) RemoveSession ¶
func (r *SQLSessionRepo) RemoveSession(ctx context.Context, sessionID uint) error
func (*SQLSessionRepo) UpdateSession ¶
type SQLUserRepo ¶
type SQLUserRepo struct {
// contains filtered or unexported fields
}
func (*SQLUserRepo) GetUserByName ¶
func (*SQLUserRepo) GetUserFromIdentity ¶
func (*SQLUserRepo) Migrate ¶
func (r *SQLUserRepo) Migrate() error
func (*SQLUserRepo) RemoveUser ¶
func (r *SQLUserRepo) RemoveUser(ctx context.Context, userID uint) error
func (*SQLUserRepo) UpdateUser ¶
type SessionRepo ¶
type SessionRepo interface { Migrate() error AddSession(ctx context.Context, session *domain.Session) error RemoveSession(ctx context.Context, sessionID uint) error UpdateSession(ctx context.Context, session *domain.Session) error GetSession(ctx context.Context, sessionID uint) (*domain.Session, error) GetSessionFromIdentity(ctx context.Context, identityID uint) (*domain.Session, error) ListSessions(ctx context.Context, query string, queryParams []interface{}, orderBy string, pageSize int, page int, nextPageToken string, preload string) (*ListSessionsResult, error) }
func NewSQLSessionRepo ¶
func NewSQLSessionRepo(db *gorm.DB) SessionRepo
type UserRepo ¶
type UserRepo interface { Migrate() error AddUser(ctx context.Context, user *domain.User) error RemoveUser(ctx context.Context, userID uint) error UpdateUser(ctx context.Context, user *domain.User) error GetUser(ctx context.Context, userID uint) (*domain.User, error) GetUserByName(ctx context.Context, namespace, name string) (*domain.User, error) ListUsers(ctx context.Context, query string, queryParams []interface{}, orderBy string, pageSize int, page int, nextPageToken string, preload string) (*ListUsersResult, error) GetUserFromIdentity(ctx context.Context, identityID uint) (*domain.User, error) }
func NewSQLUserRepo ¶
Click to show internal directories.
Click to hide internal directories.