role

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: Artistic-2.0 Imports: 4 Imported by: 0

README

角色管理

role_name---> resource, action

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_apps_role_pb_role_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type CreateRoleRequest

type CreateRoleRequest struct {

	// 角色名称
	// @gotags: json:"name" bson:"name"
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name" bson:"name"`
	// 角色标识
	// @gotags: json:"description" bson:"description"
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description" bson:"description"`
	// 角色的权限
	// @gotags: json:"permissions" bson:"permissions"
	Permissions []*Permission `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions" bson:"permissions"`
	// 角色的一些额外属性
	// @gotags: json:"meta" bson:"meta"
	Meta map[string]string `` /* 151-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*CreateRoleRequest) Descriptor deprecated

func (*CreateRoleRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateRoleRequest.ProtoReflect.Descriptor instead.

func (*CreateRoleRequest) GetDescription

func (x *CreateRoleRequest) GetDescription() string

func (*CreateRoleRequest) GetMeta

func (x *CreateRoleRequest) GetMeta() map[string]string

func (*CreateRoleRequest) GetName

func (x *CreateRoleRequest) GetName() string

func (*CreateRoleRequest) GetPermissions

func (x *CreateRoleRequest) GetPermissions() []*Permission

func (*CreateRoleRequest) ProtoMessage

func (*CreateRoleRequest) ProtoMessage()

func (*CreateRoleRequest) ProtoReflect

func (x *CreateRoleRequest) ProtoReflect() protoreflect.Message

func (*CreateRoleRequest) Reset

func (x *CreateRoleRequest) Reset()

func (*CreateRoleRequest) String

func (x *CreateRoleRequest) String() string

type Featrue

type Featrue struct {

	// 资源名称
	// @gotags: json:"resource" bson:"resource"
	Resource string `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource" bson:"resource"`
	// 资源操作
	// @gotags: json:"action" bson:"action"
	Action string `protobuf:"bytes,4,opt,name=action,proto3" json:"action" bson:"action"`
	// contains filtered or unexported fields
}

func (*Featrue) Descriptor deprecated

func (*Featrue) Descriptor() ([]byte, []int)

Deprecated: Use Featrue.ProtoReflect.Descriptor instead.

func (*Featrue) GetAction

func (x *Featrue) GetAction() string

func (*Featrue) GetResource

func (x *Featrue) GetResource() string

func (*Featrue) ProtoMessage

func (*Featrue) ProtoMessage()

func (*Featrue) ProtoReflect

func (x *Featrue) ProtoReflect() protoreflect.Message

func (*Featrue) Reset

func (x *Featrue) Reset()

func (*Featrue) String

func (x *Featrue) String() string

type Permission

type Permission struct {

	// 服务名称
	// @gotags: json:"service" bson:"service"
	Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service" bson:"service"`
	// 服务功能
	// @gotags: json:"featrues" bson:"featrues"
	Featrues []*Featrue `protobuf:"bytes,2,rep,name=featrues,proto3" json:"featrues" bson:"featrues"`
	// contains filtered or unexported fields
}

那个服务 的哪些权限

func (*Permission) Descriptor deprecated

func (*Permission) Descriptor() ([]byte, []int)

Deprecated: Use Permission.ProtoReflect.Descriptor instead.

func (*Permission) GetFeatrues

func (x *Permission) GetFeatrues() []*Featrue

func (*Permission) GetService

func (x *Permission) GetService() string

func (*Permission) ProtoMessage

func (*Permission) ProtoMessage()

func (*Permission) ProtoReflect

func (x *Permission) ProtoReflect() protoreflect.Message

func (*Permission) Reset

func (x *Permission) Reset()

func (*Permission) String

func (x *Permission) String() string

type Role

type Role struct {

	// 角色id
	// @gotags: json:"id" bson:"_id"
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"`
	// 角色创建时间
	// @gotags: json:"name" bson:"create_at"
	CreateAt int64 `protobuf:"varint,2,opt,name=create_at,json=createAt,proto3" json:"name" bson:"create_at"`
	// 角色名称
	// @gotags: json:"spec" bson:"spec"
	Spec *CreateRoleRequest `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec" bson:"spec"`
	// contains filtered or unexported fields
}

func (*Role) Descriptor deprecated

func (*Role) Descriptor() ([]byte, []int)

Deprecated: Use Role.ProtoReflect.Descriptor instead.

func (*Role) GetCreateAt

func (x *Role) GetCreateAt() int64

func (*Role) GetId

func (x *Role) GetId() string

func (*Role) GetSpec

func (x *Role) GetSpec() *CreateRoleRequest

func (*Role) ProtoMessage

func (*Role) ProtoMessage()

func (*Role) ProtoReflect

func (x *Role) ProtoReflect() protoreflect.Message

func (*Role) Reset

func (x *Role) Reset()

func (*Role) String

func (x *Role) String() string

Jump to

Keyboard shortcuts

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