Documentation ¶
Index ¶
- Constants
- type CommonResourceIface
- type Entity
- func (n *Entity) GetCluster() string
- func (n *Entity) GetEnvironmentID() uint
- func (n *Entity) GetID() uint
- func (n *Entity) GetKind() string
- func (n *Entity) GetName() string
- func (n *Entity) GetNamespace() string
- func (n *Entity) GetOwners() []CommonResourceIface
- func (n *Entity) GetProjectID() uint
- func (n *Entity) GetTenantID() uint
- func (n *Entity) GetVirtualSpaceID() uint
- func (n *Entity) MarshalBinary() ([]byte, error)
- func (n *Entity) UnmarshalBinary(data []byte) error
- type ModelCache
- func (t *ModelCache) BuildCacheIfNotExist() error
- func (t *ModelCache) DelEnvironment(pid, eid uint, cluster, namespace string) error
- func (t *ModelCache) DelProject(tid, pid uint) error
- func (t *ModelCache) DelTenant(tid uint) error
- func (t *ModelCache) DelVirtualSpace(vid uint) error
- func (c *ModelCache) FindEnvironment(cluster, namespace string) CommonResourceIface
- func (c *ModelCache) FindParents(kind string, id uint) []CommonResourceIface
- func (c *ModelCache) FindResource(kind string, id uint) CommonResourceIface
- func (c *ModelCache) FlushUserAuthority(user models.CommonUserIface) *UserAuthority
- func (c *ModelCache) GetUserAuthority(user models.CommonUserIface) *UserAuthority
- func (t *ModelCache) UpsertEnvironment(pid, eid uint, name, cluster, namespace string) error
- func (t *ModelCache) UpsertProject(tid, pid uint, name string) error
- func (t *ModelCache) UpsertTenant(tid uint, name string) error
- func (t *ModelCache) UpsertVirtualSpace(vid uint, name string) error
- type UserAuthority
- func (auth *UserAuthority) GetResourceRole(kind string, id uint) string
- func (auth *UserAuthority) IsAnyTenantAdmin() bool
- func (auth *UserAuthority) IsEnvironmentOperator(envid uint) bool
- func (auth *UserAuthority) IsEnvironmentReader(envid uint) bool
- func (auth *UserAuthority) IsProjectAdmin(projectid uint) bool
- func (auth *UserAuthority) IsProjectDev(projectid uint) bool
- func (auth *UserAuthority) IsProjectOps(projectid uint) bool
- func (auth *UserAuthority) IsProjectTest(projectid uint) bool
- func (auth *UserAuthority) IsSystemAdmin() bool
- func (auth *UserAuthority) IsTenantAdmin(tenantid uint) bool
- func (auth *UserAuthority) IsTenantMember(tenantid uint) bool
- func (auth *UserAuthority) IsVirtualSpaceAdmin(vsid uint) bool
- func (auth *UserAuthority) IsVirtualSpaceMember(vsid uint) bool
- func (auth *UserAuthority) MarshalBinary() ([]byte, error)
- func (auth *UserAuthority) UnmarshalBinary(data []byte) error
- type UserResource
Constants ¶
View Source
const FindParentScript = `` /* 655-byte string literal not displayed */
View Source
const (
// 全局模型结构缓存
ModelCacheKey = "_model_cache"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonResourceIface ¶
type Entity ¶
type Entity struct { Name string `json:",omitempty"` Kind string `json:",omitempty"` ID uint `json:",omitempty"` Namespace string `json:",omitempty"` Cluster string `json:",omitempty"` Owner []*Entity `json:",omitempty"` Children []string `json:",omitempty"` }
func (*Entity) GetCluster ¶
func (*Entity) GetEnvironmentID ¶
func (*Entity) GetNamespace ¶
func (*Entity) GetOwners ¶
func (n *Entity) GetOwners() []CommonResourceIface
func (*Entity) GetProjectID ¶
func (*Entity) GetTenantID ¶
func (*Entity) GetVirtualSpaceID ¶
func (*Entity) MarshalBinary ¶
func (*Entity) UnmarshalBinary ¶
type ModelCache ¶
func (*ModelCache) BuildCacheIfNotExist ¶
func (t *ModelCache) BuildCacheIfNotExist() error
func (*ModelCache) DelEnvironment ¶
func (t *ModelCache) DelEnvironment(pid, eid uint, cluster, namespace string) error
func (*ModelCache) DelProject ¶
func (t *ModelCache) DelProject(tid, pid uint) error
func (*ModelCache) DelTenant ¶
func (t *ModelCache) DelTenant(tid uint) error
func (*ModelCache) DelVirtualSpace ¶
func (t *ModelCache) DelVirtualSpace(vid uint) error
func (*ModelCache) FindEnvironment ¶
func (c *ModelCache) FindEnvironment(cluster, namespace string) CommonResourceIface
func (*ModelCache) FindParents ¶
func (c *ModelCache) FindParents(kind string, id uint) []CommonResourceIface
func (*ModelCache) FindResource ¶
func (c *ModelCache) FindResource(kind string, id uint) CommonResourceIface
func (*ModelCache) FlushUserAuthority ¶
func (c *ModelCache) FlushUserAuthority(user models.CommonUserIface) *UserAuthority
func (*ModelCache) GetUserAuthority ¶
func (c *ModelCache) GetUserAuthority(user models.CommonUserIface) *UserAuthority
func (*ModelCache) UpsertEnvironment ¶
func (t *ModelCache) UpsertEnvironment(pid, eid uint, name, cluster, namespace string) error
func (*ModelCache) UpsertProject ¶
func (t *ModelCache) UpsertProject(tid, pid uint, name string) error
func (*ModelCache) UpsertTenant ¶
func (t *ModelCache) UpsertTenant(tid uint, name string) error
func (*ModelCache) UpsertVirtualSpace ¶
func (t *ModelCache) UpsertVirtualSpace(vid uint, name string) error
type UserAuthority ¶
type UserAuthority struct { SystemRole string `json:"systemRole"` Tenants []*UserResource `json:"tenant"` Projects []*UserResource `json:"projects"` Environments []*UserResource `json:"environments"` VirtualSpaces []*UserResource `json:"virtualSpaces"` }
UserAuthority 用户权限
func (*UserAuthority) GetResourceRole ¶
func (auth *UserAuthority) GetResourceRole(kind string, id uint) string
func (*UserAuthority) IsAnyTenantAdmin ¶
func (auth *UserAuthority) IsAnyTenantAdmin() bool
func (*UserAuthority) IsEnvironmentOperator ¶
func (auth *UserAuthority) IsEnvironmentOperator(envid uint) bool
func (*UserAuthority) IsEnvironmentReader ¶
func (auth *UserAuthority) IsEnvironmentReader(envid uint) bool
func (*UserAuthority) IsProjectAdmin ¶
func (auth *UserAuthority) IsProjectAdmin(projectid uint) bool
func (*UserAuthority) IsProjectDev ¶
func (auth *UserAuthority) IsProjectDev(projectid uint) bool
func (*UserAuthority) IsProjectOps ¶
func (auth *UserAuthority) IsProjectOps(projectid uint) bool
func (*UserAuthority) IsProjectTest ¶
func (auth *UserAuthority) IsProjectTest(projectid uint) bool
func (*UserAuthority) IsSystemAdmin ¶
func (auth *UserAuthority) IsSystemAdmin() bool
func (*UserAuthority) IsTenantAdmin ¶
func (auth *UserAuthority) IsTenantAdmin(tenantid uint) bool
func (*UserAuthority) IsTenantMember ¶
func (auth *UserAuthority) IsTenantMember(tenantid uint) bool
func (*UserAuthority) IsVirtualSpaceAdmin ¶
func (auth *UserAuthority) IsVirtualSpaceAdmin(vsid uint) bool
func (*UserAuthority) IsVirtualSpaceMember ¶
func (auth *UserAuthority) IsVirtualSpaceMember(vsid uint) bool
func (*UserAuthority) MarshalBinary ¶
func (auth *UserAuthority) MarshalBinary() ([]byte, error)
func (*UserAuthority) UnmarshalBinary ¶
func (auth *UserAuthority) UnmarshalBinary(data []byte) error
Click to show internal directories.
Click to hide internal directories.