puzzlerightservice

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 8 Imported by: 6

README

puzzlerightservice

service description to manage right among the users

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
var File_right_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Actions.ProtoReflect.Descriptor instead.

func (*Actions) GetList

func (x *Actions) GetList() []RightAction

func (*Actions) ProtoMessage

func (*Actions) ProtoMessage()

func (*Actions) ProtoReflect

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

func (*Actions) Reset

func (x *Actions) Reset()

func (*Actions) String

func (x *Actions) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use ObjectIds.ProtoReflect.Descriptor instead.

func (*ObjectIds) GetIds

func (x *ObjectIds) GetIds() []uint64

func (*ObjectIds) ProtoMessage

func (*ObjectIds) ProtoMessage()

func (*ObjectIds) ProtoReflect

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

func (*ObjectIds) Reset

func (x *ObjectIds) Reset()

func (*ObjectIds) String

func (x *ObjectIds) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetSuccess added in v1.3.0

func (x *Response) GetSuccess() bool

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

func (*Response) Reset added in v1.3.0

func (x *Response) Reset()

func (*Response) String added in v1.3.0

func (x *Response) String() string

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) 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

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) Descriptor() ([]byte, []int)

Deprecated: Use Role.ProtoReflect.Descriptor instead.

func (*Role) GetList

func (x *Role) GetList() []RightAction

func (*Role) GetName

func (x *Role) GetName() string

func (*Role) GetObjectId

func (x *Role) GetObjectId() uint64

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

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) Descriptor() ([]byte, []int)

Deprecated: Use Roles.ProtoReflect.Descriptor instead.

func (*Roles) GetList

func (x *Roles) GetList() []*Role

func (*Roles) ProtoMessage

func (*Roles) ProtoMessage()

func (*Roles) ProtoReflect

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

func (*Roles) Reset

func (x *Roles) Reset()

func (*Roles) String

func (x *Roles) String() string

type UnimplementedRightServer

type UnimplementedRightServer struct {
}

UnimplementedRightServer must be embedded to have forward compatible implementations.

func (UnimplementedRightServer) AuthQuery

func (UnimplementedRightServer) ListRoles

func (UnimplementedRightServer) ListUserRoles added in v1.2.0

func (UnimplementedRightServer) RoleRight

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) Descriptor() ([]byte, []int)

Deprecated: Use UserId.ProtoReflect.Descriptor instead.

func (*UserId) GetId added in v1.2.0

func (x *UserId) GetId() uint64

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

func (*UserId) Reset added in v1.2.0

func (x *UserId) Reset()

func (*UserId) String added in v1.2.0

func (x *UserId) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use UserRight.ProtoReflect.Descriptor instead.

func (*UserRight) GetList

func (x *UserRight) GetList() []*RoleRequest

func (*UserRight) GetUserId

func (x *UserRight) GetUserId() uint64

func (*UserRight) ProtoMessage

func (*UserRight) ProtoMessage()

func (*UserRight) ProtoReflect

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

func (*UserRight) Reset

func (x *UserRight) Reset()

func (*UserRight) String

func (x *UserRight) String() string

Jump to

Keyboard shortcuts

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