date

package
v0.0.75 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package date is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var DateService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "sea.api.v1.date.DateService",
	HandlerType: (*DateServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Now",
			Handler:    _DateService_Now_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "date/date.proto",
}

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

View Source
var File_date_date_proto protoreflect.FileDescriptor

Functions

func RegisterDateServiceHandler

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

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

func RegisterDateServiceHandlerClient

func RegisterDateServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DateServiceClient) error

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

func RegisterDateServiceHandlerFromEndpoint

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

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

func RegisterDateServiceHandlerServer

func RegisterDateServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DateServiceServer) error

RegisterDateServiceHandlerServer registers the http handlers for service DateService to "mux". UnaryRPC :call DateServiceServer 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 RegisterDateServiceHandlerFromEndpoint instead.

func RegisterDateServiceServer

func RegisterDateServiceServer(s grpc.ServiceRegistrar, srv DateServiceServer)

Types

type DateRequest

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

func (*DateRequest) Descriptor deprecated

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

Deprecated: Use DateRequest.ProtoReflect.Descriptor instead.

func (*DateRequest) GetRequestId

func (x *DateRequest) GetRequestId() string

func (*DateRequest) ProtoMessage

func (*DateRequest) ProtoMessage()

func (*DateRequest) ProtoReflect

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

func (*DateRequest) Reset

func (x *DateRequest) Reset()

func (*DateRequest) String

func (x *DateRequest) String() string

type DateResponse

type DateResponse struct {
	RequestId string `protobuf:"bytes,1,opt,name=request_id,json=RequestId,proto3" json:"request_id,omitempty"`
	Date      string `protobuf:"bytes,2,opt,name=date,proto3" json:"date,omitempty"`
	// contains filtered or unexported fields
}

func (*DateResponse) Descriptor deprecated

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

Deprecated: Use DateResponse.ProtoReflect.Descriptor instead.

func (*DateResponse) GetDate

func (x *DateResponse) GetDate() string

func (*DateResponse) GetRequestId

func (x *DateResponse) GetRequestId() string

func (*DateResponse) ProtoMessage

func (*DateResponse) ProtoMessage()

func (*DateResponse) ProtoReflect

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

func (*DateResponse) Reset

func (x *DateResponse) Reset()

func (*DateResponse) String

func (x *DateResponse) String() string

type DateServiceClient

type DateServiceClient interface {
	Now(ctx context.Context, in *DateRequest, opts ...grpc.CallOption) (*DateResponse, error)
}

DateServiceClient is the client API for DateService 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 DateServiceServer

type DateServiceServer interface {
	Now(context.Context, *DateRequest) (*DateResponse, error)
	// contains filtered or unexported methods
}

DateServiceServer is the server API for DateService service. All implementations must embed UnimplementedDateServiceServer for forward compatibility

type UnimplementedDateServiceServer

type UnimplementedDateServiceServer struct {
}

UnimplementedDateServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedDateServiceServer) Now

type UnsafeDateServiceServer

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

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

Jump to

Keyboard shortcuts

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