sys

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_api_sys_sys_proto protoreflect.FileDescriptor
View Source
var Sys_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.sys.Sys",
	HandlerType: (*SysServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Auth",
			Handler:    _Sys_Auth_Handler,
		},
		{
			MethodName: "CheckResource",
			Handler:    _Sys_CheckResource_Handler,
		},
		{
			MethodName: "CheckRoleLevel",
			Handler:    _Sys_CheckRoleLevel_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/sys/sys.proto",
}

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

Functions

func RegisterSysHTTPServer

func RegisterSysHTTPServer(s *http.Server, srv SysHTTPServer)

func RegisterSysServer

func RegisterSysServer(s grpc.ServiceRegistrar, srv SysServer)

Types

type AuthRequest

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

func (*AuthRequest) Descriptor deprecated

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

Deprecated: Use AuthRequest.ProtoReflect.Descriptor instead.

func (*AuthRequest) GetAccessToken

func (x *AuthRequest) GetAccessToken() string

func (*AuthRequest) ProtoMessage

func (*AuthRequest) ProtoMessage()

func (*AuthRequest) ProtoReflect

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

func (*AuthRequest) Reset

func (x *AuthRequest) Reset()

func (*AuthRequest) String

func (x *AuthRequest) String() string

func (*AuthRequest) Validate

func (m *AuthRequest) Validate() error

Validate checks the field values on AuthRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type AuthRequestValidationError

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

AuthRequestValidationError is the validation error returned by AuthRequest.Validate if the designated constraints aren't met.

func (AuthRequestValidationError) Cause

Cause function returns cause value.

func (AuthRequestValidationError) Error

Error satisfies the builtin error interface

func (AuthRequestValidationError) ErrorName

func (e AuthRequestValidationError) ErrorName() string

ErrorName returns error name.

func (AuthRequestValidationError) Field

Field function returns field value.

func (AuthRequestValidationError) Key

Key function returns key value.

func (AuthRequestValidationError) Reason

Reason function returns reason value.

type AuthResp

type AuthResp struct {
	DataScope string `protobuf:"bytes,1,opt,name=dataScope,proto3" json:"dataScope,omitempty"`
	UserId    uint64 `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"`
	RoleId    uint64 `protobuf:"varint,3,opt,name=roleId,proto3" json:"roleId,omitempty"`
	RoleKey   string `protobuf:"bytes,4,opt,name=roleKey,proto3" json:"roleKey,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthResp) Descriptor deprecated

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

Deprecated: Use AuthResp.ProtoReflect.Descriptor instead.

func (*AuthResp) GetDataScope

func (x *AuthResp) GetDataScope() string

func (*AuthResp) GetRoleId

func (x *AuthResp) GetRoleId() uint64

func (*AuthResp) GetRoleKey

func (x *AuthResp) GetRoleKey() string

func (*AuthResp) GetUserId

func (x *AuthResp) GetUserId() uint64

func (*AuthResp) ProtoMessage

func (*AuthResp) ProtoMessage()

func (*AuthResp) ProtoReflect

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

func (*AuthResp) Reset

func (x *AuthResp) Reset()

func (*AuthResp) String

func (x *AuthResp) String() string

func (*AuthResp) Validate

func (m *AuthResp) Validate() error

Validate checks the field values on AuthResp with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type AuthRespValidationError

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

AuthRespValidationError is the validation error returned by AuthResp.Validate if the designated constraints aren't met.

func (AuthRespValidationError) Cause

func (e AuthRespValidationError) Cause() error

Cause function returns cause value.

func (AuthRespValidationError) Error

func (e AuthRespValidationError) Error() string

Error satisfies the builtin error interface

func (AuthRespValidationError) ErrorName

func (e AuthRespValidationError) ErrorName() string

ErrorName returns error name.

func (AuthRespValidationError) Field

func (e AuthRespValidationError) Field() string

Field function returns field value.

func (AuthRespValidationError) Key

func (e AuthRespValidationError) Key() bool

Key function returns key value.

func (AuthRespValidationError) Reason

func (e AuthRespValidationError) Reason() string

Reason function returns reason value.

type CheckResourceReply

type CheckResourceReply struct {
	Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
	// contains filtered or unexported fields
}

func (*CheckResourceReply) Descriptor deprecated

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

Deprecated: Use CheckResourceReply.ProtoReflect.Descriptor instead.

func (*CheckResourceReply) GetOk

func (x *CheckResourceReply) GetOk() bool

func (*CheckResourceReply) ProtoMessage

func (*CheckResourceReply) ProtoMessage()

func (*CheckResourceReply) ProtoReflect

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

func (*CheckResourceReply) Reset

func (x *CheckResourceReply) Reset()

func (*CheckResourceReply) String

func (x *CheckResourceReply) String() string

func (*CheckResourceReply) Validate

func (m *CheckResourceReply) Validate() error

Validate checks the field values on CheckResourceReply with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type CheckResourceReplyValidationError

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

CheckResourceReplyValidationError is the validation error returned by CheckResourceReply.Validate if the designated constraints aren't met.

func (CheckResourceReplyValidationError) Cause

Cause function returns cause value.

func (CheckResourceReplyValidationError) Error

Error satisfies the builtin error interface

func (CheckResourceReplyValidationError) ErrorName

ErrorName returns error name.

func (CheckResourceReplyValidationError) Field

Field function returns field value.

func (CheckResourceReplyValidationError) Key

Key function returns key value.

func (CheckResourceReplyValidationError) Reason

Reason function returns reason value.

type CheckResourceRequest

type CheckResourceRequest 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"`
	// contains filtered or unexported fields
}

func (*CheckResourceRequest) Descriptor deprecated

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

Deprecated: Use CheckResourceRequest.ProtoReflect.Descriptor instead.

func (*CheckResourceRequest) GetMethod

func (x *CheckResourceRequest) GetMethod() string

func (*CheckResourceRequest) GetPath

func (x *CheckResourceRequest) GetPath() string

func (*CheckResourceRequest) ProtoMessage

func (*CheckResourceRequest) ProtoMessage()

func (*CheckResourceRequest) ProtoReflect

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

func (*CheckResourceRequest) Reset

func (x *CheckResourceRequest) Reset()

func (*CheckResourceRequest) String

func (x *CheckResourceRequest) String() string

func (*CheckResourceRequest) Validate

func (m *CheckResourceRequest) Validate() error

Validate checks the field values on CheckResourceRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type CheckResourceRequestValidationError

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

CheckResourceRequestValidationError is the validation error returned by CheckResourceRequest.Validate if the designated constraints aren't met.

func (CheckResourceRequestValidationError) Cause

Cause function returns cause value.

func (CheckResourceRequestValidationError) Error

Error satisfies the builtin error interface

func (CheckResourceRequestValidationError) ErrorName

ErrorName returns error name.

func (CheckResourceRequestValidationError) Field

Field function returns field value.

func (CheckResourceRequestValidationError) Key

Key function returns key value.

func (CheckResourceRequestValidationError) Reason

Reason function returns reason value.

type CheckRoleLevelReply

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

func (*CheckRoleLevelReply) Descriptor deprecated

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

Deprecated: Use CheckRoleLevelReply.ProtoReflect.Descriptor instead.

func (*CheckRoleLevelReply) ProtoMessage

func (*CheckRoleLevelReply) ProtoMessage()

func (*CheckRoleLevelReply) ProtoReflect

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

func (*CheckRoleLevelReply) Reset

func (x *CheckRoleLevelReply) Reset()

func (*CheckRoleLevelReply) String

func (x *CheckRoleLevelReply) String() string

func (*CheckRoleLevelReply) Validate

func (m *CheckRoleLevelReply) Validate() error

Validate checks the field values on CheckRoleLevelReply with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type CheckRoleLevelReplyValidationError

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

CheckRoleLevelReplyValidationError is the validation error returned by CheckRoleLevelReply.Validate if the designated constraints aren't met.

func (CheckRoleLevelReplyValidationError) Cause

Cause function returns cause value.

func (CheckRoleLevelReplyValidationError) Error

Error satisfies the builtin error interface

func (CheckRoleLevelReplyValidationError) ErrorName

ErrorName returns error name.

func (CheckRoleLevelReplyValidationError) Field

Field function returns field value.

func (CheckRoleLevelReplyValidationError) Key

Key function returns key value.

func (CheckRoleLevelReplyValidationError) Reason

Reason function returns reason value.

type CheckRoleLevelRequest

type CheckRoleLevelRequest struct {
	RoleId int32 `protobuf:"varint,1,opt,name=roleId,proto3" json:"roleId,omitempty"`
	Target int32 `protobuf:"varint,2,opt,name=target,proto3" json:"target,omitempty"`
	// contains filtered or unexported fields
}

func (*CheckRoleLevelRequest) Descriptor deprecated

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

Deprecated: Use CheckRoleLevelRequest.ProtoReflect.Descriptor instead.

func (*CheckRoleLevelRequest) GetRoleId

func (x *CheckRoleLevelRequest) GetRoleId() int32

func (*CheckRoleLevelRequest) GetTarget

func (x *CheckRoleLevelRequest) GetTarget() int32

func (*CheckRoleLevelRequest) ProtoMessage

func (*CheckRoleLevelRequest) ProtoMessage()

func (*CheckRoleLevelRequest) ProtoReflect

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

func (*CheckRoleLevelRequest) Reset

func (x *CheckRoleLevelRequest) Reset()

func (*CheckRoleLevelRequest) String

func (x *CheckRoleLevelRequest) String() string

func (*CheckRoleLevelRequest) Validate

func (m *CheckRoleLevelRequest) Validate() error

Validate checks the field values on CheckRoleLevelRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type CheckRoleLevelRequestValidationError

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

CheckRoleLevelRequestValidationError is the validation error returned by CheckRoleLevelRequest.Validate if the designated constraints aren't met.

func (CheckRoleLevelRequestValidationError) Cause

Cause function returns cause value.

func (CheckRoleLevelRequestValidationError) Error

Error satisfies the builtin error interface

func (CheckRoleLevelRequestValidationError) ErrorName

ErrorName returns error name.

func (CheckRoleLevelRequestValidationError) Field

Field function returns field value.

func (CheckRoleLevelRequestValidationError) Key

Key function returns key value.

func (CheckRoleLevelRequestValidationError) Reason

Reason function returns reason value.

type SysClient

type SysClient interface {
	Auth(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*AuthResp, error)
	CheckResource(ctx context.Context, in *CheckResourceRequest, opts ...grpc.CallOption) (*CheckResourceReply, error)
	CheckRoleLevel(ctx context.Context, in *CheckRoleLevelRequest, opts ...grpc.CallOption) (*CheckRoleLevelReply, error)
}

SysClient is the client API for Sys 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 MustNew

func MustNew(ctx context.Context, timeout time.Duration, r registry.Discovery) (addressc SysClient)

NewSys new sso

func NewSysClient

func NewSysClient(cc grpc.ClientConnInterface) SysClient

type SysHTTPClient

type SysHTTPClient interface {
	Auth(ctx context.Context, req *AuthRequest, opts ...http.CallOption) (rsp *AuthResp, err error)
	CheckResource(ctx context.Context, req *CheckResourceRequest, opts ...http.CallOption) (rsp *CheckResourceReply, err error)
}

func NewSysHTTPClient

func NewSysHTTPClient(client *http.Client) SysHTTPClient

type SysHTTPClientImpl

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

func (*SysHTTPClientImpl) Auth

func (c *SysHTTPClientImpl) Auth(ctx context.Context, in *AuthRequest, opts ...http.CallOption) (*AuthResp, error)

func (*SysHTTPClientImpl) CheckResource

type SysHTTPServer

type SysHTTPServer interface {
	Auth(context.Context, *AuthRequest) (*AuthResp, error)
	CheckResource(context.Context, *CheckResourceRequest) (*CheckResourceReply, error)
}

type SysServer

type SysServer interface {
	Auth(context.Context, *AuthRequest) (*AuthResp, error)
	CheckResource(context.Context, *CheckResourceRequest) (*CheckResourceReply, error)
	CheckRoleLevel(context.Context, *CheckRoleLevelRequest) (*CheckRoleLevelReply, error)
	// contains filtered or unexported methods
}

SysServer is the server API for Sys service. All implementations must embed UnimplementedSysServer for forward compatibility

type UnimplementedSysServer

type UnimplementedSysServer struct {
}

UnimplementedSysServer must be embedded to have forward compatible implementations.

func (UnimplementedSysServer) Auth

func (UnimplementedSysServer) CheckResource

func (UnimplementedSysServer) CheckRoleLevel

type UnsafeSysServer

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

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

Jump to

Keyboard shortcuts

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