srv_session_api

package module
v0.0.0-...-8519efd Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package srv_session_api is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_kioku_srv_session_api_v1_srv_session_api_proto protoreflect.FileDescriptor
View Source
var SrvSessionApi_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "kioku.server.srv_session_api.v1.SrvSessionApi",
	HandlerType: (*SrvSessionApiServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "KanjiEventV1",
			Handler:    _SrvSessionApi_KanjiEventV1_Handler,
		},
		{
			MethodName: "WordEventV1",
			Handler:    _SrvSessionApi_WordEventV1_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "kioku/srv-session-api/v1/srv-session-api.proto",
}

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

Functions

func RegisterSrvSessionApiHandler

func RegisterSrvSessionApiHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterSrvSessionApiHandler registers the http handlers for service SrvSessionApi to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterSrvSessionApiHandlerClient

func RegisterSrvSessionApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SrvSessionApiClient) error

RegisterSrvSessionApiHandlerClient registers the http handlers for service SrvSessionApi to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SrvSessionApiClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SrvSessionApiClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SrvSessionApiClient" to call the correct interceptors.

func RegisterSrvSessionApiHandlerFromEndpoint

func RegisterSrvSessionApiHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterSrvSessionApiHandlerFromEndpoint is same as RegisterSrvSessionApiHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterSrvSessionApiHandlerServer

func RegisterSrvSessionApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SrvSessionApiServer) error

RegisterSrvSessionApiHandlerServer registers the http handlers for service SrvSessionApi to "mux". UnaryRPC :call SrvSessionApiServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterSrvSessionApiHandlerFromEndpoint instead.

func RegisterSrvSessionApiServer

func RegisterSrvSessionApiServer(s grpc.ServiceRegistrar, srv SrvSessionApiServer)

Types

type Event

type Event struct {
	UserId        uint64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	UserLevel     uint32 `protobuf:"varint,2,opt,name=user_level,json=userLevel,proto3" json:"user_level,omitempty"`
	ProgressId    uint64 `protobuf:"varint,3,opt,name=progress_id,json=progressId,proto3" json:"progress_id,omitempty"`
	ProgressLevel uint32 `protobuf:"varint,4,opt,name=progress_level,json=progressLevel,proto3" json:"progress_level,omitempty"`
	SrsLevel      uint32 `protobuf:"varint,5,opt,name=srs_level,json=srsLevel,proto3" json:"srs_level,omitempty"`
	Success       bool   `protobuf:"varint,6,opt,name=success,proto3" json:"success,omitempty"`
	// contains filtered or unexported fields
}

func (*Event) Descriptor deprecated

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

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetProgressId

func (x *Event) GetProgressId() uint64

func (*Event) GetProgressLevel

func (x *Event) GetProgressLevel() uint32

func (*Event) GetSrsLevel

func (x *Event) GetSrsLevel() uint32

func (*Event) GetSuccess

func (x *Event) GetSuccess() bool

func (*Event) GetUserId

func (x *Event) GetUserId() uint64

func (*Event) GetUserLevel

func (x *Event) GetUserLevel() uint32

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) ProtoReflect

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

func (*Event) Reset

func (x *Event) Reset()

func (*Event) String

func (x *Event) String() string

func (*Event) Validate

func (m *Event) Validate() error

Validate checks the field values on Event with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Event) ValidateAll

func (m *Event) ValidateAll() error

ValidateAll checks the field values on Event with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in EventMultiError, or nil if none found.

type EventMultiError

type EventMultiError []error

EventMultiError is an error wrapping multiple validation errors returned by Event.ValidateAll() if the designated constraints aren't met.

func (EventMultiError) AllErrors

func (m EventMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (EventMultiError) Error

func (m EventMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type EventV1Reposnse

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

func (*EventV1Reposnse) Descriptor deprecated

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

Deprecated: Use EventV1Reposnse.ProtoReflect.Descriptor instead.

func (*EventV1Reposnse) GetSuccess

func (x *EventV1Reposnse) GetSuccess() bool

func (*EventV1Reposnse) ProtoMessage

func (*EventV1Reposnse) ProtoMessage()

func (*EventV1Reposnse) ProtoReflect

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

func (*EventV1Reposnse) Reset

func (x *EventV1Reposnse) Reset()

func (*EventV1Reposnse) String

func (x *EventV1Reposnse) String() string

func (*EventV1Reposnse) Validate

func (m *EventV1Reposnse) Validate() error

Validate checks the field values on EventV1Reposnse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*EventV1Reposnse) ValidateAll

func (m *EventV1Reposnse) ValidateAll() error

ValidateAll checks the field values on EventV1Reposnse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in EventV1ReposnseMultiError, or nil if none found.

type EventV1ReposnseMultiError

type EventV1ReposnseMultiError []error

EventV1ReposnseMultiError is an error wrapping multiple validation errors returned by EventV1Reposnse.ValidateAll() if the designated constraints aren't met.

func (EventV1ReposnseMultiError) AllErrors

func (m EventV1ReposnseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (EventV1ReposnseMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type EventV1ReposnseValidationError

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

EventV1ReposnseValidationError is the validation error returned by EventV1Reposnse.Validate if the designated constraints aren't met.

func (EventV1ReposnseValidationError) Cause

Cause function returns cause value.

func (EventV1ReposnseValidationError) Error

Error satisfies the builtin error interface

func (EventV1ReposnseValidationError) ErrorName

func (e EventV1ReposnseValidationError) ErrorName() string

ErrorName returns error name.

func (EventV1ReposnseValidationError) Field

Field function returns field value.

func (EventV1ReposnseValidationError) Key

Key function returns key value.

func (EventV1ReposnseValidationError) Reason

Reason function returns reason value.

type EventValidationError

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

EventValidationError is the validation error returned by Event.Validate if the designated constraints aren't met.

func (EventValidationError) Cause

func (e EventValidationError) Cause() error

Cause function returns cause value.

func (EventValidationError) Error

func (e EventValidationError) Error() string

Error satisfies the builtin error interface

func (EventValidationError) ErrorName

func (e EventValidationError) ErrorName() string

ErrorName returns error name.

func (EventValidationError) Field

func (e EventValidationError) Field() string

Field function returns field value.

func (EventValidationError) Key

func (e EventValidationError) Key() bool

Key function returns key value.

func (EventValidationError) Reason

func (e EventValidationError) Reason() string

Reason function returns reason value.

type KanjiEventV1Request

type KanjiEventV1Request struct {
	Event *Event `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"`
	// contains filtered or unexported fields
}

func (*KanjiEventV1Request) Descriptor deprecated

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

Deprecated: Use KanjiEventV1Request.ProtoReflect.Descriptor instead.

func (*KanjiEventV1Request) GetEvent

func (x *KanjiEventV1Request) GetEvent() *Event

func (*KanjiEventV1Request) ProtoMessage

func (*KanjiEventV1Request) ProtoMessage()

func (*KanjiEventV1Request) ProtoReflect

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

func (*KanjiEventV1Request) Reset

func (x *KanjiEventV1Request) Reset()

func (*KanjiEventV1Request) String

func (x *KanjiEventV1Request) String() string

func (*KanjiEventV1Request) Validate

func (m *KanjiEventV1Request) Validate() error

Validate checks the field values on KanjiEventV1Request with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*KanjiEventV1Request) ValidateAll

func (m *KanjiEventV1Request) ValidateAll() error

ValidateAll checks the field values on KanjiEventV1Request with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in KanjiEventV1RequestMultiError, or nil if none found.

type KanjiEventV1RequestMultiError

type KanjiEventV1RequestMultiError []error

KanjiEventV1RequestMultiError is an error wrapping multiple validation errors returned by KanjiEventV1Request.ValidateAll() if the designated constraints aren't met.

func (KanjiEventV1RequestMultiError) AllErrors

func (m KanjiEventV1RequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (KanjiEventV1RequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type KanjiEventV1RequestValidationError

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

KanjiEventV1RequestValidationError is the validation error returned by KanjiEventV1Request.Validate if the designated constraints aren't met.

func (KanjiEventV1RequestValidationError) Cause

Cause function returns cause value.

func (KanjiEventV1RequestValidationError) Error

Error satisfies the builtin error interface

func (KanjiEventV1RequestValidationError) ErrorName

ErrorName returns error name.

func (KanjiEventV1RequestValidationError) Field

Field function returns field value.

func (KanjiEventV1RequestValidationError) Key

Key function returns key value.

func (KanjiEventV1RequestValidationError) Reason

Reason function returns reason value.

type SrvSessionApiClient

type SrvSessionApiClient interface {
	KanjiEventV1(ctx context.Context, in *KanjiEventV1Request, opts ...grpc.CallOption) (*EventV1Reposnse, error)
	WordEventV1(ctx context.Context, in *WordEventV1Request, opts ...grpc.CallOption) (*EventV1Reposnse, error)
}

SrvSessionApiClient is the client API for SrvSessionApi 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 SrvSessionApiServer

type SrvSessionApiServer interface {
	KanjiEventV1(context.Context, *KanjiEventV1Request) (*EventV1Reposnse, error)
	WordEventV1(context.Context, *WordEventV1Request) (*EventV1Reposnse, error)
	// contains filtered or unexported methods
}

SrvSessionApiServer is the server API for SrvSessionApi service. All implementations must embed UnimplementedSrvSessionApiServer for forward compatibility

type UnimplementedSrvSessionApiServer

type UnimplementedSrvSessionApiServer struct {
}

UnimplementedSrvSessionApiServer must be embedded to have forward compatible implementations.

func (UnimplementedSrvSessionApiServer) KanjiEventV1

func (UnimplementedSrvSessionApiServer) WordEventV1

type UnsafeSrvSessionApiServer

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

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

type WordEventV1Request

type WordEventV1Request struct {
	Event *Event `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"`
	// contains filtered or unexported fields
}

func (*WordEventV1Request) Descriptor deprecated

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

Deprecated: Use WordEventV1Request.ProtoReflect.Descriptor instead.

func (*WordEventV1Request) GetEvent

func (x *WordEventV1Request) GetEvent() *Event

func (*WordEventV1Request) ProtoMessage

func (*WordEventV1Request) ProtoMessage()

func (*WordEventV1Request) ProtoReflect

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

func (*WordEventV1Request) Reset

func (x *WordEventV1Request) Reset()

func (*WordEventV1Request) String

func (x *WordEventV1Request) String() string

func (*WordEventV1Request) Validate

func (m *WordEventV1Request) Validate() error

Validate checks the field values on WordEventV1Request with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*WordEventV1Request) ValidateAll

func (m *WordEventV1Request) ValidateAll() error

ValidateAll checks the field values on WordEventV1Request with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in WordEventV1RequestMultiError, or nil if none found.

type WordEventV1RequestMultiError

type WordEventV1RequestMultiError []error

WordEventV1RequestMultiError is an error wrapping multiple validation errors returned by WordEventV1Request.ValidateAll() if the designated constraints aren't met.

func (WordEventV1RequestMultiError) AllErrors

func (m WordEventV1RequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (WordEventV1RequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type WordEventV1RequestValidationError

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

WordEventV1RequestValidationError is the validation error returned by WordEventV1Request.Validate if the designated constraints aren't met.

func (WordEventV1RequestValidationError) Cause

Cause function returns cause value.

func (WordEventV1RequestValidationError) Error

Error satisfies the builtin error interface

func (WordEventV1RequestValidationError) ErrorName

ErrorName returns error name.

func (WordEventV1RequestValidationError) Field

Field function returns field value.

func (WordEventV1RequestValidationError) Key

Key function returns key value.

func (WordEventV1RequestValidationError) Reason

Reason function returns reason value.

Directories

Path Synopsis
google.golang.org
protobuf/types/known/timestamppb
Package timestamppb contains generated types for google/protobuf/timestamp.proto.
Package timestamppb contains generated types for google/protobuf/timestamp.proto.

Jump to

Keyboard shortcuts

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