Documentation ¶
Index ¶
- Variables
- func RegisterRightServer(s grpc.ServiceRegistrar, srv RightServer)
- type Actions
- type ObjectIds
- type Response
- type RightAction
- func (RightAction) Descriptor() protoreflect.EnumDescriptor
- func (x RightAction) Enum() *RightAction
- func (RightAction) EnumDescriptor() ([]byte, []int)deprecated
- func (x RightAction) Number() protoreflect.EnumNumber
- func (x RightAction) String() string
- func (RightAction) Type() protoreflect.EnumType
- type RightClient
- type RightRequest
- func (*RightRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RightRequest) GetAction() RightAction
- func (x *RightRequest) GetObjectId() uint64
- func (x *RightRequest) GetUserId() uint64
- func (*RightRequest) ProtoMessage()
- func (x *RightRequest) ProtoReflect() protoreflect.Message
- func (x *RightRequest) Reset()
- func (x *RightRequest) String() string
- type RightServer
- type Role
- type RoleRequest
- func (*RoleRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RoleRequest) GetName() string
- func (x *RoleRequest) GetObjectId() uint64
- func (*RoleRequest) ProtoMessage()
- func (x *RoleRequest) ProtoReflect() protoreflect.Message
- func (x *RoleRequest) Reset()
- func (x *RoleRequest) String() string
- type Roles
- type UnimplementedRightServer
- func (UnimplementedRightServer) AuthQuery(context.Context, *RightRequest) (*Response, error)
- func (UnimplementedRightServer) ListRoles(context.Context, *ObjectIds) (*Roles, error)
- func (UnimplementedRightServer) ListUserRoles(context.Context, *UserId) (*Roles, error)
- func (UnimplementedRightServer) RoleRight(context.Context, *RoleRequest) (*Actions, error)
- func (UnimplementedRightServer) UpdateRole(context.Context, *Role) (*Response, error)
- func (UnimplementedRightServer) UpdateUser(context.Context, *UserRight) (*Response, error)
- type UnsafeRightServer
- type UserId
- type UserRight
Constants ¶
This section is empty.
Variables ¶
var ( RightAction_name = map[int32]string{ 0: "ACCESS", 1: "CREATE", 2: "UPDATE", 3: "DELETE", } RightAction_value = map[string]int32{ "ACCESS": 0, "CREATE": 1, "UPDATE": 2, "DELETE": 3, } )
Enum value maps for RightAction.
var File_right_proto protoreflect.FileDescriptor
var Right_ServiceDesc = grpc.ServiceDesc{ ServiceName: "puzzlerightservice.Right", HandlerType: (*RightServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "AuthQuery", Handler: _Right_AuthQuery_Handler, }, { MethodName: "ListRoles", Handler: _Right_ListRoles_Handler, }, { MethodName: "RoleRight", Handler: _Right_RoleRight_Handler, }, { MethodName: "UpdateUser", Handler: _Right_UpdateUser_Handler, }, { MethodName: "UpdateRole", Handler: _Right_UpdateRole_Handler, }, { MethodName: "ListUserRoles", Handler: _Right_ListUserRoles_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "right.proto", }
Right_ServiceDesc is the grpc.ServiceDesc for Right service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterRightServer ¶
func RegisterRightServer(s grpc.ServiceRegistrar, srv RightServer)
Types ¶
type Actions ¶
type Actions struct { List []RightAction `protobuf:"varint,1,rep,packed,name=list,proto3,enum=puzzlerightservice.RightAction" json:"list,omitempty"` // contains filtered or unexported fields }
func (*Actions) Descriptor
deprecated
func (*Actions) GetList ¶
func (x *Actions) GetList() []RightAction
func (*Actions) ProtoMessage ¶
func (*Actions) ProtoMessage()
func (*Actions) ProtoReflect ¶
func (x *Actions) ProtoReflect() protoreflect.Message
type ObjectIds ¶
type ObjectIds struct { Ids []uint64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"` // contains filtered or unexported fields }
func (*ObjectIds) Descriptor
deprecated
func (*ObjectIds) ProtoMessage ¶
func (*ObjectIds) ProtoMessage()
func (*ObjectIds) ProtoReflect ¶
func (x *ObjectIds) ProtoReflect() protoreflect.Message
type Response ¶ added in v1.3.0
type Response struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // contains filtered or unexported fields }
func (*Response) Descriptor
deprecated
added in
v1.3.0
func (*Response) GetSuccess ¶ added in v1.3.0
func (*Response) ProtoMessage ¶ added in v1.3.0
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶ added in v1.3.0
func (x *Response) ProtoReflect() protoreflect.Message
type RightAction ¶
type RightAction int32
const ( RightAction_ACCESS RightAction = 0 RightAction_CREATE RightAction = 1 RightAction_UPDATE RightAction = 2 RightAction_DELETE RightAction = 3 )
func (RightAction) Descriptor ¶
func (RightAction) Descriptor() protoreflect.EnumDescriptor
func (RightAction) Enum ¶
func (x RightAction) Enum() *RightAction
func (RightAction) EnumDescriptor
deprecated
func (RightAction) EnumDescriptor() ([]byte, []int)
Deprecated: Use RightAction.Descriptor instead.
func (RightAction) Number ¶
func (x RightAction) Number() protoreflect.EnumNumber
func (RightAction) String ¶
func (x RightAction) String() string
func (RightAction) Type ¶
func (RightAction) Type() protoreflect.EnumType
type RightClient ¶
type RightClient interface { AuthQuery(ctx context.Context, in *RightRequest, opts ...grpc.CallOption) (*Response, error) ListRoles(ctx context.Context, in *ObjectIds, opts ...grpc.CallOption) (*Roles, error) RoleRight(ctx context.Context, in *RoleRequest, opts ...grpc.CallOption) (*Actions, error) UpdateUser(ctx context.Context, in *UserRight, opts ...grpc.CallOption) (*Response, error) UpdateRole(ctx context.Context, in *Role, opts ...grpc.CallOption) (*Response, error) ListUserRoles(ctx context.Context, in *UserId, opts ...grpc.CallOption) (*Roles, error) }
RightClient is the client API for Right service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewRightClient ¶
func NewRightClient(cc grpc.ClientConnInterface) RightClient
type RightRequest ¶
type RightRequest struct { UserId uint64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` ObjectId uint64 `protobuf:"varint,2,opt,name=objectId,proto3" json:"objectId,omitempty"` Action RightAction `protobuf:"varint,3,opt,name=action,proto3,enum=puzzlerightservice.RightAction" json:"action,omitempty"` // contains filtered or unexported fields }
func (*RightRequest) Descriptor
deprecated
func (*RightRequest) Descriptor() ([]byte, []int)
Deprecated: Use RightRequest.ProtoReflect.Descriptor instead.
func (*RightRequest) GetAction ¶
func (x *RightRequest) GetAction() RightAction
func (*RightRequest) GetObjectId ¶
func (x *RightRequest) GetObjectId() uint64
func (*RightRequest) GetUserId ¶
func (x *RightRequest) GetUserId() uint64
func (*RightRequest) ProtoMessage ¶
func (*RightRequest) ProtoMessage()
func (*RightRequest) ProtoReflect ¶
func (x *RightRequest) ProtoReflect() protoreflect.Message
func (*RightRequest) Reset ¶
func (x *RightRequest) Reset()
func (*RightRequest) String ¶
func (x *RightRequest) String() string
type RightServer ¶
type RightServer interface { AuthQuery(context.Context, *RightRequest) (*Response, error) ListRoles(context.Context, *ObjectIds) (*Roles, error) RoleRight(context.Context, *RoleRequest) (*Actions, error) UpdateUser(context.Context, *UserRight) (*Response, error) UpdateRole(context.Context, *Role) (*Response, error) ListUserRoles(context.Context, *UserId) (*Roles, error) // contains filtered or unexported methods }
RightServer is the server API for Right service. All implementations must embed UnimplementedRightServer for forward compatibility
type Role ¶
type Role struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` ObjectId uint64 `protobuf:"varint,2,opt,name=objectId,proto3" json:"objectId,omitempty"` List []RightAction `protobuf:"varint,3,rep,packed,name=list,proto3,enum=puzzlerightservice.RightAction" json:"list,omitempty"` // contains filtered or unexported fields }
func (*Role) Descriptor
deprecated
func (*Role) GetList ¶
func (x *Role) GetList() []RightAction
func (*Role) GetObjectId ¶
func (*Role) ProtoMessage ¶
func (*Role) ProtoMessage()
func (*Role) ProtoReflect ¶
func (x *Role) ProtoReflect() protoreflect.Message
type RoleRequest ¶
type RoleRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` ObjectId uint64 `protobuf:"varint,2,opt,name=objectId,proto3" json:"objectId,omitempty"` // contains filtered or unexported fields }
func (*RoleRequest) Descriptor
deprecated
func (*RoleRequest) Descriptor() ([]byte, []int)
Deprecated: Use RoleRequest.ProtoReflect.Descriptor instead.
func (*RoleRequest) GetName ¶
func (x *RoleRequest) GetName() string
func (*RoleRequest) GetObjectId ¶
func (x *RoleRequest) GetObjectId() uint64
func (*RoleRequest) ProtoMessage ¶
func (*RoleRequest) ProtoMessage()
func (*RoleRequest) ProtoReflect ¶
func (x *RoleRequest) ProtoReflect() protoreflect.Message
func (*RoleRequest) Reset ¶
func (x *RoleRequest) Reset()
func (*RoleRequest) String ¶
func (x *RoleRequest) String() string
type Roles ¶
type Roles struct { List []*Role `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` // contains filtered or unexported fields }
func (*Roles) Descriptor
deprecated
func (*Roles) ProtoMessage ¶
func (*Roles) ProtoMessage()
func (*Roles) ProtoReflect ¶
func (x *Roles) ProtoReflect() protoreflect.Message
type UnimplementedRightServer ¶
type UnimplementedRightServer struct { }
UnimplementedRightServer must be embedded to have forward compatible implementations.
func (UnimplementedRightServer) AuthQuery ¶
func (UnimplementedRightServer) AuthQuery(context.Context, *RightRequest) (*Response, error)
func (UnimplementedRightServer) ListUserRoles ¶ added in v1.2.0
func (UnimplementedRightServer) RoleRight ¶
func (UnimplementedRightServer) RoleRight(context.Context, *RoleRequest) (*Actions, error)
func (UnimplementedRightServer) UpdateRole ¶
func (UnimplementedRightServer) UpdateUser ¶
type UnsafeRightServer ¶
type UnsafeRightServer interface {
// contains filtered or unexported methods
}
UnsafeRightServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RightServer will result in compilation errors.
type UserId ¶ added in v1.2.0
type UserId struct { Id uint64 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` // contains filtered or unexported fields }
func (*UserId) Descriptor
deprecated
added in
v1.2.0
func (*UserId) ProtoMessage ¶ added in v1.2.0
func (*UserId) ProtoMessage()
func (*UserId) ProtoReflect ¶ added in v1.2.0
func (x *UserId) ProtoReflect() protoreflect.Message
type UserRight ¶
type UserRight struct { UserId uint64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` List []*RoleRequest `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` // contains filtered or unexported fields }
func (*UserRight) Descriptor
deprecated
func (*UserRight) GetList ¶
func (x *UserRight) GetList() []*RoleRequest
func (*UserRight) ProtoMessage ¶
func (*UserRight) ProtoMessage()
func (*UserRight) ProtoReflect ¶
func (x *UserRight) ProtoReflect() protoreflect.Message