clock

package
v0.0.0-...-7c9a8cc Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package clock is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var Clock_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "daprclock.clock.v1.Clock",
	HandlerType: (*ClockServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Now",
			Handler:    _Clock_Now_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "clock/v1/clock.proto",
}

Clock_ServiceDesc is the grpc.ServiceDesc for Clock 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_clock_v1_clock_proto protoreflect.FileDescriptor

Functions

func RegisterClockHandler

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

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

func RegisterClockHandlerClient

func RegisterClockHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ClockClient) error

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

func RegisterClockHandlerFromEndpoint

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

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

func RegisterClockHandlerServer

func RegisterClockHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ClockServer) error

RegisterClockHandlerServer registers the http handlers for service Clock to "mux". UnaryRPC :call ClockServer 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 RegisterClockHandlerFromEndpoint instead.

func RegisterClockServer

func RegisterClockServer(s grpc.ServiceRegistrar, srv ClockServer)

Types

type ClockClient

type ClockClient interface {
	Now(ctx context.Context, in *NowRequest, opts ...grpc.CallOption) (*NowResponse, error)
}

ClockClient is the client API for Clock 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 NewClockClient

func NewClockClient(cc grpc.ClientConnInterface) ClockClient

type ClockServer

type ClockServer interface {
	Now(context.Context, *NowRequest) (*NowResponse, error)
	// contains filtered or unexported methods
}

ClockServer is the server API for Clock service. All implementations must embed UnimplementedClockServer for forward compatibility

type NowRequest

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

func (*NowRequest) Descriptor deprecated

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

Deprecated: Use NowRequest.ProtoReflect.Descriptor instead.

func (*NowRequest) ProtoMessage

func (*NowRequest) ProtoMessage()

func (*NowRequest) ProtoReflect

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

func (*NowRequest) Reset

func (x *NowRequest) Reset()

func (*NowRequest) String

func (x *NowRequest) String() string

type NowResponse

type NowResponse struct {
	Hour   string `protobuf:"bytes,1,opt,name=hour,proto3" json:"hour,omitempty"`
	Minute string `protobuf:"bytes,2,opt,name=minute,proto3" json:"minute,omitempty"`
	Second string `protobuf:"bytes,3,opt,name=second,proto3" json:"second,omitempty"`
	// contains filtered or unexported fields
}

func (*NowResponse) Descriptor deprecated

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

Deprecated: Use NowResponse.ProtoReflect.Descriptor instead.

func (*NowResponse) GetHour

func (x *NowResponse) GetHour() string

func (*NowResponse) GetMinute

func (x *NowResponse) GetMinute() string

func (*NowResponse) GetSecond

func (x *NowResponse) GetSecond() string

func (*NowResponse) ProtoMessage

func (*NowResponse) ProtoMessage()

func (*NowResponse) ProtoReflect

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

func (*NowResponse) Reset

func (x *NowResponse) Reset()

func (*NowResponse) String

func (x *NowResponse) String() string

type UnimplementedClockServer

type UnimplementedClockServer struct {
}

UnimplementedClockServer must be embedded to have forward compatible implementations.

func (UnimplementedClockServer) Now

type UnsafeClockServer

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

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

Jump to

Keyboard shortcuts

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