Documentation
¶
Index ¶
- Constants
- Variables
- func ContainerConfig(con *CreatedContainer) *container.Config
- func ContainerHostConfig(con *CreatedContainer) *container.HostConfig
- type AuthInfo
- type AuthUser
- type BaseModel
- type Category
- type Comment
- type Container
- type CreatedContainer
- type CreatedGroup
- type CreatedUser
- type Group
- type JWTToken
- type KubeApp
- type KubeBase
- type Like
- type Operation
- type Post
- type Resource
- type Role
- type Rule
- type Rules
- type Scope
- type Tag
- type UpdatedGroup
- type UpdatedUser
- type User
- type UserInfo
- type UserRole
- type Users
Constants ¶
View Source
const ( AppNameLabel = `app` AppPateformLabel = `weave.io` AppPateformValue = `true` )
View Source
const ( RootGroup = "root" AuthenticatedGroup = "system:authenticated" UnAuthenticatedGroup = "system:unauthenticated" SystemGroup = "system" CustomGroup = "custom" )
View Source
const ( KubeDeployment = "deployments" KubeStatefulset = "statefulsets" KubeDaemonset = "daemonsets" KubePod = "pods" KubeService = "services" KubeIngress = "ingresses" )
View Source
const ( PostAssociation = "Posts" TagAssociation = "Tags" CategoriesAssociation = "Categories" )
View Source
const ( ResourceKind = "resource" MenuKind = "menu" )
View Source
const ( ContainerResource = "containers" PostResource = "posts" UserResource = "users" GroupResource = "groups" RoleResource = "roles" AuthResource = "auth" NamespaceResource = "namespaces" )
View Source
const ( UserAssociation = "Users" UserAuthInfoAssociation = "AuthInfos" GroupAssociation = "Groups" )
View Source
const (
All = "*"
)
Variables ¶
View Source
var ( EditOperationSet = set.NewString(request.CreateOperation, request.DeleteOperation, request.UpdateOperation, request.PatchOperation, request.GetOperation, request.ListOperation) ViewOperationSet = set.NewString(request.GetOperation, request.ListOperation) )
Functions ¶
func ContainerConfig ¶
func ContainerConfig(con *CreatedContainer) *container.Config
func ContainerHostConfig ¶
func ContainerHostConfig(con *CreatedContainer) *container.HostConfig
Types ¶
type AuthInfo ¶
type AuthInfo struct {
ID uint `json:"id" gorm:"autoIncrement;primaryKey"`
UserId uint `json:"userId" gorm:"size:256"`
Url string `json:"url" gorm:"size:256"`
AuthType string `json:"authType" gorm:"size:256"`
AuthId string `json:"authId" gorm:"size:256"`
AccessToken string `json:"-" gorm:"size:256"`
RefreshToken string `json:"-" gorm:"size:256"`
Expiry time.Time `json:"-"`
BaseModel
}
type Comment ¶
type Comment struct {
ID uint `json:"id" gorm:"autoIncrement;primaryKey"`
ParentID *uint `json:"parentId"`
Parent *Comment `json:"parent" gorm:"foreignKey:ParentID"`
UserID uint `json:"userId"`
User User `json:"user" gorm:"foreignKey:UserID"`
PostID uint `json:"postId"`
Post Post `json:"-" gorm:"foreignKey:PostID"`
Content string `json:"content" gorm:"size:1024"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
type Container ¶
type Container struct {
ID string `json:"id"`
Name string `json:"name"`
Image string `json:"image"`
Cmd []string `json:"cmd"`
Port int `json:"port"`
Status string `json:"status"`
Address string `json:"address"`
StartAt string `json:"startAt"`
}
func DockerContainerJSONToContainer ¶
func DockerContainerJSONToContainer(container types.ContainerJSON) Container
type CreatedContainer ¶
type CreatedContainer struct {
Name string `json:"name"`
Image string `json:"image"`
Cmd []string `json:"cmd"`
Port int `json:"port"`
}
func (*CreatedContainer) GetContainer ¶
func (c *CreatedContainer) GetContainer(id string) *Container
type CreatedGroup ¶
type CreatedGroup struct {
Name string `json:"name"`
Describe string `json:"describe"`
CreatorId uint `json:"creatorId"`
}
func (*CreatedGroup) GetGroup ¶
func (g *CreatedGroup) GetGroup(uid uint) *Group
type CreatedUser ¶
type CreatedUser struct {
Name string `json:"name"`
Password string `json:"password"`
Email string `json:"email"`
Avatar string `json:"avatar"`
AuthInfos []AuthInfo `json:"authInfos"`
}
func (*CreatedUser) GetUser ¶
func (u *CreatedUser) GetUser() *User
type Group ¶
type Group struct {
ID uint `json:"id" gorm:"autoIncrement;primaryKey"`
Name string `json:"name" gorm:"size:100;not null;unique"`
Kind string `json:"kind" gorm:"size:100"`
Describe string `json:"describe" gorm:"size:1024;"`
CreatorId uint `json:"creatorId"`
UpdaterId uint `json:"updaterId"`
Users []User `json:"users" gorm:"many2many:user_groups;"`
Roles []Role `json:"roles" gorm:"many2many:group_roles;"`
BaseModel
}
type Post ¶
type Post struct {
ID uint `json:"id" gorm:"autoIncrement;primaryKey"`
Name string `json:"name" gorm:"size:256;not null;unique"`
Content string `json:"content" gorm:"type:text;not null"`
Summary string `json:"summary" gorm:"size:512"`
CreatorID uint `json:"creatorId"`
Creator User `json:"creator" gorm:"foreignKey:CreatorID"`
Tags []Tag `json:"tags" gorm:"many2many:tag_posts"`
Categories []Category `json:"categories" gorm:"many2many:category_posts"`
Comments []Comment `json:"comments"`
Views uint `json:"views" gorm:"type:uint"`
Likes uint `json:"likes" gorm:"-"`
UserLiked bool `json:"userLiked" gorm:"-"`
BaseModel
}
type UpdatedGroup ¶
type UpdatedGroup struct {
Name string `json:"name"`
Describe string `json:"describe"`
UpdaterId uint `json:"updaterId"`
}
func (*UpdatedGroup) GetGroup ¶
func (g *UpdatedGroup) GetGroup(uid uint) *Group
type UpdatedUser ¶
type UpdatedUser struct {
Name string `json:"name"`
Password string `json:"password"`
Email string `json:"email"`
AuthInfos []AuthInfo `json:"authInfos"`
}
func (*UpdatedUser) GetUser ¶
func (u *UpdatedUser) GetUser() *User
type User ¶
type User struct {
ID uint `json:"id" gorm:"autoIncrement;primaryKey"`
Name string `json:"name" gorm:"size:100;not null;unique"`
Password string `json:"-" gorm:"size:256;"`
Email string `json:"email" gorm:"size:256;"`
Avatar string `json:"avatar" gorm:"size:256;"`
AuthInfos []AuthInfo `json:"authInfos" gorm:"foreignKey:UserId;references:ID"`
Groups []Group `json:"groups" gorm:"many2many:user_groups;"`
Roles []Role `json:"roles" gorm:"many2many:user_roles;"`
BaseModel
}
func (*User) MarshalBinary ¶
func (*User) UnmarshalBinary ¶
Click to show internal directories.
Click to hide internal directories.