protos

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 14 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 RegisterExampleHandler

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

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

func RegisterExampleHandlerClient

func RegisterExampleHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ExampleClient) error

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

func RegisterExampleHandlerFromEndpoint

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

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

func RegisterExampleServer

func RegisterExampleServer(s *grpc.Server, srv ExampleServer)

Types

type ExampleClient

type ExampleClient interface {
	// Get service version and build info
	Info(ctx context.Context, in *ServiceInfoRequest, opts ...grpc.CallOption) (*ServiceInfoResponse, error)
}

ExampleClient is the client API for Example service.

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

func NewExampleClient

func NewExampleClient(cc *grpc.ClientConn) ExampleClient

type ExampleServer

type ExampleServer interface {
	// Get service version and build info
	Info(context.Context, *ServiceInfoRequest) (*ServiceInfoResponse, error)
}

ExampleServer is the server API for Example service.

type ServiceInfoRequest

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

func (*ServiceInfoRequest) Descriptor

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

func (*ServiceInfoRequest) ProtoMessage

func (*ServiceInfoRequest) ProtoMessage()

func (*ServiceInfoRequest) Reset

func (m *ServiceInfoRequest) Reset()

func (*ServiceInfoRequest) String

func (m *ServiceInfoRequest) String() string

func (*ServiceInfoRequest) XXX_DiscardUnknown

func (m *ServiceInfoRequest) XXX_DiscardUnknown()

func (*ServiceInfoRequest) XXX_Marshal

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

func (*ServiceInfoRequest) XXX_Merge

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

func (*ServiceInfoRequest) XXX_Size

func (m *ServiceInfoRequest) XXX_Size() int

func (*ServiceInfoRequest) XXX_Unmarshal

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

type ServiceInfoResponse

type ServiceInfoResponse struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Version              string   `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	Build                string   `protobuf:"bytes,3,opt,name=build,proto3" json:"build,omitempty"`
	BuiltAt              string   `protobuf:"bytes,4,opt,name=built_at,json=builtAt,proto3" json:"built_at,omitempty"`
	GitHash              string   `protobuf:"bytes,5,opt,name=git_hash,json=gitHash,proto3" json:"git_hash,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ServiceInfoResponse) Descriptor

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

func (*ServiceInfoResponse) GetBuild

func (m *ServiceInfoResponse) GetBuild() string

func (*ServiceInfoResponse) GetBuiltAt

func (m *ServiceInfoResponse) GetBuiltAt() string

func (*ServiceInfoResponse) GetGitHash

func (m *ServiceInfoResponse) GetGitHash() string

func (*ServiceInfoResponse) GetName

func (m *ServiceInfoResponse) GetName() string

func (*ServiceInfoResponse) GetVersion

func (m *ServiceInfoResponse) GetVersion() string

func (*ServiceInfoResponse) ProtoMessage

func (*ServiceInfoResponse) ProtoMessage()

func (*ServiceInfoResponse) Reset

func (m *ServiceInfoResponse) Reset()

func (*ServiceInfoResponse) String

func (m *ServiceInfoResponse) String() string

func (*ServiceInfoResponse) XXX_DiscardUnknown

func (m *ServiceInfoResponse) XXX_DiscardUnknown()

func (*ServiceInfoResponse) XXX_Marshal

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

func (*ServiceInfoResponse) XXX_Merge

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

func (*ServiceInfoResponse) XXX_Size

func (m *ServiceInfoResponse) XXX_Size() int

func (*ServiceInfoResponse) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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