v1

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_api_v1_go_layout_proto protoreflect.FileDescriptor
View Source
var Scheduler_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "golayout.v1.Scheduler",
	HandlerType: (*SchedulerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Ping",
			Handler:    _Scheduler_Ping_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/v1/go-layout.proto",
}

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

Functions

func RegisterSchedulerHandler

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

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

func RegisterSchedulerHandlerClient

func RegisterSchedulerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SchedulerClient) error

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

func RegisterSchedulerHandlerFromEndpoint

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

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

func RegisterSchedulerHandlerServer

func RegisterSchedulerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SchedulerServer) error

RegisterSchedulerHandlerServer registers the http handlers for service Scheduler to "mux". UnaryRPC :call SchedulerServer 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 RegisterSchedulerHandlerFromEndpoint instead.

func RegisterSchedulerServer

func RegisterSchedulerServer(s grpc.ServiceRegistrar, srv SchedulerServer)

Types

type Empty

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

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

func (*Empty) Validate

func (m *Empty) Validate() error

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

type EmptyValidationError

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

EmptyValidationError is the validation error returned by Empty.Validate if the designated constraints aren't met.

func (EmptyValidationError) Cause

func (e EmptyValidationError) Cause() error

Cause function returns cause value.

func (EmptyValidationError) Error

func (e EmptyValidationError) Error() string

Error satisfies the builtin error interface

func (EmptyValidationError) ErrorName

func (e EmptyValidationError) ErrorName() string

ErrorName returns error name.

func (EmptyValidationError) Field

func (e EmptyValidationError) Field() string

Field function returns field value.

func (EmptyValidationError) Key

func (e EmptyValidationError) Key() bool

Key function returns key value.

func (EmptyValidationError) Reason

func (e EmptyValidationError) Reason() string

Reason function returns reason value.

type Result

type Result struct {
	Code    int64      `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Message string     `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	Data    *anypb.Any `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*Result) Descriptor deprecated

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

Deprecated: Use Result.ProtoReflect.Descriptor instead.

func (*Result) GetCode

func (x *Result) GetCode() int64

func (*Result) GetData

func (x *Result) GetData() *anypb.Any

func (*Result) GetMessage

func (x *Result) GetMessage() string

func (*Result) ProtoMessage

func (*Result) ProtoMessage()

func (*Result) ProtoReflect

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

func (*Result) Reset

func (x *Result) Reset()

func (*Result) String

func (x *Result) String() string

func (*Result) Validate

func (m *Result) Validate() error

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

type ResultValidationError

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

ResultValidationError is the validation error returned by Result.Validate if the designated constraints aren't met.

func (ResultValidationError) Cause

func (e ResultValidationError) Cause() error

Cause function returns cause value.

func (ResultValidationError) Error

func (e ResultValidationError) Error() string

Error satisfies the builtin error interface

func (ResultValidationError) ErrorName

func (e ResultValidationError) ErrorName() string

ErrorName returns error name.

func (ResultValidationError) Field

func (e ResultValidationError) Field() string

Field function returns field value.

func (ResultValidationError) Key

func (e ResultValidationError) Key() bool

Key function returns key value.

func (ResultValidationError) Reason

func (e ResultValidationError) Reason() string

Reason function returns reason value.

type SchedulerClient

type SchedulerClient interface {
	Ping(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Result, error)
}

SchedulerClient is the client API for Scheduler 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 NewSchedulerClient

func NewSchedulerClient(cc grpc.ClientConnInterface) SchedulerClient

type SchedulerServer

type SchedulerServer interface {
	Ping(context.Context, *Empty) (*Result, error)
	// contains filtered or unexported methods
}

SchedulerServer is the server API for Scheduler service. All implementations must embed UnimplementedSchedulerServer for forward compatibility

type UnimplementedSchedulerServer

type UnimplementedSchedulerServer struct {
}

UnimplementedSchedulerServer must be embedded to have forward compatible implementations.

func (UnimplementedSchedulerServer) Ping

type UnsafeSchedulerServer

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

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

Jump to

Keyboard shortcuts

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