permission

package
v0.0.0-...-66adcdc Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PermissionService_GetAllRoles_FullMethodName          = "/emortal.grpc.permission.PermissionService/GetAllRoles"
	PermissionService_GetPlayerRoles_FullMethodName       = "/emortal.grpc.permission.PermissionService/GetPlayerRoles"
	PermissionService_CreateRole_FullMethodName           = "/emortal.grpc.permission.PermissionService/CreateRole"
	PermissionService_UpdateRole_FullMethodName           = "/emortal.grpc.permission.PermissionService/UpdateRole"
	PermissionService_AddRoleToPlayer_FullMethodName      = "/emortal.grpc.permission.PermissionService/AddRoleToPlayer"
	PermissionService_RemoveRoleFromPlayer_FullMethodName = "/emortal.grpc.permission.PermissionService/RemoveRoleFromPlayer"
)

Variables

View Source
var (
	AddRoleToPlayerError_ErrorType_name = map[int32]string{
		0: "PLAYER_NOT_FOUND",
		1: "ROLE_NOT_FOUND",
		2: "ALREADY_HAS_ROLE",
	}
	AddRoleToPlayerError_ErrorType_value = map[string]int32{
		"PLAYER_NOT_FOUND": 0,
		"ROLE_NOT_FOUND":   1,
		"ALREADY_HAS_ROLE": 2,
	}
)

Enum value maps for AddRoleToPlayerError_ErrorType.

View Source
var (
	RemoveRoleFromPlayerError_ErrorType_name = map[int32]string{
		0: "PLAYER_NOT_FOUND",
		1: "DOES_NOT_HAVE_ROLE",
	}
	RemoveRoleFromPlayerError_ErrorType_value = map[string]int32{
		"PLAYER_NOT_FOUND":   0,
		"DOES_NOT_HAVE_ROLE": 1,
	}
)

Enum value maps for RemoveRoleFromPlayerError_ErrorType.

View Source
var File_permission_grpc_proto protoreflect.FileDescriptor
View Source
var PermissionService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "emortal.grpc.permission.PermissionService",
	HandlerType: (*PermissionServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetAllRoles",
			Handler:    _PermissionService_GetAllRoles_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/grpc.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 AddRoleToPlayerError

type AddRoleToPlayerError struct {
	ErrorType AddRoleToPlayerError_ErrorType `` /* 149-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*AddRoleToPlayerError) Descriptor deprecated

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

Deprecated: Use AddRoleToPlayerError.ProtoReflect.Descriptor instead.

func (*AddRoleToPlayerError) GetErrorType

func (*AddRoleToPlayerError) ProtoMessage

func (*AddRoleToPlayerError) ProtoMessage()

func (*AddRoleToPlayerError) ProtoReflect

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

func (*AddRoleToPlayerError) Reset

func (x *AddRoleToPlayerError) Reset()

func (*AddRoleToPlayerError) String

func (x *AddRoleToPlayerError) String() string

type AddRoleToPlayerError_ErrorType

type AddRoleToPlayerError_ErrorType int32
const (
	AddRoleToPlayerError_PLAYER_NOT_FOUND AddRoleToPlayerError_ErrorType = 0
	AddRoleToPlayerError_ROLE_NOT_FOUND   AddRoleToPlayerError_ErrorType = 1
	AddRoleToPlayerError_ALREADY_HAS_ROLE AddRoleToPlayerError_ErrorType = 2
)

func (AddRoleToPlayerError_ErrorType) Descriptor

func (AddRoleToPlayerError_ErrorType) Enum

func (AddRoleToPlayerError_ErrorType) EnumDescriptor deprecated

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

Deprecated: Use AddRoleToPlayerError_ErrorType.Descriptor instead.

func (AddRoleToPlayerError_ErrorType) Number

func (AddRoleToPlayerError_ErrorType) String

func (AddRoleToPlayerError_ErrorType) Type

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 AddRoleToPlayerResponse

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

func (*AddRoleToPlayerResponse) Descriptor deprecated

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

Deprecated: Use AddRoleToPlayerResponse.ProtoReflect.Descriptor instead.

func (*AddRoleToPlayerResponse) ProtoMessage

func (*AddRoleToPlayerResponse) ProtoMessage()

func (*AddRoleToPlayerResponse) ProtoReflect

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

func (*AddRoleToPlayerResponse) Reset

func (x *AddRoleToPlayerResponse) Reset()

func (*AddRoleToPlayerResponse) String

func (x *AddRoleToPlayerResponse) String() string

type CreateRoleResponse

type CreateRoleResponse struct {
	Role *permission.Role `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateRoleResponse) Descriptor deprecated

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

Deprecated: Use CreateRoleResponse.ProtoReflect.Descriptor instead.

func (*CreateRoleResponse) GetRole

func (x *CreateRoleResponse) GetRole() *permission.Role

func (*CreateRoleResponse) ProtoMessage

func (*CreateRoleResponse) ProtoMessage()

func (*CreateRoleResponse) ProtoReflect

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

func (*CreateRoleResponse) Reset

func (x *CreateRoleResponse) Reset()

func (*CreateRoleResponse) String

func (x *CreateRoleResponse) String() string

type GetAllRolesRequest

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

func (*GetAllRolesRequest) Descriptor deprecated

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

Deprecated: Use GetAllRolesRequest.ProtoReflect.Descriptor instead.

func (*GetAllRolesRequest) ProtoMessage

func (*GetAllRolesRequest) ProtoMessage()

func (*GetAllRolesRequest) ProtoReflect

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

func (*GetAllRolesRequest) Reset

func (x *GetAllRolesRequest) Reset()

func (*GetAllRolesRequest) String

func (x *GetAllRolesRequest) String() string

type GetAllRolesResponse

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

func (*GetAllRolesResponse) Descriptor deprecated

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

Deprecated: Use GetAllRolesResponse.ProtoReflect.Descriptor instead.

func (*GetAllRolesResponse) GetRoles

func (x *GetAllRolesResponse) GetRoles() []*permission.Role

func (*GetAllRolesResponse) ProtoMessage

func (*GetAllRolesResponse) ProtoMessage()

func (*GetAllRolesResponse) ProtoReflect

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

func (*GetAllRolesResponse) Reset

func (x *GetAllRolesResponse) Reset()

func (*GetAllRolesResponse) String

func (x *GetAllRolesResponse) String() string

type GetPlayerRolesRequest

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

func (*GetPlayerRolesRequest) Descriptor deprecated

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

Deprecated: Use GetPlayerRolesRequest.ProtoReflect.Descriptor instead.

func (*GetPlayerRolesRequest) GetPlayerId

func (x *GetPlayerRolesRequest) GetPlayerId() string

func (*GetPlayerRolesRequest) ProtoMessage

func (*GetPlayerRolesRequest) ProtoMessage()

func (*GetPlayerRolesRequest) ProtoReflect

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

func (*GetPlayerRolesRequest) Reset

func (x *GetPlayerRolesRequest) Reset()

func (*GetPlayerRolesRequest) String

func (x *GetPlayerRolesRequest) String() string

type PermissionServiceClient

type PermissionServiceClient interface {
	GetAllRoles(ctx context.Context, in *GetAllRolesRequest, opts ...grpc.CallOption) (*GetAllRolesResponse, error)
	GetPlayerRoles(ctx context.Context, in *GetPlayerRolesRequest, opts ...grpc.CallOption) (*PlayerRolesResponse, error)
	CreateRole(ctx context.Context, in *RoleCreateRequest, opts ...grpc.CallOption) (*CreateRoleResponse, error)
	UpdateRole(ctx context.Context, in *RoleUpdateRequest, opts ...grpc.CallOption) (*UpdateRoleResponse, error)
	AddRoleToPlayer(ctx context.Context, in *AddRoleToPlayerRequest, opts ...grpc.CallOption) (*AddRoleToPlayerResponse, error)
	RemoveRoleFromPlayer(ctx context.Context, in *RemoveRoleFromPlayerRequest, opts ...grpc.CallOption) (*RemoveRoleFromPlayerResponse, 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 {
	GetAllRoles(context.Context, *GetAllRolesRequest) (*GetAllRolesResponse, error)
	GetPlayerRoles(context.Context, *GetPlayerRolesRequest) (*PlayerRolesResponse, error)
	CreateRole(context.Context, *RoleCreateRequest) (*CreateRoleResponse, error)
	UpdateRole(context.Context, *RoleUpdateRequest) (*UpdateRoleResponse, error)
	AddRoleToPlayer(context.Context, *AddRoleToPlayerRequest) (*AddRoleToPlayerResponse, error)
	RemoveRoleFromPlayer(context.Context, *RemoveRoleFromPlayerRequest) (*RemoveRoleFromPlayerResponse, error)
	// contains filtered or unexported methods
}

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

type PlayerRolesResponse

type PlayerRolesResponse struct {
	RoleIds []string `protobuf:"bytes,1,rep,name=role_ids,json=roleIds,proto3" json:"role_ids,omitempty"`
	// active_display_name_role_id is the role that the player has the highest priority for
	// which has a display name set. If no roles have a display name set, this will be empty.
	ActiveDisplayNameRoleId *string `` /* 142-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*PlayerRolesResponse) Descriptor deprecated

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

Deprecated: Use PlayerRolesResponse.ProtoReflect.Descriptor instead.

func (*PlayerRolesResponse) GetActiveDisplayNameRoleId

func (x *PlayerRolesResponse) GetActiveDisplayNameRoleId() string

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 RemoveRoleFromPlayerError

type RemoveRoleFromPlayerError struct {
	ErrorType RemoveRoleFromPlayerError_ErrorType `` /* 154-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*RemoveRoleFromPlayerError) Descriptor deprecated

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

Deprecated: Use RemoveRoleFromPlayerError.ProtoReflect.Descriptor instead.

func (*RemoveRoleFromPlayerError) GetErrorType

func (*RemoveRoleFromPlayerError) ProtoMessage

func (*RemoveRoleFromPlayerError) ProtoMessage()

func (*RemoveRoleFromPlayerError) ProtoReflect

func (*RemoveRoleFromPlayerError) Reset

func (x *RemoveRoleFromPlayerError) Reset()

func (*RemoveRoleFromPlayerError) String

func (x *RemoveRoleFromPlayerError) String() string

type RemoveRoleFromPlayerError_ErrorType

type RemoveRoleFromPlayerError_ErrorType int32
const (
	RemoveRoleFromPlayerError_PLAYER_NOT_FOUND   RemoveRoleFromPlayerError_ErrorType = 0
	RemoveRoleFromPlayerError_DOES_NOT_HAVE_ROLE RemoveRoleFromPlayerError_ErrorType = 1
)

func (RemoveRoleFromPlayerError_ErrorType) Descriptor

func (RemoveRoleFromPlayerError_ErrorType) Enum

func (RemoveRoleFromPlayerError_ErrorType) EnumDescriptor deprecated

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

Deprecated: Use RemoveRoleFromPlayerError_ErrorType.Descriptor instead.

func (RemoveRoleFromPlayerError_ErrorType) Number

func (RemoveRoleFromPlayerError_ErrorType) String

func (RemoveRoleFromPlayerError_ErrorType) Type

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 RemoveRoleFromPlayerResponse

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

func (*RemoveRoleFromPlayerResponse) Descriptor deprecated

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

Deprecated: Use RemoveRoleFromPlayerResponse.ProtoReflect.Descriptor instead.

func (*RemoveRoleFromPlayerResponse) ProtoMessage

func (*RemoveRoleFromPlayerResponse) ProtoMessage()

func (*RemoveRoleFromPlayerResponse) ProtoReflect

func (*RemoveRoleFromPlayerResponse) Reset

func (x *RemoveRoleFromPlayerResponse) Reset()

func (*RemoveRoleFromPlayerResponse) 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"`
	// display_name is the entire username section in Go template format
	// e.g. <red>{{.Username}}</red>
	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) 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 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"`
	DisplayName      *string                      `protobuf:"bytes,4,opt,name=display_name,json=displayName,proto3,oneof" json:"display_name,omitempty"`
	SetPermissions   []*permission.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) GetId

func (x *RoleUpdateRequest) GetId() string

func (*RoleUpdateRequest) GetPriority

func (x *RoleUpdateRequest) GetPriority() uint32

func (*RoleUpdateRequest) GetSetPermissions

func (x *RoleUpdateRequest) GetSetPermissions() []*permission.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 UnimplementedPermissionServiceServer

type UnimplementedPermissionServiceServer struct{}

UnimplementedPermissionServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedPermissionServiceServer) AddRoleToPlayer

func (UnimplementedPermissionServiceServer) CreateRole

func (UnimplementedPermissionServiceServer) GetAllRoles

func (UnimplementedPermissionServiceServer) GetPlayerRoles

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.

type UpdateRoleResponse

type UpdateRoleResponse struct {
	Role *permission.Role `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateRoleResponse) Descriptor deprecated

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

Deprecated: Use UpdateRoleResponse.ProtoReflect.Descriptor instead.

func (*UpdateRoleResponse) GetRole

func (x *UpdateRoleResponse) GetRole() *permission.Role

func (*UpdateRoleResponse) ProtoMessage

func (*UpdateRoleResponse) ProtoMessage()

func (*UpdateRoleResponse) ProtoReflect

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

func (*UpdateRoleResponse) Reset

func (x *UpdateRoleResponse) Reset()

func (*UpdateRoleResponse) String

func (x *UpdateRoleResponse) String() string

Jump to

Keyboard shortcuts

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