services

package
v0.0.0-...-27fe427 Latest Latest
Warning

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

Go to latest
Published: May 14, 2021 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package services is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_cafes_v1_services_notice_service_proto protoreflect.FileDescriptor
View Source
var NoticeService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "cafes.v1.services.NoticeService",
	HandlerType: (*NoticeServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateNotice",
			Handler:    _NoticeService_CreateNotice_Handler,
		},
		{
			MethodName: "GetNotice",
			Handler:    _NoticeService_GetNotice_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "cafes/v1/services/notice_service.proto",
}

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

Functions

func RegisterNoticeServiceHandler

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

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

func RegisterNoticeServiceHandlerClient

func RegisterNoticeServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NoticeServiceClient) error

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

func RegisterNoticeServiceHandlerFromEndpoint

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

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

func RegisterNoticeServiceHandlerServer

func RegisterNoticeServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NoticeServiceServer) error

RegisterNoticeServiceHandlerServer registers the http handlers for service NoticeService to "mux". UnaryRPC :call NoticeServiceServer 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 RegisterNoticeServiceHandlerFromEndpoint instead.

func RegisterNoticeServiceServer

func RegisterNoticeServiceServer(s grpc.ServiceRegistrar, srv NoticeServiceServer)

Types

type CreateNoticeRequest

type CreateNoticeRequest struct {
	Title   string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateNoticeRequest) Descriptor deprecated

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

Deprecated: Use CreateNoticeRequest.ProtoReflect.Descriptor instead.

func (*CreateNoticeRequest) GetContent

func (x *CreateNoticeRequest) GetContent() string

func (*CreateNoticeRequest) GetTitle

func (x *CreateNoticeRequest) GetTitle() string

func (*CreateNoticeRequest) ProtoMessage

func (*CreateNoticeRequest) ProtoMessage()

func (*CreateNoticeRequest) ProtoReflect

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

func (*CreateNoticeRequest) Reset

func (x *CreateNoticeRequest) Reset()

func (*CreateNoticeRequest) String

func (x *CreateNoticeRequest) String() string

func (*CreateNoticeRequest) Validate

func (m *CreateNoticeRequest) Validate() error

Validate checks the field values on CreateNoticeRequest 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 (*CreateNoticeRequest) ValidateAll

func (m *CreateNoticeRequest) ValidateAll() error

ValidateAll checks the field values on CreateNoticeRequest 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 CreateNoticeRequestMultiError, or nil if none found.

type CreateNoticeRequestMultiError

type CreateNoticeRequestMultiError []error

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

func (CreateNoticeRequestMultiError) AllErrors

func (m CreateNoticeRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CreateNoticeRequestMultiError) Error

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

type CreateNoticeRequestValidationError

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

CreateNoticeRequestValidationError is the validation error returned by CreateNoticeRequest.Validate if the designated constraints aren't met.

func (CreateNoticeRequestValidationError) Cause

Cause function returns cause value.

func (CreateNoticeRequestValidationError) Error

Error satisfies the builtin error interface

func (CreateNoticeRequestValidationError) ErrorName

ErrorName returns error name.

func (CreateNoticeRequestValidationError) Field

Field function returns field value.

func (CreateNoticeRequestValidationError) Key

Key function returns key value.

func (CreateNoticeRequestValidationError) Reason

Reason function returns reason value.

type GetNoticeRequest

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

func (*GetNoticeRequest) Descriptor deprecated

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

Deprecated: Use GetNoticeRequest.ProtoReflect.Descriptor instead.

func (*GetNoticeRequest) GetId

func (x *GetNoticeRequest) GetId() string

func (*GetNoticeRequest) ProtoMessage

func (*GetNoticeRequest) ProtoMessage()

func (*GetNoticeRequest) ProtoReflect

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

func (*GetNoticeRequest) Reset

func (x *GetNoticeRequest) Reset()

func (*GetNoticeRequest) String

func (x *GetNoticeRequest) String() string

func (*GetNoticeRequest) Validate

func (m *GetNoticeRequest) Validate() error

Validate checks the field values on GetNoticeRequest 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 (*GetNoticeRequest) ValidateAll

func (m *GetNoticeRequest) ValidateAll() error

ValidateAll checks the field values on GetNoticeRequest 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 GetNoticeRequestMultiError, or nil if none found.

type GetNoticeRequestMultiError

type GetNoticeRequestMultiError []error

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

func (GetNoticeRequestMultiError) AllErrors

func (m GetNoticeRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetNoticeRequestMultiError) Error

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

type GetNoticeRequestValidationError

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

GetNoticeRequestValidationError is the validation error returned by GetNoticeRequest.Validate if the designated constraints aren't met.

func (GetNoticeRequestValidationError) Cause

Cause function returns cause value.

func (GetNoticeRequestValidationError) Error

Error satisfies the builtin error interface

func (GetNoticeRequestValidationError) ErrorName

ErrorName returns error name.

func (GetNoticeRequestValidationError) Field

Field function returns field value.

func (GetNoticeRequestValidationError) Key

Key function returns key value.

func (GetNoticeRequestValidationError) Reason

Reason function returns reason value.

type GetNoticeResponse

type GetNoticeResponse struct {
	Notice *resources.Notice    `protobuf:"bytes,1,opt,name=notice,proto3" json:"notice,omitempty"`
	Links  *resources.SelfLinks `protobuf:"bytes,2,opt,name=links,proto3" json:"links,omitempty"`
	// contains filtered or unexported fields
}

func (*GetNoticeResponse) Descriptor deprecated

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

Deprecated: Use GetNoticeResponse.ProtoReflect.Descriptor instead.

func (x *GetNoticeResponse) GetLinks() *resources.SelfLinks

func (*GetNoticeResponse) GetNotice

func (x *GetNoticeResponse) GetNotice() *resources.Notice

func (*GetNoticeResponse) ProtoMessage

func (*GetNoticeResponse) ProtoMessage()

func (*GetNoticeResponse) ProtoReflect

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

func (*GetNoticeResponse) Reset

func (x *GetNoticeResponse) Reset()

func (*GetNoticeResponse) String

func (x *GetNoticeResponse) String() string

func (*GetNoticeResponse) Validate

func (m *GetNoticeResponse) Validate() error

Validate checks the field values on GetNoticeResponse 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 (*GetNoticeResponse) ValidateAll

func (m *GetNoticeResponse) ValidateAll() error

ValidateAll checks the field values on GetNoticeResponse 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 GetNoticeResponseMultiError, or nil if none found.

type GetNoticeResponseMultiError

type GetNoticeResponseMultiError []error

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

func (GetNoticeResponseMultiError) AllErrors

func (m GetNoticeResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetNoticeResponseMultiError) Error

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

type GetNoticeResponseValidationError

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

GetNoticeResponseValidationError is the validation error returned by GetNoticeResponse.Validate if the designated constraints aren't met.

func (GetNoticeResponseValidationError) Cause

Cause function returns cause value.

func (GetNoticeResponseValidationError) Error

Error satisfies the builtin error interface

func (GetNoticeResponseValidationError) ErrorName

ErrorName returns error name.

func (GetNoticeResponseValidationError) Field

Field function returns field value.

func (GetNoticeResponseValidationError) Key

Key function returns key value.

func (GetNoticeResponseValidationError) Reason

Reason function returns reason value.

type NoticeServiceClient

type NoticeServiceClient interface {
	CreateNotice(ctx context.Context, in *CreateNoticeRequest, opts ...grpc.CallOption) (*resources.SelfLinks, error)
	GetNotice(ctx context.Context, in *GetNoticeRequest, opts ...grpc.CallOption) (*GetNoticeResponse, error)
}

NoticeServiceClient is the client API for NoticeService 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 NoticeServiceServer

type NoticeServiceServer interface {
	CreateNotice(context.Context, *CreateNoticeRequest) (*resources.SelfLinks, error)
	GetNotice(context.Context, *GetNoticeRequest) (*GetNoticeResponse, error)
}

NoticeServiceServer is the server API for NoticeService service. All implementations should embed UnimplementedNoticeServiceServer for forward compatibility

type UnimplementedNoticeServiceServer

type UnimplementedNoticeServiceServer struct {
}

UnimplementedNoticeServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedNoticeServiceServer) CreateNotice

func (UnimplementedNoticeServiceServer) GetNotice

type UnsafeNoticeServiceServer

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

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

Jump to

Keyboard shortcuts

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