test

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: MIT Imports: 30 Imported by: 1

Documentation

Overview

Package test is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var Test_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "skema.test.Test",
	HandlerType: (*TestServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Heathcheck",
			Handler:    _Test_Heathcheck_Handler,
		},
		{
			MethodName: "Helloworld",
			Handler:    _Test_Helloworld_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "Test.proto",
}

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

Functions

func RegisterTestHandler

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

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

func RegisterTestHandlerClient

func RegisterTestHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TestClient) error

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

func RegisterTestHandlerFromEndpoint

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

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

func RegisterTestHandlerServer

func RegisterTestHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TestServer) error

RegisterTestHandlerServer registers the http handlers for service Test to "mux". UnaryRPC :call TestServer 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 RegisterTestHandlerFromEndpoint instead.

func RegisterTestServer

func RegisterTestServer(s grpc.ServiceRegistrar, srv TestServer)

Types

type HealthcheckRequest

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

func (*HealthcheckRequest) Descriptor deprecated

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

Deprecated: Use HealthcheckRequest.ProtoReflect.Descriptor instead.

func (*HealthcheckRequest) GetMsg

func (x *HealthcheckRequest) GetMsg() string

func (*HealthcheckRequest) ProtoMessage

func (*HealthcheckRequest) ProtoMessage()

func (*HealthcheckRequest) ProtoReflect

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

func (*HealthcheckRequest) Reset

func (x *HealthcheckRequest) Reset()

func (*HealthcheckRequest) String

func (x *HealthcheckRequest) String() string

func (*HealthcheckRequest) Validate

func (m *HealthcheckRequest) Validate() error

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

func (m *HealthcheckRequest) ValidateAll() error

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

type HealthcheckRequestMultiError

type HealthcheckRequestMultiError []error

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

func (HealthcheckRequestMultiError) AllErrors

func (m HealthcheckRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (HealthcheckRequestMultiError) Error

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

type HealthcheckRequestValidationError

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

HealthcheckRequestValidationError is the validation error returned by HealthcheckRequest.Validate if the designated constraints aren't met.

func (HealthcheckRequestValidationError) Cause

Cause function returns cause value.

func (HealthcheckRequestValidationError) Error

Error satisfies the builtin error interface

func (HealthcheckRequestValidationError) ErrorName

ErrorName returns error name.

func (HealthcheckRequestValidationError) Field

Field function returns field value.

func (HealthcheckRequestValidationError) Key

Key function returns key value.

func (HealthcheckRequestValidationError) Reason

Reason function returns reason value.

type HealthcheckResponse

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

func (*HealthcheckResponse) Descriptor deprecated

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

Deprecated: Use HealthcheckResponse.ProtoReflect.Descriptor instead.

func (*HealthcheckResponse) GetResult

func (x *HealthcheckResponse) GetResult() string

func (*HealthcheckResponse) ProtoMessage

func (*HealthcheckResponse) ProtoMessage()

func (*HealthcheckResponse) ProtoReflect

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

func (*HealthcheckResponse) Reset

func (x *HealthcheckResponse) Reset()

func (*HealthcheckResponse) String

func (x *HealthcheckResponse) String() string

func (*HealthcheckResponse) Validate

func (m *HealthcheckResponse) Validate() error

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

func (m *HealthcheckResponse) ValidateAll() error

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

type HealthcheckResponseMultiError

type HealthcheckResponseMultiError []error

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

func (HealthcheckResponseMultiError) AllErrors

func (m HealthcheckResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (HealthcheckResponseMultiError) Error

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

type HealthcheckResponseValidationError

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

HealthcheckResponseValidationError is the validation error returned by HealthcheckResponse.Validate if the designated constraints aren't met.

func (HealthcheckResponseValidationError) Cause

Cause function returns cause value.

func (HealthcheckResponseValidationError) Error

Error satisfies the builtin error interface

func (HealthcheckResponseValidationError) ErrorName

ErrorName returns error name.

func (HealthcheckResponseValidationError) Field

Field function returns field value.

func (HealthcheckResponseValidationError) Key

Key function returns key value.

func (HealthcheckResponseValidationError) Reason

Reason function returns reason value.

type HelloReply

type HelloReply struct {
	Msg  string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
	Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
	// contains filtered or unexported fields
}

func (*HelloReply) Descriptor deprecated

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

Deprecated: Use HelloReply.ProtoReflect.Descriptor instead.

func (*HelloReply) GetCode

func (x *HelloReply) GetCode() string

func (*HelloReply) GetMsg

func (x *HelloReply) GetMsg() string

func (*HelloReply) ProtoMessage

func (*HelloReply) ProtoMessage()

func (*HelloReply) ProtoReflect

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

func (*HelloReply) Reset

func (x *HelloReply) Reset()

func (*HelloReply) String

func (x *HelloReply) String() string

func (*HelloReply) Validate

func (m *HelloReply) Validate() error

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

func (m *HelloReply) ValidateAll() error

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

type HelloReplyMultiError

type HelloReplyMultiError []error

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

func (HelloReplyMultiError) AllErrors

func (m HelloReplyMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (HelloReplyMultiError) Error

func (m HelloReplyMultiError) Error() string

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

type HelloReplyValidationError

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

HelloReplyValidationError is the validation error returned by HelloReply.Validate if the designated constraints aren't met.

func (HelloReplyValidationError) Cause

func (e HelloReplyValidationError) Cause() error

Cause function returns cause value.

func (HelloReplyValidationError) Error

Error satisfies the builtin error interface

func (HelloReplyValidationError) ErrorName

func (e HelloReplyValidationError) ErrorName() string

ErrorName returns error name.

func (HelloReplyValidationError) Field

Field function returns field value.

func (HelloReplyValidationError) Key

Key function returns key value.

func (HelloReplyValidationError) Reason

func (e HelloReplyValidationError) Reason() string

Reason function returns reason value.

type HelloRequest

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

func (*HelloRequest) Descriptor deprecated

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

Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.

func (*HelloRequest) GetMsg

func (x *HelloRequest) GetMsg() string

func (*HelloRequest) ProtoMessage

func (*HelloRequest) ProtoMessage()

func (*HelloRequest) ProtoReflect

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

func (*HelloRequest) Reset

func (x *HelloRequest) Reset()

func (*HelloRequest) String

func (x *HelloRequest) String() string

func (*HelloRequest) Validate

func (m *HelloRequest) Validate() error

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

func (m *HelloRequest) ValidateAll() error

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

type HelloRequestMultiError

type HelloRequestMultiError []error

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

func (HelloRequestMultiError) AllErrors

func (m HelloRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (HelloRequestMultiError) Error

func (m HelloRequestMultiError) Error() string

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

type HelloRequestValidationError

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

HelloRequestValidationError is the validation error returned by HelloRequest.Validate if the designated constraints aren't met.

func (HelloRequestValidationError) Cause

Cause function returns cause value.

func (HelloRequestValidationError) Error

Error satisfies the builtin error interface

func (HelloRequestValidationError) ErrorName

func (e HelloRequestValidationError) ErrorName() string

ErrorName returns error name.

func (HelloRequestValidationError) Field

Field function returns field value.

func (HelloRequestValidationError) Key

Key function returns key value.

func (HelloRequestValidationError) Reason

Reason function returns reason value.

type TestClient

type TestClient interface {
	Heathcheck(ctx context.Context, in *HealthcheckRequest, opts ...grpc.CallOption) (*HealthcheckResponse, error)
	Helloworld(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error)
}

TestClient is the client API for Test 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 NewTestClient

func NewTestClient(cc grpc.ClientConnInterface) TestClient

type TestServer

type TestServer interface {
	Heathcheck(context.Context, *HealthcheckRequest) (*HealthcheckResponse, error)
	Helloworld(context.Context, *HelloRequest) (*HelloReply, error)
	// contains filtered or unexported methods
}

TestServer is the server API for Test service. All implementations must embed UnimplementedTestServer for forward compatibility

type UnimplementedTestServer

type UnimplementedTestServer struct {
}

UnimplementedTestServer must be embedded to have forward compatible implementations.

func (UnimplementedTestServer) Heathcheck

func (UnimplementedTestServer) Helloworld

type UnsafeTestServer

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

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

Jump to

Keyboard shortcuts

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