Documentation
¶
Index ¶
- Constants
- type CollaborationInstance
- type CollaborationMode
- type CollaborationType
- type Connector
- type MatchAttribute
- type Model
- type ProductCIItem
- type ProductCMItem
- type Role
- type RoleBinding
- type RoleRef
- type Rule
- type Subject
- type SubjectKind
- type User
- type UserLogin
- type UserSetting
- type WorkflowCIItem
- type WorkflowCMItem
Constants ¶
const ( MethodAll = "*" KindResource = "resource" UserKind SubjectKind = "user" GroupKind SubjectKind = "group" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CollaborationInstance ¶ added in v1.9.9
type CollaborationInstance struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
ProjectName string `bson:"project_name" json:"project_name"`
CreateTime int64 `bson:"create_time" json:"create_time"`
UpdateTime int64 `bson:"update_time" json:"update_time"`
LastVisitTime int64 `bson:"last_visit_time" json:"last_visit_time"`
CollaborationName string `bson:"collaboration_name" json:"collaboration_name"`
RecycleDay int64 `bson:"recycle_day" json:"recycle_day"`
Revision int64 `bson:"revision" json:"revision"`
UserUID string `bson:"user_uid" json:"user_uid"`
PolicyName string `bson:"policy_name" json:"policy_name"`
Workflows []WorkflowCIItem `bson:"workflows" json:"workflows"`
Products []ProductCIItem `bson:"products" json:"products"`
}
func (CollaborationInstance) TableName ¶ added in v1.9.9
func (CollaborationInstance) TableName() string
type CollaborationMode ¶ added in v1.9.9
type CollaborationMode struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
//foreign key:template_product/product_name
ProjectName string `bson:"project_name" json:"project_name"`
CreateTime int64 `bson:"create_time" json:"create_time"`
UpdateTime int64 `bson:"update_time" json:"update_time"`
Name string `bson:"name" json:"name"`
Revision int64 `bson:"revision" json:"revision"`
Members []string `bson:"members" json:"members"`
IsDeleted bool `bson:"is_deleted" json:"is_deleted"`
DeployType string `bson:"deploy_type" json:"deploy_type"`
RecycleDay int64 `bson:"recycle_day" json:"recycle_day"`
Workflows []WorkflowCMItem `bson:"workflows" json:"workflows" `
Products []ProductCMItem `bson:"products" json:"products"`
CreateBy string `bson:"create_by" json:"create_by"`
UpdateBy string `bson:"update_by" json:"update_by"`
}
func (CollaborationMode) TableName ¶ added in v1.9.9
func (CollaborationMode) TableName() string
type CollaborationType ¶ added in v1.9.9
type CollaborationType string
const ( CollaborationNew CollaborationType = "new" )
type Connector ¶ added in v1.9.9
type MatchAttribute ¶ added in v1.9.9
type ProductCIItem ¶ added in v1.9.9
type ProductCIItem struct {
Name string `bson:"name" json:"name"`
BaseName string `bson:"base_name" json:"base_name"`
CollaborationType CollaborationType `bson:"collaboration_type" json:"collaboration_type"`
RecycleDay int64 `bson:"recycle_day" json:"recycle_day"`
Verbs []string `bson:"verbs" json:"verbs"`
}
type ProductCMItem ¶ added in v1.9.9
type ProductCMItem struct {
Name string `bson:"name" json:"name"`
CollaborationType CollaborationType `bson:"collaboration_type" json:"collaboration_type"`
RecycleDay int64 `bson:"recycle_day" json:"recycle_day"`
Verbs []string `bson:"verbs" json:"verbs"`
}
type Role ¶ added in v1.9.9
type Role struct {
Name string `bson:"name" json:"name"`
Desc string `bson:"desc" json:"desc"`
Namespace string `bson:"namespace" json:"namespace"`
Rules []*Rule `bson:"rules" json:"rules"`
Type setting.ResourceType `bson:"type" json:"type"`
}
Role is a namespaced or cluster scoped, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. for a cluster scoped Role, namespace is empty.
type RoleBinding ¶ added in v1.9.9
type RoleBinding struct {
Name string `bson:"name" json:"name"`
Namespace string `bson:"namespace" json:"namespace"`
// Subjects holds references to the objects the role applies to.
Subjects []*Subject `bson:"subjects" json:"subjects"`
// RoleRef can reference a namespaced or cluster scoped Role.
RoleRef *RoleRef `bson:"role_ref" json:"roleRef"`
}
RoleBinding references a role, but does not contain it. It adds who information via Subjects. RoleBindings in a given namespace only have effect in that namespace. for a cluster scoped RoleBinding, namespace is empty.
func (RoleBinding) TableName ¶ added in v1.9.9
func (RoleBinding) TableName() string
type RoleRef ¶ added in v1.9.9
type RoleRef struct {
Name string `bson:"name" json:"name"`
// Namespace of the referenced object. if the object is cluster scoped, namespace is empty.
Namespace string `bson:"namespace" json:"namespace"`
}
RoleRef contains information that points to the role being used
type Rule ¶ added in v1.9.9
type Rule struct {
// Verbs is a list of http methods or resource actions that apply to ALL the Resources contained in this rule. '*' represents all methods.
Verbs []string `bson:"verbs" json:"verbs"`
// Resources is a list of resources this rule applies to. '*' represents all resources.
Resources []string `bson:"resources" json:"resources"`
Kind string `bson:"kind" json:"kind"`
MatchAttributes []MatchAttribute `bson:"match_attributes" json:"match_attributes"`
}
Rule holds information that describes a policy rule, but does not contain information about whom the rule applies to. If Kind is "resource", verbs are resource actions, while resources are resource names
type Subject ¶ added in v1.9.9
type Subject struct {
// Kind of object being referenced. allowed values are "User", "Group".
Kind SubjectKind `bson:"kind" json:"kind"`
// unique identifier of the object being referenced.
UID string `bson:"uid" json:"uid"`
}
Subject contains a reference to the object or user identities a role binding applies to.
type SubjectKind ¶ added in v1.9.9
type SubjectKind string
type User ¶
type UserLogin ¶
type UserSetting ¶ added in v1.9.9
type UserSetting struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
UID string `bson:"uid" json:"uid"`
Theme string `bson:"theme" json:"theme"`
LogBgColor string `bson:"log_bg_color" json:"log_bg_color"`
LogFontColor string `bson:"log_font_color" json:"log_font_color"`
}
func (UserSetting) TableName ¶ added in v1.9.9
func (UserSetting) TableName() string
type WorkflowCIItem ¶ added in v1.9.9
type WorkflowCIItem struct {
WorkflowType string `bson:"workflow_type" json:"workflow_type"`
Name string `bson:"name" json:"name"`
// workflow display name, it can be modified by users, so we don't save it.
DisplayName string `bson:"-" json:"display_name"`
BaseName string `bson:"base_name" json:"base_name"`
CollaborationType CollaborationType `bson:"collaboration_type" json:"collaboration_type"`
Verbs []string `bson:"verbs" json:"verbs"`
}
type WorkflowCMItem ¶ added in v1.9.9
type WorkflowCMItem struct {
WorkflowType string `bson:"workflow_type" json:"workflow_type"`
Name string `bson:"name" json:"name"`
// workflow display name, it can be modified by users, so we don't save it.
DisplayName string `bson:"-" json:"display_name"`
CollaborationType CollaborationType `bson:"collaboration_type" json:"collaboration_type"`
Verbs []string `bson:"verbs" json:"verbs"`
}