schema

package
v0.3.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NamespaceGroup   = "group"
	NamespaceUser    = "user"
	NamespaceProject = "project"
)

Variables

This section is empty.

Functions

func GroupIsChanged

func GroupIsChanged(old *Group, new *Group) bool

func ProjectIsChanged

func ProjectIsChanged(old *Project, new *Project) bool

func RenderChildGroupIds

func RenderChildGroupIds(groups []*Group)

func UserIsChanged

func UserIsChanged(old *User, new *User) bool

Types

type BaseEntity

type BaseEntity struct {
	Identity    string `json:"identity"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type Group

type Group struct {
	BaseEntity
	Kind     string   `json:"kind"`
	ParentId string   `json:"parent_id"`
	ChildIds []string `json:"child_ids"`
}

type GroupMember

type GroupMember struct {
	Id      string `json:"id"`
	GroupId string `json:"group_id"`
	UserId  string `json:"user_id"`
}

type GroupTree

type GroupTree struct {
	// contains filtered or unexported fields
}

func NewGroupTree

func NewGroupTree(groups []Group) *GroupTree

func (*GroupTree) GetParent

func (t *GroupTree) GetParent(myId string) []Group

func (*GroupTree) GetParents

func (t *GroupTree) GetParents(myId string, withSelf bool) []Group

func (*GroupTree) GetParentsIds

func (t *GroupTree) GetParentsIds(myId string, withSelf bool) []string

type Project

type Project struct {
	BaseEntity
	Namespace *ProjectNamespace `json:"namespace"`
}

type ProjectMember

type ProjectMember struct {
	Id        string `json:"id"`
	UserId    string `json:"user_id"`
	ProjectId string `json:"project_id"`
}

type ProjectNamespace

type ProjectNamespace struct {
	Identity string `json:"id"`
	Kind     string `json:"kind"`
	ParentId string `json:"parent_id"`
}

type TargetKNRI

type TargetKNRI struct {
	Kind     string
	Name     string
	RoleKind string
	Identity string
}

func StringToKNRI

func StringToKNRI(s string) TargetKNRI

func (TargetKNRI) IsEmpty

func (t TargetKNRI) IsEmpty() bool

type User

type User struct {
	BaseEntity
	Username    string   `json:"username"`
	Email       string   `json:"email"`
	AvatarURL   string   `json:"avatar_url"`
	Mobile      string   `json:"mobile"`
	RoleIds     []string `json:"role_Ids"`
	NamespaceId string   `json:"namespace_id"`
}

func GroupMembersToUsers

func GroupMembersToUsers(groupMembers []*GroupMember) []*User

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL