v1

package
v0.0.0-...-dcb7f34 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2020 License: Apache-2.0 Imports: 14 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

This section is empty.

Functions

func RegisterPersonHandler

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

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

func RegisterPersonHandlerClient

func RegisterPersonHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PersonClient) error

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

func RegisterPersonHandlerFromEndpoint

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

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

func RegisterPersonHandlerServer

func RegisterPersonHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PersonServer) error

RegisterPersonHandlerServer registers the http handlers for service Person to "mux". UnaryRPC :call PersonServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterPersonServer

func RegisterPersonServer(s *grpc.Server, srv PersonServer)

Types

type GetPersonRequest

type GetPersonRequest struct {
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetPersonRequest) Descriptor

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

func (*GetPersonRequest) GetId

func (m *GetPersonRequest) GetId() string

func (*GetPersonRequest) ProtoMessage

func (*GetPersonRequest) ProtoMessage()

func (*GetPersonRequest) Reset

func (m *GetPersonRequest) Reset()

func (*GetPersonRequest) String

func (m *GetPersonRequest) String() string

func (*GetPersonRequest) XXX_DiscardUnknown

func (m *GetPersonRequest) XXX_DiscardUnknown()

func (*GetPersonRequest) XXX_Marshal

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

func (*GetPersonRequest) XXX_Merge

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

func (*GetPersonRequest) XXX_Size

func (m *GetPersonRequest) XXX_Size() int

func (*GetPersonRequest) XXX_Unmarshal

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

type GetPersonResponse

type GetPersonResponse struct {
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name                 string   `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Email                string   `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetPersonResponse) Descriptor

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

func (*GetPersonResponse) GetEmail

func (m *GetPersonResponse) GetEmail() string

func (*GetPersonResponse) GetId

func (m *GetPersonResponse) GetId() string

func (*GetPersonResponse) GetName

func (m *GetPersonResponse) GetName() string

func (*GetPersonResponse) ProtoMessage

func (*GetPersonResponse) ProtoMessage()

func (*GetPersonResponse) Reset

func (m *GetPersonResponse) Reset()

func (*GetPersonResponse) String

func (m *GetPersonResponse) String() string

func (*GetPersonResponse) XXX_DiscardUnknown

func (m *GetPersonResponse) XXX_DiscardUnknown()

func (*GetPersonResponse) XXX_Marshal

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

func (*GetPersonResponse) XXX_Merge

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

func (*GetPersonResponse) XXX_Size

func (m *GetPersonResponse) XXX_Size() int

func (*GetPersonResponse) XXX_Unmarshal

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

type GetPersonsResponse

type GetPersonsResponse struct {
	Persons              []*GetPersonResponse `protobuf:"bytes,1,rep,name=persons,proto3" json:"persons,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

func (*GetPersonsResponse) Descriptor

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

func (*GetPersonsResponse) GetPersons

func (m *GetPersonsResponse) GetPersons() []*GetPersonResponse

func (*GetPersonsResponse) ProtoMessage

func (*GetPersonsResponse) ProtoMessage()

func (*GetPersonsResponse) Reset

func (m *GetPersonsResponse) Reset()

func (*GetPersonsResponse) String

func (m *GetPersonsResponse) String() string

func (*GetPersonsResponse) XXX_DiscardUnknown

func (m *GetPersonsResponse) XXX_DiscardUnknown()

func (*GetPersonsResponse) XXX_Marshal

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

func (*GetPersonsResponse) XXX_Merge

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

func (*GetPersonsResponse) XXX_Size

func (m *GetPersonsResponse) XXX_Size() int

func (*GetPersonsResponse) XXX_Unmarshal

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

type PersonClient

type PersonClient interface {
	GetPerson(ctx context.Context, in *GetPersonRequest, opts ...grpc.CallOption) (*GetPersonResponse, error)
	GetPersons(ctx context.Context, in *ReadAllPersonRequest, opts ...grpc.CallOption) (*GetPersonsResponse, error)
}

PersonClient is the client API for Person service.

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

func NewPersonClient

func NewPersonClient(cc *grpc.ClientConn) PersonClient

type PersonServer

type PersonServer interface {
	GetPerson(context.Context, *GetPersonRequest) (*GetPersonResponse, error)
	GetPersons(context.Context, *ReadAllPersonRequest) (*GetPersonsResponse, error)
}

PersonServer is the server API for Person service.

type ReadAllPersonRequest

type ReadAllPersonRequest struct {
	Page                 int32    `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
	Limit                int32    `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	Status               int32    `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"`
	OrderBy              string   `protobuf:"bytes,4,opt,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ReadAllPersonRequest) Descriptor

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

func (*ReadAllPersonRequest) GetLimit

func (m *ReadAllPersonRequest) GetLimit() int32

func (*ReadAllPersonRequest) GetOrderBy

func (m *ReadAllPersonRequest) GetOrderBy() string

func (*ReadAllPersonRequest) GetPage

func (m *ReadAllPersonRequest) GetPage() int32

func (*ReadAllPersonRequest) GetStatus

func (m *ReadAllPersonRequest) GetStatus() int32

func (*ReadAllPersonRequest) ProtoMessage

func (*ReadAllPersonRequest) ProtoMessage()

func (*ReadAllPersonRequest) Reset

func (m *ReadAllPersonRequest) Reset()

func (*ReadAllPersonRequest) String

func (m *ReadAllPersonRequest) String() string

func (*ReadAllPersonRequest) XXX_DiscardUnknown

func (m *ReadAllPersonRequest) XXX_DiscardUnknown()

func (*ReadAllPersonRequest) XXX_Marshal

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

func (*ReadAllPersonRequest) XXX_Merge

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

func (*ReadAllPersonRequest) XXX_Size

func (m *ReadAllPersonRequest) XXX_Size() int

func (*ReadAllPersonRequest) XXX_Unmarshal

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

type UnimplementedPersonServer

type UnimplementedPersonServer struct {
}

UnimplementedPersonServer can be embedded to have forward compatible implementations.

func (*UnimplementedPersonServer) GetPerson

func (*UnimplementedPersonServer) GetPersons

Jump to

Keyboard shortcuts

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