test

package
v0.0.0-...-0c59bc6 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2019 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package test is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterTestAPIHandler

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

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

func RegisterTestAPIHandlerClient

func RegisterTestAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TestAPIClient) error

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

func RegisterTestAPIHandlerFromEndpoint

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

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

func RegisterTestAPIServer

func RegisterTestAPIServer(s *grpc.Server, srv TestAPIServer)

Types

type TestAPIClient

type TestAPIClient interface {
	Timestamp(ctx context.Context, in *TimestampReq, opts ...grpc.CallOption) (*TimestampResp, error)
}

TestAPIClient is the client API for TestAPI service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewTestAPIClient

func NewTestAPIClient(cc *grpc.ClientConn) TestAPIClient

type TestAPIServer

type TestAPIServer interface {
	Timestamp(context.Context, *TimestampReq) (*TimestampResp, error)
}

TestAPIServer is the server API for TestAPI service.

type TimestampReq

type TimestampReq struct {
	MyTime               *timestamp.Timestamp `protobuf:"bytes,1,opt,name=my_time,json=myTime,proto3" json:"my_time,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

func (*TimestampReq) Descriptor

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

func (*TimestampReq) GetMyTime

func (m *TimestampReq) GetMyTime() *timestamp.Timestamp

func (*TimestampReq) ProtoMessage

func (*TimestampReq) ProtoMessage()

func (*TimestampReq) Reset

func (m *TimestampReq) Reset()

func (*TimestampReq) String

func (m *TimestampReq) String() string

func (*TimestampReq) Validate

func (m *TimestampReq) Validate() error

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

func (*TimestampReq) XXX_DiscardUnknown

func (m *TimestampReq) XXX_DiscardUnknown()

func (*TimestampReq) XXX_Marshal

func (m *TimestampReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TimestampReq) XXX_Merge

func (m *TimestampReq) XXX_Merge(src proto.Message)

func (*TimestampReq) XXX_Size

func (m *TimestampReq) XXX_Size() int

func (*TimestampReq) XXX_Unmarshal

func (m *TimestampReq) XXX_Unmarshal(b []byte) error

type TimestampReqValidationError

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

TimestampReqValidationError is the validation error returned by TimestampReq.Validate if the designated constraints aren't met.

func (TimestampReqValidationError) Cause

Cause function returns cause value.

func (TimestampReqValidationError) Error

Error satisfies the builtin error interface

func (TimestampReqValidationError) ErrorName

func (e TimestampReqValidationError) ErrorName() string

ErrorName returns error name.

func (TimestampReqValidationError) Field

Field function returns field value.

func (TimestampReqValidationError) Key

Key function returns key value.

func (TimestampReqValidationError) Reason

Reason function returns reason value.

type TimestampResp

type TimestampResp struct {
	MyTime               *timestamp.Timestamp `protobuf:"bytes,1,opt,name=my_time,json=myTime,proto3" json:"my_time,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

func (*TimestampResp) Descriptor

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

func (*TimestampResp) GetMyTime

func (m *TimestampResp) GetMyTime() *timestamp.Timestamp

func (*TimestampResp) ProtoMessage

func (*TimestampResp) ProtoMessage()

func (*TimestampResp) Reset

func (m *TimestampResp) Reset()

func (*TimestampResp) String

func (m *TimestampResp) String() string

func (*TimestampResp) Validate

func (m *TimestampResp) Validate() error

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

func (*TimestampResp) XXX_DiscardUnknown

func (m *TimestampResp) XXX_DiscardUnknown()

func (*TimestampResp) XXX_Marshal

func (m *TimestampResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TimestampResp) XXX_Merge

func (m *TimestampResp) XXX_Merge(src proto.Message)

func (*TimestampResp) XXX_Size

func (m *TimestampResp) XXX_Size() int

func (*TimestampResp) XXX_Unmarshal

func (m *TimestampResp) XXX_Unmarshal(b []byte) error

type TimestampRespValidationError

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

TimestampRespValidationError is the validation error returned by TimestampResp.Validate if the designated constraints aren't met.

func (TimestampRespValidationError) Cause

Cause function returns cause value.

func (TimestampRespValidationError) Error

Error satisfies the builtin error interface

func (TimestampRespValidationError) ErrorName

func (e TimestampRespValidationError) ErrorName() string

ErrorName returns error name.

func (TimestampRespValidationError) Field

Field function returns field value.

func (TimestampRespValidationError) Key

Key function returns key value.

func (TimestampRespValidationError) Reason

Reason function returns reason value.

type UnimplementedTestAPIServer

type UnimplementedTestAPIServer struct {
}

UnimplementedTestAPIServer can be embedded to have forward compatible implementations.

func (*UnimplementedTestAPIServer) Timestamp

Jump to

Keyboard shortcuts

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