Documentation
¶
Index ¶
- Variables
- func NewRoleEndpoints() []*api.Endpoint
- func RegisterRoleHandler(s server.Server, hdlr RoleHandler, opts ...server.HandlerOption) error
- type AddRoleReq
- func (*AddRoleReq) Descriptor() ([]byte, []int)deprecated
- func (x *AddRoleReq) GetDesc() string
- func (x *AddRoleReq) GetRoleID() uint32
- func (x *AddRoleReq) GetRoleName() string
- func (x *AddRoleReq) GetRoutes() []*Route
- func (*AddRoleReq) ProtoMessage()
- func (x *AddRoleReq) ProtoReflect() protoreflect.Message
- func (x *AddRoleReq) Reset()
- func (x *AddRoleReq) String() string
- type AddRoleResp
- type AuthReq
- func (*AuthReq) Descriptor() ([]byte, []int)deprecated
- func (x *AuthReq) GetMethod() string
- func (x *AuthReq) GetRoleID() uint32
- func (x *AuthReq) GetURL() string
- func (*AuthReq) ProtoMessage()
- func (x *AuthReq) ProtoReflect() protoreflect.Message
- func (x *AuthReq) Reset()
- func (x *AuthReq) String() string
- type AuthResp
- type DeleteRoleResp
- type IdReq
- type Parameter
- type Query
- func (*Query) Descriptor() ([]byte, []int)deprecated
- func (x *Query) GetLimit() uint32
- func (x *Query) GetOffset() uint32
- func (x *Query) GetPage() uint32
- func (x *Query) GetPerPage() uint32
- func (x *Query) GetQueryParams() []*Parameter
- func (x *Query) GetQueryString() string
- func (*Query) ProtoMessage()
- func (x *Query) ProtoReflect() protoreflect.Message
- func (x *Query) Reset()
- func (x *Query) String() string
- type RoleHandler
- type RoleResp
- func (*RoleResp) Descriptor() ([]byte, []int)deprecated
- func (x *RoleResp) GetDesc() string
- func (x *RoleResp) GetRoleID() uint32
- func (x *RoleResp) GetRoleName() string
- func (x *RoleResp) GetRoutes() []*Route
- func (*RoleResp) ProtoMessage()
- func (x *RoleResp) ProtoReflect() protoreflect.Message
- func (x *RoleResp) Reset()
- func (x *RoleResp) String() string
- type RoleService
- type RolesResp
- func (*RolesResp) Descriptor() ([]byte, []int)deprecated
- func (x *RolesResp) GetCurrpages() uint32
- func (x *RolesResp) GetRoles() []*RoleResp
- func (x *RolesResp) GetTotalpages() uint32
- func (x *RolesResp) GetTotals() uint32
- func (*RolesResp) ProtoMessage()
- func (x *RolesResp) ProtoReflect() protoreflect.Message
- func (x *RolesResp) Reset()
- func (x *RolesResp) String() string
- type Route
- func (*Route) Descriptor() ([]byte, []int)deprecated
- func (x *Route) GetChildren() []*Route
- func (x *Route) GetComponent() string
- func (x *Route) GetHidden() bool
- func (x *Route) GetMeta() *RouteMeta
- func (x *Route) GetMethod() string
- func (x *Route) GetName() string
- func (x *Route) GetPath() string
- func (x *Route) GetRedirect() string
- func (*Route) ProtoMessage()
- func (x *Route) ProtoReflect() protoreflect.Message
- func (x *Route) Reset()
- func (x *Route) String() string
- type RouteMeta
- func (*RouteMeta) Descriptor() ([]byte, []int)deprecated
- func (x *RouteMeta) GetIcon() string
- func (x *RouteMeta) GetNocache() bool
- func (x *RouteMeta) GetTitle() string
- func (*RouteMeta) ProtoMessage()
- func (x *RouteMeta) ProtoReflect() protoreflect.Message
- func (x *RouteMeta) Reset()
- func (x *RouteMeta) String() string
- type UpdateReq
- func (*UpdateReq) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateReq) GetDesc() string
- func (x *UpdateReq) GetRoleID() int32
- func (x *UpdateReq) GetRoleName() string
- func (x *UpdateReq) GetRoutes() []*Route
- func (*UpdateReq) ProtoMessage()
- func (x *UpdateReq) ProtoReflect() protoreflect.Message
- func (x *UpdateReq) Reset()
- func (x *UpdateReq) String() string
- type UpdateResp
Constants ¶
This section is empty.
Variables ¶
View Source
var File_proto_role_role_proto protoreflect.FileDescriptor
Functions ¶
func NewRoleEndpoints ¶
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) ProtoMessage ¶
func (*AuthReq) ProtoMessage()
func (*AuthReq) ProtoReflect ¶
func (x *AuthReq) ProtoReflect() protoreflect.Message
type AuthResp ¶
type AuthResp struct {
// contains filtered or unexported fields
}
func (*AuthResp) Descriptor
deprecated
func (*AuthResp) ProtoMessage ¶
func (*AuthResp) ProtoMessage()
func (*AuthResp) ProtoReflect ¶
func (x *AuthResp) ProtoReflect() protoreflect.Message
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) ProtoMessage ¶
func (*IdReq) ProtoMessage()
func (*IdReq) ProtoReflect ¶
func (x *IdReq) ProtoReflect() protoreflect.Message
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) ProtoMessage ¶
func (*Parameter) ProtoMessage()
func (*Parameter) ProtoReflect ¶
func (x *Parameter) ProtoReflect() protoreflect.Message
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) GetPerPage ¶
func (*Query) GetQueryParams ¶
func (*Query) GetQueryString ¶
func (*Query) ProtoMessage ¶
func (*Query) ProtoMessage()
func (*Query) ProtoReflect ¶
func (x *Query) ProtoReflect() protoreflect.Message
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) GetRoleName ¶
func (*RoleResp) ProtoMessage ¶
func (*RoleResp) ProtoMessage()
func (*RoleResp) ProtoReflect ¶
func (x *RoleResp) ProtoReflect() protoreflect.Message
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) GetCurrpages ¶
func (*RolesResp) GetTotalpages ¶
func (*RolesResp) ProtoMessage ¶
func (*RolesResp) ProtoMessage()
func (*RolesResp) ProtoReflect ¶
func (x *RolesResp) ProtoReflect() protoreflect.Message
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) GetChildren ¶
func (*Route) GetComponent ¶
func (*Route) GetRedirect ¶
func (*Route) ProtoMessage ¶
func (*Route) ProtoMessage()
func (*Route) ProtoReflect ¶
func (x *Route) ProtoReflect() protoreflect.Message
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) GetNocache ¶
func (*RouteMeta) ProtoMessage ¶
func (*RouteMeta) ProtoMessage()
func (*RouteMeta) ProtoReflect ¶
func (x *RouteMeta) ProtoReflect() protoreflect.Message
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) GetRoleName ¶
func (*UpdateReq) ProtoMessage ¶
func (*UpdateReq) ProtoMessage()
func (*UpdateReq) ProtoReflect ¶
func (x *UpdateReq) ProtoReflect() protoreflect.Message
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
Click to show internal directories.
Click to hide internal directories.