protos

package
v0.0.0-...-92146ed Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package protos is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterPersonServiceHandler

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

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

func RegisterPersonServiceHandlerClient

func RegisterPersonServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PersonServiceClient) error

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

func RegisterPersonServiceHandlerFromEndpoint

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

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

func RegisterPersonServiceServer

func RegisterPersonServiceServer(s *grpc.Server, srv PersonServiceServer)

Types

type ListPersonRequest

type ListPersonRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ListPersonRequest) Descriptor

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

func (*ListPersonRequest) ProtoMessage

func (*ListPersonRequest) ProtoMessage()

func (*ListPersonRequest) Reset

func (m *ListPersonRequest) Reset()

func (*ListPersonRequest) String

func (m *ListPersonRequest) String() string

func (*ListPersonRequest) XXX_DiscardUnknown

func (m *ListPersonRequest) XXX_DiscardUnknown()

func (*ListPersonRequest) XXX_Marshal

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

func (*ListPersonRequest) XXX_Merge

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

func (*ListPersonRequest) XXX_Size

func (m *ListPersonRequest) XXX_Size() int

func (*ListPersonRequest) XXX_Unmarshal

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

type ListPersonResponse

type ListPersonResponse struct {
	Person               []*Person `protobuf:"bytes,1,rep,name=person,proto3" json:"person,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*ListPersonResponse) Descriptor

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

func (*ListPersonResponse) GetPerson

func (m *ListPersonResponse) GetPerson() []*Person

func (*ListPersonResponse) ProtoMessage

func (*ListPersonResponse) ProtoMessage()

func (*ListPersonResponse) Reset

func (m *ListPersonResponse) Reset()

func (*ListPersonResponse) String

func (m *ListPersonResponse) String() string

func (*ListPersonResponse) XXX_DiscardUnknown

func (m *ListPersonResponse) XXX_DiscardUnknown()

func (*ListPersonResponse) XXX_Marshal

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

func (*ListPersonResponse) XXX_Merge

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

func (*ListPersonResponse) XXX_Size

func (m *ListPersonResponse) XXX_Size() int

func (*ListPersonResponse) XXX_Unmarshal

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

type Person

type Person 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"`
	Address              string   `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"`
	Username             string   `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"`
	Password             string   `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Person) Descriptor

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

func (*Person) GetAddress

func (m *Person) GetAddress() string

func (*Person) GetId

func (m *Person) GetId() string

func (*Person) GetName

func (m *Person) GetName() string

func (*Person) GetPassword

func (m *Person) GetPassword() string

func (*Person) GetUsername

func (m *Person) GetUsername() string

func (*Person) ProtoMessage

func (*Person) ProtoMessage()

func (*Person) Reset

func (m *Person) Reset()

func (*Person) String

func (m *Person) String() string

func (*Person) XXX_DiscardUnknown

func (m *Person) XXX_DiscardUnknown()

func (*Person) XXX_Marshal

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

func (*Person) XXX_Merge

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

func (*Person) XXX_Size

func (m *Person) XXX_Size() int

func (*Person) XXX_Unmarshal

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

type PersonServiceClient

type PersonServiceClient interface {
	ListPeople(ctx context.Context, in *ListPersonRequest, opts ...grpc.CallOption) (*ListPersonResponse, error)
}

PersonServiceClient is the client API for PersonService service.

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

func NewPersonServiceClient

func NewPersonServiceClient(cc *grpc.ClientConn) PersonServiceClient

type PersonServiceServer

type PersonServiceServer interface {
	ListPeople(context.Context, *ListPersonRequest) (*ListPersonResponse, error)
}

PersonServiceServer is the server API for PersonService service.

type UnimplementedPersonServiceServer

type UnimplementedPersonServiceServer struct {
}

UnimplementedPersonServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedPersonServiceServer) ListPeople

Jump to

Keyboard shortcuts

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