permission

package
v0.0.0-...-5b44b94 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PermissionNode_PermissionState_name = map[int32]string{
		0: "ALLOW",
		1: "DENY",
	}
	PermissionNode_PermissionState_value = map[string]int32{
		"ALLOW": 0,
		"DENY":  1,
	}
)

Enum value maps for PermissionNode_PermissionState.

View Source
var File_permission_proto protoreflect.FileDescriptor
View Source
var PermissionService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "towerdefence.cc.service.permission.PermissionService",
	HandlerType: (*PermissionServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetRoles",
			Handler:    _PermissionService_GetRoles_Handler,
		},
		{
			MethodName: "GetPlayerRoles",
			Handler:    _PermissionService_GetPlayerRoles_Handler,
		},
		{
			MethodName: "CreateRole",
			Handler:    _PermissionService_CreateRole_Handler,
		},
		{
			MethodName: "UpdateRole",
			Handler:    _PermissionService_UpdateRole_Handler,
		},
		{
			MethodName: "AddRoleToPlayer",
			Handler:    _PermissionService_AddRoleToPlayer_Handler,
		},
		{
			MethodName: "RemoveRoleFromPlayer",
			Handler:    _PermissionService_RemoveRoleFromPlayer_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "permission.proto",
}

PermissionService_ServiceDesc is the grpc.ServiceDesc for PermissionService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterPermissionServiceServer

func RegisterPermissionServiceServer(s grpc.ServiceRegistrar, srv PermissionServiceServer)

Types

type AddRoleToPlayerRequest

type AddRoleToPlayerRequest struct {
	PlayerId string `protobuf:"bytes,1,opt,name=player_id,json=playerId,proto3" json:"player_id,omitempty"`
	RoleId   string `protobuf:"bytes,2,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"`
	// contains filtered or unexported fields
}

func (*AddRoleToPlayerRequest) Descriptor deprecated

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

Deprecated: Use AddRoleToPlayerRequest.ProtoReflect.Descriptor instead.

func (*AddRoleToPlayerRequest) GetPlayerId

func (x *AddRoleToPlayerRequest) GetPlayerId() string

func (*AddRoleToPlayerRequest) GetRoleId

func (x *AddRoleToPlayerRequest) GetRoleId() string

func (*AddRoleToPlayerRequest) ProtoMessage

func (*AddRoleToPlayerRequest) ProtoMessage()

func (*AddRoleToPlayerRequest) ProtoReflect

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

func (*AddRoleToPlayerRequest) Reset

func (x *AddRoleToPlayerRequest) Reset()

func (*AddRoleToPlayerRequest) String

func (x *AddRoleToPlayerRequest) String() string

type PermissionNode

type PermissionNode struct {
	Node  string                         `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
	State PermissionNode_PermissionState `` /* 135-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*PermissionNode) Descriptor deprecated

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

Deprecated: Use PermissionNode.ProtoReflect.Descriptor instead.

func (*PermissionNode) GetNode

func (x *PermissionNode) GetNode() string

func (*PermissionNode) GetState

func (*PermissionNode) ProtoMessage

func (*PermissionNode) ProtoMessage()

func (*PermissionNode) ProtoReflect

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

func (*PermissionNode) Reset

func (x *PermissionNode) Reset()

func (*PermissionNode) String

func (x *PermissionNode) String() string

type PermissionNode_PermissionState

type PermissionNode_PermissionState int32
const (
	PermissionNode_ALLOW PermissionNode_PermissionState = 0
	PermissionNode_DENY  PermissionNode_PermissionState = 1
)

func (PermissionNode_PermissionState) Descriptor

func (PermissionNode_PermissionState) Enum

func (PermissionNode_PermissionState) EnumDescriptor deprecated

func (PermissionNode_PermissionState) EnumDescriptor() ([]byte, []int)

Deprecated: Use PermissionNode_PermissionState.Descriptor instead.

func (PermissionNode_PermissionState) Number

func (PermissionNode_PermissionState) String

func (PermissionNode_PermissionState) Type

type PermissionServiceClient

type PermissionServiceClient interface {
	GetRoles(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*RolesResponse, error)
	GetPlayerRoles(ctx context.Context, in *PlayerRequest, opts ...grpc.CallOption) (*PlayerRolesResponse, error)
	CreateRole(ctx context.Context, in *RoleCreateRequest, opts ...grpc.CallOption) (*RoleResponse, error)
	UpdateRole(ctx context.Context, in *RoleUpdateRequest, opts ...grpc.CallOption) (*RoleResponse, error)
	AddRoleToPlayer(ctx context.Context, in *AddRoleToPlayerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	RemoveRoleFromPlayer(ctx context.Context, in *RemoveRoleFromPlayerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

PermissionServiceClient is the client API for PermissionService 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.

type PermissionServiceServer

type PermissionServiceServer interface {
	GetRoles(context.Context, *emptypb.Empty) (*RolesResponse, error)
	GetPlayerRoles(context.Context, *PlayerRequest) (*PlayerRolesResponse, error)
	CreateRole(context.Context, *RoleCreateRequest) (*RoleResponse, error)
	UpdateRole(context.Context, *RoleUpdateRequest) (*RoleResponse, error)
	AddRoleToPlayer(context.Context, *AddRoleToPlayerRequest) (*emptypb.Empty, error)
	RemoveRoleFromPlayer(context.Context, *RemoveRoleFromPlayerRequest) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

PermissionServiceServer is the server API for PermissionService service. All implementations must embed UnimplementedPermissionServiceServer for forward compatibility

type PlayerRequest

type PlayerRequest struct {
	PlayerId string `protobuf:"bytes,1,opt,name=player_id,json=playerId,proto3" json:"player_id,omitempty"`
	// contains filtered or unexported fields
}

func (*PlayerRequest) Descriptor deprecated

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

Deprecated: Use PlayerRequest.ProtoReflect.Descriptor instead.

func (*PlayerRequest) GetPlayerId

func (x *PlayerRequest) GetPlayerId() string

func (*PlayerRequest) ProtoMessage

func (*PlayerRequest) ProtoMessage()

func (*PlayerRequest) ProtoReflect

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

func (*PlayerRequest) Reset

func (x *PlayerRequest) Reset()

func (*PlayerRequest) String

func (x *PlayerRequest) String() string

type PlayerRolesResponse

type PlayerRolesResponse struct {
	RoleIds []string `protobuf:"bytes,1,rep,name=role_ids,json=roleIds,proto3" json:"role_ids,omitempty"`
	// contains filtered or unexported fields
}

func (*PlayerRolesResponse) Descriptor deprecated

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

Deprecated: Use PlayerRolesResponse.ProtoReflect.Descriptor instead.

func (*PlayerRolesResponse) GetRoleIds

func (x *PlayerRolesResponse) GetRoleIds() []string

func (*PlayerRolesResponse) ProtoMessage

func (*PlayerRolesResponse) ProtoMessage()

func (*PlayerRolesResponse) ProtoReflect

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

func (*PlayerRolesResponse) Reset

func (x *PlayerRolesResponse) Reset()

func (*PlayerRolesResponse) String

func (x *PlayerRolesResponse) String() string

type RemoveRoleFromPlayerRequest

type RemoveRoleFromPlayerRequest struct {
	PlayerId string `protobuf:"bytes,1,opt,name=player_id,json=playerId,proto3" json:"player_id,omitempty"`
	RoleId   string `protobuf:"bytes,2,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"`
	// contains filtered or unexported fields
}

func (*RemoveRoleFromPlayerRequest) Descriptor deprecated

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

Deprecated: Use RemoveRoleFromPlayerRequest.ProtoReflect.Descriptor instead.

func (*RemoveRoleFromPlayerRequest) GetPlayerId

func (x *RemoveRoleFromPlayerRequest) GetPlayerId() string

func (*RemoveRoleFromPlayerRequest) GetRoleId

func (x *RemoveRoleFromPlayerRequest) GetRoleId() string

func (*RemoveRoleFromPlayerRequest) ProtoMessage

func (*RemoveRoleFromPlayerRequest) ProtoMessage()

func (*RemoveRoleFromPlayerRequest) ProtoReflect

func (*RemoveRoleFromPlayerRequest) Reset

func (x *RemoveRoleFromPlayerRequest) Reset()

func (*RemoveRoleFromPlayerRequest) String

func (x *RemoveRoleFromPlayerRequest) String() string

type RoleCreateRequest

type RoleCreateRequest struct {
	Id            string  `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Priority      uint32  `protobuf:"varint,2,opt,name=priority,proto3" json:"priority,omitempty"`
	DisplayPrefix *string `protobuf:"bytes,3,opt,name=display_prefix,json=displayPrefix,proto3,oneof" json:"display_prefix,omitempty"`
	DisplayName   *string `protobuf:"bytes,4,opt,name=display_name,json=displayName,proto3,oneof" json:"display_name,omitempty"`
	// contains filtered or unexported fields
}

func (*RoleCreateRequest) Descriptor deprecated

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

Deprecated: Use RoleCreateRequest.ProtoReflect.Descriptor instead.

func (*RoleCreateRequest) GetDisplayName

func (x *RoleCreateRequest) GetDisplayName() string

func (*RoleCreateRequest) GetDisplayPrefix

func (x *RoleCreateRequest) GetDisplayPrefix() string

func (*RoleCreateRequest) GetId

func (x *RoleCreateRequest) GetId() string

func (*RoleCreateRequest) GetPriority

func (x *RoleCreateRequest) GetPriority() uint32

func (*RoleCreateRequest) ProtoMessage

func (*RoleCreateRequest) ProtoMessage()

func (*RoleCreateRequest) ProtoReflect

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

func (*RoleCreateRequest) Reset

func (x *RoleCreateRequest) Reset()

func (*RoleCreateRequest) String

func (x *RoleCreateRequest) String() string

type RoleResponse

type RoleResponse struct {
	Id            string            `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Priority      uint32            `protobuf:"varint,2,opt,name=priority,proto3" json:"priority,omitempty"`
	DisplayPrefix *string           `protobuf:"bytes,3,opt,name=display_prefix,json=displayPrefix,proto3,oneof" json:"display_prefix,omitempty"`
	DisplayName   *string           `protobuf:"bytes,4,opt,name=display_name,json=displayName,proto3,oneof" json:"display_name,omitempty"`
	Permissions   []*PermissionNode `protobuf:"bytes,5,rep,name=permissions,proto3" json:"permissions,omitempty"`
	// contains filtered or unexported fields
}

func (*RoleResponse) Descriptor deprecated

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

Deprecated: Use RoleResponse.ProtoReflect.Descriptor instead.

func (*RoleResponse) GetDisplayName

func (x *RoleResponse) GetDisplayName() string

func (*RoleResponse) GetDisplayPrefix

func (x *RoleResponse) GetDisplayPrefix() string

func (*RoleResponse) GetId

func (x *RoleResponse) GetId() string

func (*RoleResponse) GetPermissions

func (x *RoleResponse) GetPermissions() []*PermissionNode

func (*RoleResponse) GetPriority

func (x *RoleResponse) GetPriority() uint32

func (*RoleResponse) ProtoMessage

func (*RoleResponse) ProtoMessage()

func (*RoleResponse) ProtoReflect

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

func (*RoleResponse) Reset

func (x *RoleResponse) Reset()

func (*RoleResponse) String

func (x *RoleResponse) String() string

type RoleUpdateRequest

type RoleUpdateRequest struct {
	Id               string            `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Priority         *uint32           `protobuf:"varint,2,opt,name=priority,proto3,oneof" json:"priority,omitempty"`
	DisplayPrefix    *string           `protobuf:"bytes,3,opt,name=display_prefix,json=displayPrefix,proto3,oneof" json:"display_prefix,omitempty"`
	DisplayName      *string           `protobuf:"bytes,4,opt,name=display_name,json=displayName,proto3,oneof" json:"display_name,omitempty"`
	SetPermissions   []*PermissionNode `protobuf:"bytes,5,rep,name=set_permissions,json=setPermissions,proto3" json:"set_permissions,omitempty"`
	UnsetPermissions []string          `protobuf:"bytes,6,rep,name=unset_permissions,json=unsetPermissions,proto3" json:"unset_permissions,omitempty"`
	// contains filtered or unexported fields
}

func (*RoleUpdateRequest) Descriptor deprecated

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

Deprecated: Use RoleUpdateRequest.ProtoReflect.Descriptor instead.

func (*RoleUpdateRequest) GetDisplayName

func (x *RoleUpdateRequest) GetDisplayName() string

func (*RoleUpdateRequest) GetDisplayPrefix

func (x *RoleUpdateRequest) GetDisplayPrefix() string

func (*RoleUpdateRequest) GetId

func (x *RoleUpdateRequest) GetId() string

func (*RoleUpdateRequest) GetPriority

func (x *RoleUpdateRequest) GetPriority() uint32

func (*RoleUpdateRequest) GetSetPermissions

func (x *RoleUpdateRequest) GetSetPermissions() []*PermissionNode

func (*RoleUpdateRequest) GetUnsetPermissions

func (x *RoleUpdateRequest) GetUnsetPermissions() []string

func (*RoleUpdateRequest) ProtoMessage

func (*RoleUpdateRequest) ProtoMessage()

func (*RoleUpdateRequest) ProtoReflect

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

func (*RoleUpdateRequest) Reset

func (x *RoleUpdateRequest) Reset()

func (*RoleUpdateRequest) String

func (x *RoleUpdateRequest) String() string

type RolesResponse

type RolesResponse struct {
	Roles []*RoleResponse `protobuf:"bytes,1,rep,name=roles,proto3" json:"roles,omitempty"`
	// contains filtered or unexported fields
}

func (*RolesResponse) Descriptor deprecated

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

Deprecated: Use RolesResponse.ProtoReflect.Descriptor instead.

func (*RolesResponse) GetRoles

func (x *RolesResponse) GetRoles() []*RoleResponse

func (*RolesResponse) ProtoMessage

func (*RolesResponse) ProtoMessage()

func (*RolesResponse) ProtoReflect

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

func (*RolesResponse) Reset

func (x *RolesResponse) Reset()

func (*RolesResponse) String

func (x *RolesResponse) String() string

type UnimplementedPermissionServiceServer

type UnimplementedPermissionServiceServer struct {
}

UnimplementedPermissionServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedPermissionServiceServer) AddRoleToPlayer

func (UnimplementedPermissionServiceServer) CreateRole

func (UnimplementedPermissionServiceServer) GetPlayerRoles

func (UnimplementedPermissionServiceServer) GetRoles

func (UnimplementedPermissionServiceServer) RemoveRoleFromPlayer

func (UnimplementedPermissionServiceServer) UpdateRole

type UnsafePermissionServiceServer

type UnsafePermissionServiceServer interface {
	// contains filtered or unexported methods
}

UnsafePermissionServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PermissionServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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