Documentation ¶
Index ¶
- func InitDb(datasourcename string, idleConns string, maxOpenConns string, connTTL string) (*gorm.DB, error)
- type Group
- type GroupPolicyRelation
- type GroupUserRelation
- type Policy
- type PostgresRepo
- func (g PostgresRepo) AddGroup(group api.Group) (*api.Group, error)
- func (g PostgresRepo) AddMember(userID string, groupID string) error
- func (p PostgresRepo) AddPolicy(policy api.Policy) (*api.Policy, error)
- func (u PostgresRepo) AddUser(user api.User) (*api.User, error)
- func (g PostgresRepo) AttachPolicy(groupID string, policyID string) error
- func (g PostgresRepo) DetachPolicy(groupID string, policyID string) error
- func (p PostgresRepo) GetAttachedGroups(policyID string, filter *api.Filter) ([]api.Group, int, error)
- func (g PostgresRepo) GetAttachedPolicies(groupID string, filter *api.Filter) ([]api.Policy, int, error)
- func (g PostgresRepo) GetGroupById(id string) (*api.Group, error)
- func (g PostgresRepo) GetGroupByName(org string, name string) (*api.Group, error)
- func (g PostgresRepo) GetGroupMembers(groupID string, filter *api.Filter) ([]api.User, int, error)
- func (u PostgresRepo) GetGroupsByUserID(id string, filter *api.Filter) ([]api.Group, int, error)
- func (g PostgresRepo) GetGroupsFiltered(org string, filter *api.Filter) ([]api.Group, int, error)
- func (p PostgresRepo) GetPoliciesFiltered(org string, filter *api.Filter) ([]api.Policy, int, error)
- func (p PostgresRepo) GetPolicyById(id string) (*api.Policy, error)
- func (p PostgresRepo) GetPolicyByName(org string, name string) (*api.Policy, error)
- func (u PostgresRepo) GetUserByExternalID(id string) (*api.User, error)
- func (u PostgresRepo) GetUserByID(id string) (*api.User, error)
- func (u PostgresRepo) GetUsersFiltered(filter *api.Filter) ([]api.User, int, error)
- func (g PostgresRepo) IsAttachedToGroup(groupID string, policyID string) (bool, error)
- func (g PostgresRepo) IsMemberOfGroup(userID string, groupID string) (bool, error)
- func (g PostgresRepo) RemoveGroup(id string) error
- func (g PostgresRepo) RemoveMember(userID string, groupID string) error
- func (p PostgresRepo) RemovePolicy(id string) error
- func (u PostgresRepo) RemoveUser(id string) error
- func (g PostgresRepo) UpdateGroup(group api.Group, newName string, newPath string, urn string) (*api.Group, error)
- func (p PostgresRepo) UpdatePolicy(policy api.Policy, name string, path string, urn string, ...) (*api.Policy, error)
- func (u PostgresRepo) UpdateUser(user api.User, newPath string, newUrn string) (*api.User, error)
- type Statement
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Group ¶
type Group struct { ID string `gorm:"primary_key"` Name string `gorm:"not null"` Path string `gorm:"not null"` Org string `gorm:"not null"` CreateAt int64 `gorm:"not null"` Urn string `gorm:"not null;unique"` }
Group table
type GroupPolicyRelation ¶
type GroupPolicyRelation struct { GroupID string `gorm:"primary_key"` PolicyID string `gorm:"primary_key"` }
Group Policy table
func (GroupPolicyRelation) TableName ¶
func (GroupPolicyRelation) TableName() string
GroupPolicyRelation's table name
type GroupUserRelation ¶
type GroupUserRelation struct { UserID string `gorm:"primary_key"` GroupID string `gorm:"primary_key"` }
Group-Users Relationship
func (GroupUserRelation) TableName ¶
func (GroupUserRelation) TableName() string
GroupUserRelation's table name
type Policy ¶
type Policy struct { ID string `gorm:"primary_key"` Name string `gorm:"not null"` Path string `gorm:"not null"` Org string `gorm:"not null"` CreateAt int64 `gorm:"not null"` Urn string `gorm:"not null;unique"` }
Policy table
type PostgresRepo ¶
func (PostgresRepo) AddMember ¶
func (g PostgresRepo) AddMember(userID string, groupID string) error
func (PostgresRepo) AttachPolicy ¶
func (g PostgresRepo) AttachPolicy(groupID string, policyID string) error
func (PostgresRepo) DetachPolicy ¶
func (g PostgresRepo) DetachPolicy(groupID string, policyID string) error
func (PostgresRepo) GetAttachedGroups ¶
func (PostgresRepo) GetAttachedPolicies ¶
func (PostgresRepo) GetGroupById ¶
func (g PostgresRepo) GetGroupById(id string) (*api.Group, error)
func (PostgresRepo) GetGroupByName ¶
func (PostgresRepo) GetGroupMembers ¶
func (PostgresRepo) GetGroupsByUserID ¶
func (PostgresRepo) GetGroupsFiltered ¶
func (PostgresRepo) GetPoliciesFiltered ¶
func (PostgresRepo) GetPolicyById ¶
func (p PostgresRepo) GetPolicyById(id string) (*api.Policy, error)
func (PostgresRepo) GetPolicyByName ¶
func (PostgresRepo) GetUserByExternalID ¶
func (u PostgresRepo) GetUserByExternalID(id string) (*api.User, error)
func (PostgresRepo) GetUserByID ¶
func (u PostgresRepo) GetUserByID(id string) (*api.User, error)
func (PostgresRepo) GetUsersFiltered ¶
func (PostgresRepo) IsAttachedToGroup ¶
func (g PostgresRepo) IsAttachedToGroup(groupID string, policyID string) (bool, error)
func (PostgresRepo) IsMemberOfGroup ¶
func (g PostgresRepo) IsMemberOfGroup(userID string, groupID string) (bool, error)
func (PostgresRepo) RemoveGroup ¶
func (g PostgresRepo) RemoveGroup(id string) error
func (PostgresRepo) RemoveMember ¶
func (g PostgresRepo) RemoveMember(userID string, groupID string) error
func (PostgresRepo) RemovePolicy ¶
func (p PostgresRepo) RemovePolicy(id string) error
func (PostgresRepo) RemoveUser ¶
func (u PostgresRepo) RemoveUser(id string) error
func (PostgresRepo) UpdateGroup ¶
func (PostgresRepo) UpdatePolicy ¶
func (PostgresRepo) UpdateUser ¶
Click to show internal directories.
Click to hide internal directories.