go_micro_srv_role

package
v2.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_role_role_proto protoreflect.FileDescriptor

Functions

func NewRoleEndpoints

func NewRoleEndpoints() []*api.Endpoint

func RegisterRoleHandler

func RegisterRoleHandler(s server.Server, hdlr RoleHandler, opts ...server.HandlerOption) error

Types

type AddRoleReq

type AddRoleReq struct {
	RoleID   uint32   `protobuf:"varint,1,opt,name=roleID,proto3" json:"roleID,omitempty"`
	RoleName string   `protobuf:"bytes,2,opt,name=roleName,proto3" json:"roleName,omitempty"`
	Desc     string   `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"`
	Routes   []*Route `protobuf:"bytes,4,rep,name=routes,proto3" json:"routes,omitempty"`
	// contains filtered or unexported fields
}

func (*AddRoleReq) Descriptor deprecated

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

Deprecated: Use AddRoleReq.ProtoReflect.Descriptor instead.

func (*AddRoleReq) GetDesc

func (x *AddRoleReq) GetDesc() string

func (*AddRoleReq) GetRoleID

func (x *AddRoleReq) GetRoleID() uint32

func (*AddRoleReq) GetRoleName

func (x *AddRoleReq) GetRoleName() string

func (*AddRoleReq) GetRoutes

func (x *AddRoleReq) GetRoutes() []*Route

func (*AddRoleReq) ProtoMessage

func (*AddRoleReq) ProtoMessage()

func (*AddRoleReq) ProtoReflect

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

func (*AddRoleReq) Reset

func (x *AddRoleReq) Reset()

func (*AddRoleReq) String

func (x *AddRoleReq) String() string

type AddRoleResp

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

func (*AddRoleResp) Descriptor deprecated

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

Deprecated: Use AddRoleResp.ProtoReflect.Descriptor instead.

func (*AddRoleResp) ProtoMessage

func (*AddRoleResp) ProtoMessage()

func (*AddRoleResp) ProtoReflect

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

func (*AddRoleResp) Reset

func (x *AddRoleResp) Reset()

func (*AddRoleResp) String

func (x *AddRoleResp) String() string

type AuthReq

type AuthReq struct {
	RoleID uint32 `protobuf:"varint,1,opt,name=roleID,proto3" json:"roleID,omitempty"`
	URL    string `protobuf:"bytes,2,opt,name=URL,proto3" json:"URL,omitempty"`
	Method string `protobuf:"bytes,3,opt,name=Method,proto3" json:"Method,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthReq) Descriptor deprecated

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

Deprecated: Use AuthReq.ProtoReflect.Descriptor instead.

func (*AuthReq) GetMethod

func (x *AuthReq) GetMethod() string

func (*AuthReq) GetRoleID

func (x *AuthReq) GetRoleID() uint32

func (*AuthReq) GetURL

func (x *AuthReq) GetURL() string

func (*AuthReq) ProtoMessage

func (*AuthReq) ProtoMessage()

func (*AuthReq) ProtoReflect

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

func (*AuthReq) Reset

func (x *AuthReq) Reset()

func (*AuthReq) String

func (x *AuthReq) String() string

type AuthResp

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

func (*AuthResp) Descriptor deprecated

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

Deprecated: Use AuthResp.ProtoReflect.Descriptor instead.

func (*AuthResp) ProtoMessage

func (*AuthResp) ProtoMessage()

func (*AuthResp) ProtoReflect

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

func (*AuthResp) Reset

func (x *AuthResp) Reset()

func (*AuthResp) String

func (x *AuthResp) String() string

type DeleteRoleResp

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

func (*DeleteRoleResp) Descriptor deprecated

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

Deprecated: Use DeleteRoleResp.ProtoReflect.Descriptor instead.

func (*DeleteRoleResp) ProtoMessage

func (*DeleteRoleResp) ProtoMessage()

func (*DeleteRoleResp) ProtoReflect

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

func (*DeleteRoleResp) Reset

func (x *DeleteRoleResp) Reset()

func (*DeleteRoleResp) String

func (x *DeleteRoleResp) String() string

type IdReq

type IdReq struct {
	RoleID int32 `protobuf:"varint,1,opt,name=roleID,proto3" json:"roleID,omitempty"`
	// contains filtered or unexported fields
}

func (*IdReq) Descriptor deprecated

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

Deprecated: Use IdReq.ProtoReflect.Descriptor instead.

func (*IdReq) GetRoleID

func (x *IdReq) GetRoleID() int32

func (*IdReq) ProtoMessage

func (*IdReq) ProtoMessage()

func (*IdReq) ProtoReflect

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

func (*IdReq) Reset

func (x *IdReq) Reset()

func (*IdReq) String

func (x *IdReq) String() string

type Parameter

type Parameter struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Parameter) Descriptor deprecated

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

Deprecated: Use Parameter.ProtoReflect.Descriptor instead.

func (*Parameter) GetKey

func (x *Parameter) GetKey() string

func (*Parameter) GetValue

func (x *Parameter) GetValue() string

func (*Parameter) ProtoMessage

func (*Parameter) ProtoMessage()

func (*Parameter) ProtoReflect

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

func (*Parameter) Reset

func (x *Parameter) Reset()

func (*Parameter) String

func (x *Parameter) String() string

type Query

type Query struct {
	Limit       uint32       `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
	Offset      uint32       `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
	Page        uint32       `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"`
	PerPage     uint32       `protobuf:"varint,4,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"`
	QueryString string       `protobuf:"bytes,5,opt,name=queryString,proto3" json:"queryString,omitempty"`
	QueryParams []*Parameter `protobuf:"bytes,6,rep,name=queryParams,proto3" json:"queryParams,omitempty"`
	// contains filtered or unexported fields
}

func (*Query) Descriptor deprecated

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

Deprecated: Use Query.ProtoReflect.Descriptor instead.

func (*Query) GetLimit

func (x *Query) GetLimit() uint32

func (*Query) GetOffset

func (x *Query) GetOffset() uint32

func (*Query) GetPage

func (x *Query) GetPage() uint32

func (*Query) GetPerPage

func (x *Query) GetPerPage() uint32

func (*Query) GetQueryParams

func (x *Query) GetQueryParams() []*Parameter

func (*Query) GetQueryString

func (x *Query) GetQueryString() string

func (*Query) ProtoMessage

func (*Query) ProtoMessage()

func (*Query) ProtoReflect

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

func (*Query) Reset

func (x *Query) Reset()

func (*Query) String

func (x *Query) String() string

type RoleHandler

type RoleHandler interface {
	// 添加角色
	AddRole(context.Context, *AddRoleReq, *AddRoleResp) error
	// 删除指定角色
	DeleteRole(context.Context, *IdReq, *DeleteRoleResp) error
	// 修改角色信息
	UpdateRole(context.Context, *UpdateReq, *UpdateResp) error
	// 根据角色ID获取角色信息
	GetRole(context.Context, *IdReq, *RoleResp) error
	// 根据查询条件获取用户列表
	GetRoles(context.Context, *Query, *RolesResp) error
	// 验证用户是否具备访问权限
	AuthRole(context.Context, *AuthReq, *AuthResp) error
}

type RoleResp

type RoleResp struct {
	RoleID   uint32   `protobuf:"varint,1,opt,name=roleID,proto3" json:"roleID,omitempty"`
	RoleName string   `protobuf:"bytes,2,opt,name=roleName,proto3" json:"roleName,omitempty"`
	Desc     string   `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"`
	Routes   []*Route `protobuf:"bytes,4,rep,name=routes,proto3" json:"routes,omitempty"`
	// contains filtered or unexported fields
}

func (*RoleResp) Descriptor deprecated

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

Deprecated: Use RoleResp.ProtoReflect.Descriptor instead.

func (*RoleResp) GetDesc

func (x *RoleResp) GetDesc() string

func (*RoleResp) GetRoleID

func (x *RoleResp) GetRoleID() uint32

func (*RoleResp) GetRoleName

func (x *RoleResp) GetRoleName() string

func (*RoleResp) GetRoutes

func (x *RoleResp) GetRoutes() []*Route

func (*RoleResp) ProtoMessage

func (*RoleResp) ProtoMessage()

func (*RoleResp) ProtoReflect

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

func (*RoleResp) Reset

func (x *RoleResp) Reset()

func (*RoleResp) String

func (x *RoleResp) String() string

type RoleService

type RoleService interface {
	// 添加角色
	AddRole(ctx context.Context, in *AddRoleReq, opts ...client.CallOption) (*AddRoleResp, error)
	// 删除指定角色
	DeleteRole(ctx context.Context, in *IdReq, opts ...client.CallOption) (*DeleteRoleResp, error)
	// 修改角色信息
	UpdateRole(ctx context.Context, in *UpdateReq, opts ...client.CallOption) (*UpdateResp, error)
	// 根据角色ID获取角色信息
	GetRole(ctx context.Context, in *IdReq, opts ...client.CallOption) (*RoleResp, error)
	// 根据查询条件获取用户列表
	GetRoles(ctx context.Context, in *Query, opts ...client.CallOption) (*RolesResp, error)
	// 验证用户是否具备访问权限
	AuthRole(ctx context.Context, in *AuthReq, opts ...client.CallOption) (*AuthResp, error)
}

func NewRoleService

func NewRoleService(name string, c client.Client) RoleService

type RolesResp

type RolesResp struct {
	Roles      []*RoleResp `protobuf:"bytes,1,rep,name=roles,proto3" json:"roles,omitempty"`
	Totalpages uint32      `protobuf:"varint,2,opt,name=totalpages,proto3" json:"totalpages,omitempty"`
	Currpages  uint32      `protobuf:"varint,3,opt,name=currpages,proto3" json:"currpages,omitempty"`
	Totals     uint32      `protobuf:"varint,4,opt,name=totals,proto3" json:"totals,omitempty"`
	// contains filtered or unexported fields
}

func (*RolesResp) Descriptor deprecated

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

Deprecated: Use RolesResp.ProtoReflect.Descriptor instead.

func (*RolesResp) GetCurrpages

func (x *RolesResp) GetCurrpages() uint32

func (*RolesResp) GetRoles

func (x *RolesResp) GetRoles() []*RoleResp

func (*RolesResp) GetTotalpages

func (x *RolesResp) GetTotalpages() uint32

func (*RolesResp) GetTotals

func (x *RolesResp) GetTotals() uint32

func (*RolesResp) ProtoMessage

func (*RolesResp) ProtoMessage()

func (*RolesResp) ProtoReflect

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

func (*RolesResp) Reset

func (x *RolesResp) Reset()

func (*RolesResp) String

func (x *RolesResp) String() string

type Route

type Route struct {
	Path      string     `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	Method    string     `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"`
	Component string     `protobuf:"bytes,3,opt,name=component,proto3" json:"component,omitempty"`
	Redirect  string     `protobuf:"bytes,4,opt,name=redirect,proto3" json:"redirect,omitempty"`
	Name      string     `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"`
	Children  []*Route   `protobuf:"bytes,6,rep,name=children,proto3" json:"children,omitempty"`
	Hidden    bool       `protobuf:"varint,7,opt,name=hidden,proto3" json:"hidden,omitempty"`
	Meta      *RouteMeta `protobuf:"bytes,8,opt,name=meta,proto3" json:"meta,omitempty"`
	// contains filtered or unexported fields
}

Route 路径

func (*Route) Descriptor deprecated

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

Deprecated: Use Route.ProtoReflect.Descriptor instead.

func (*Route) GetChildren

func (x *Route) GetChildren() []*Route

func (*Route) GetComponent

func (x *Route) GetComponent() string

func (*Route) GetHidden

func (x *Route) GetHidden() bool

func (*Route) GetMeta

func (x *Route) GetMeta() *RouteMeta

func (*Route) GetMethod

func (x *Route) GetMethod() string

func (*Route) GetName

func (x *Route) GetName() string

func (*Route) GetPath

func (x *Route) GetPath() string

func (*Route) GetRedirect

func (x *Route) GetRedirect() string

func (*Route) ProtoMessage

func (*Route) ProtoMessage()

func (*Route) ProtoReflect

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

func (*Route) Reset

func (x *Route) Reset()

func (*Route) String

func (x *Route) String() string

type RouteMeta

type RouteMeta struct {
	Title   string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	Icon    string `protobuf:"bytes,2,opt,name=icon,proto3" json:"icon,omitempty"`
	Nocache bool   `protobuf:"varint,3,opt,name=nocache,proto3" json:"nocache,omitempty"`
	// contains filtered or unexported fields
}

RouteMeta 资源

func (*RouteMeta) Descriptor deprecated

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

Deprecated: Use RouteMeta.ProtoReflect.Descriptor instead.

func (*RouteMeta) GetIcon

func (x *RouteMeta) GetIcon() string

func (*RouteMeta) GetNocache

func (x *RouteMeta) GetNocache() bool

func (*RouteMeta) GetTitle

func (x *RouteMeta) GetTitle() string

func (*RouteMeta) ProtoMessage

func (*RouteMeta) ProtoMessage()

func (*RouteMeta) ProtoReflect

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

func (*RouteMeta) Reset

func (x *RouteMeta) Reset()

func (*RouteMeta) String

func (x *RouteMeta) String() string

type UpdateReq

type UpdateReq struct {
	RoleID   int32    `protobuf:"varint,1,opt,name=roleID,proto3" json:"roleID,omitempty"`
	RoleName string   `protobuf:"bytes,2,opt,name=roleName,proto3" json:"roleName,omitempty"`
	Desc     string   `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"`
	Routes   []*Route `protobuf:"bytes,4,rep,name=routes,proto3" json:"routes,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateReq) Descriptor deprecated

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

Deprecated: Use UpdateReq.ProtoReflect.Descriptor instead.

func (*UpdateReq) GetDesc

func (x *UpdateReq) GetDesc() string

func (*UpdateReq) GetRoleID

func (x *UpdateReq) GetRoleID() int32

func (*UpdateReq) GetRoleName

func (x *UpdateReq) GetRoleName() string

func (*UpdateReq) GetRoutes

func (x *UpdateReq) GetRoutes() []*Route

func (*UpdateReq) ProtoMessage

func (*UpdateReq) ProtoMessage()

func (*UpdateReq) ProtoReflect

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

func (*UpdateReq) Reset

func (x *UpdateReq) Reset()

func (*UpdateReq) String

func (x *UpdateReq) String() string

type UpdateResp

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

func (*UpdateResp) Descriptor deprecated

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

Deprecated: Use UpdateResp.ProtoReflect.Descriptor instead.

func (*UpdateResp) ProtoMessage

func (*UpdateResp) ProtoMessage()

func (*UpdateResp) ProtoReflect

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

func (*UpdateResp) Reset

func (x *UpdateResp) Reset()

func (*UpdateResp) String

func (x *UpdateResp) String() string

Jump to

Keyboard shortcuts

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