grpcserver

package
v0.0.0-...-e77dc18 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package grpcserver is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_api_gen_boilerplate_go_api_proto protoreflect.FileDescriptor

Functions

func RegisterBlockchainServiceHandler

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

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

func RegisterBlockchainServiceHandlerClient

func RegisterBlockchainServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BlockchainServiceClient) error

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

func RegisterBlockchainServiceHandlerFromEndpoint

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

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

func RegisterBlockchainServiceHandlerServer

func RegisterBlockchainServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BlockchainServiceServer) error

RegisterBlockchainServiceHandlerServer registers the http handlers for service BlockchainService to "mux". UnaryRPC :call BlockchainServiceServer 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 RegisterBlockchainServiceHandlerFromEndpoint instead.

func RegisterBlockchainServiceServer

func RegisterBlockchainServiceServer(s *grpc.Server, srv BlockchainServiceServer)

func RegisterHttpBodyExampleServiceHandler

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

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

func RegisterHttpBodyExampleServiceHandlerClient

func RegisterHttpBodyExampleServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HttpBodyExampleServiceClient) error

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

func RegisterHttpBodyExampleServiceHandlerFromEndpoint

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

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

func RegisterHttpBodyExampleServiceHandlerServer

func RegisterHttpBodyExampleServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HttpBodyExampleServiceServer) error

RegisterHttpBodyExampleServiceHandlerServer registers the http handlers for service HttpBodyExampleService to "mux". UnaryRPC :call HttpBodyExampleServiceServer 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 RegisterHttpBodyExampleServiceHandlerFromEndpoint instead.

func RegisterHttpBodyExampleServiceServer

func RegisterHttpBodyExampleServiceServer(s *grpc.Server, srv HttpBodyExampleServiceServer)

Types

type AddressRequest

type AddressRequest struct {
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	Height  uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
	// contains filtered or unexported fields
}

func (*AddressRequest) Descriptor deprecated

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

Deprecated: Use AddressRequest.ProtoReflect.Descriptor instead.

func (*AddressRequest) GetAddress

func (x *AddressRequest) GetAddress() string

func (*AddressRequest) GetHeight

func (x *AddressRequest) GetHeight() uint64

func (*AddressRequest) ProtoMessage

func (*AddressRequest) ProtoMessage()

func (*AddressRequest) ProtoReflect

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

func (*AddressRequest) Reset

func (x *AddressRequest) Reset()

func (*AddressRequest) String

func (x *AddressRequest) String() string

func (*AddressRequest) Validate

func (this *AddressRequest) Validate() error

type AddressResponse

type AddressResponse struct {
	Balance           map[string]string `` /* 155-byte string literal not displayed */
	TransactionsCount string            `protobuf:"bytes,2,opt,name=transactions_count,json=transactionsCount,proto3" json:"transactions_count,omitempty"`
	// contains filtered or unexported fields
}

func (*AddressResponse) Descriptor deprecated

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

Deprecated: Use AddressResponse.ProtoReflect.Descriptor instead.

func (*AddressResponse) GetBalance

func (x *AddressResponse) GetBalance() map[string]string

func (*AddressResponse) GetTransactionsCount

func (x *AddressResponse) GetTransactionsCount() string

func (*AddressResponse) ProtoMessage

func (*AddressResponse) ProtoMessage()

func (*AddressResponse) ProtoReflect

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

func (*AddressResponse) Reset

func (x *AddressResponse) Reset()

func (*AddressResponse) String

func (x *AddressResponse) String() string

func (*AddressResponse) Validate

func (this *AddressResponse) Validate() error

type BlockchainServiceClient

type BlockchainServiceClient interface {
	Address(ctx context.Context, in *AddressRequest, opts ...grpc.CallOption) (*AddressResponse, error)
	Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (BlockchainService_SubscribeClient, error)
}

BlockchainServiceClient is the client API for BlockchainService service.

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

type BlockchainServiceServer

type BlockchainServiceServer interface {
	Address(context.Context, *AddressRequest) (*AddressResponse, error)
	Subscribe(*SubscribeRequest, BlockchainService_SubscribeServer) error
}

BlockchainServiceServer is the server API for BlockchainService service.

type BlockchainService_SubscribeClient

type BlockchainService_SubscribeClient interface {
	Recv() (*SubscribeResponse, error)
	grpc.ClientStream
}

type BlockchainService_SubscribeServer

type BlockchainService_SubscribeServer interface {
	Send(*SubscribeResponse) error
	grpc.ServerStream
}

type HttpBodyExampleServiceClient

type HttpBodyExampleServiceClient interface {
	HelloWorld(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*httpbody.HttpBody, error)
}

HttpBodyExampleServiceClient is the client API for HttpBodyExampleService service.

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

type HttpBodyExampleServiceServer

type HttpBodyExampleServiceServer interface {
	HelloWorld(context.Context, *empty.Empty) (*httpbody.HttpBody, error)
}

HttpBodyExampleServiceServer is the server API for HttpBodyExampleService service.

type SubscribeRequest

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

func (*SubscribeRequest) Descriptor deprecated

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

Deprecated: Use SubscribeRequest.ProtoReflect.Descriptor instead.

func (*SubscribeRequest) GetQuery

func (x *SubscribeRequest) GetQuery() string

func (*SubscribeRequest) ProtoMessage

func (*SubscribeRequest) ProtoMessage()

func (*SubscribeRequest) ProtoReflect

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

func (*SubscribeRequest) Reset

func (x *SubscribeRequest) Reset()

func (*SubscribeRequest) String

func (x *SubscribeRequest) String() string

func (*SubscribeRequest) Validate

func (this *SubscribeRequest) Validate() error

type SubscribeResponse

type SubscribeResponse struct {
	Query  string                     `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
	Data   *_struct.Struct            `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	Events []*SubscribeResponse_Event `protobuf:"bytes,3,rep,name=events,proto3" json:"events,omitempty"`
	// contains filtered or unexported fields
}

func (*SubscribeResponse) Descriptor deprecated

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

Deprecated: Use SubscribeResponse.ProtoReflect.Descriptor instead.

func (*SubscribeResponse) GetData

func (x *SubscribeResponse) GetData() *_struct.Struct

func (*SubscribeResponse) GetEvents

func (x *SubscribeResponse) GetEvents() []*SubscribeResponse_Event

func (*SubscribeResponse) GetQuery

func (x *SubscribeResponse) GetQuery() string

func (*SubscribeResponse) ProtoMessage

func (*SubscribeResponse) ProtoMessage()

func (*SubscribeResponse) ProtoReflect

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

func (*SubscribeResponse) Reset

func (x *SubscribeResponse) Reset()

func (*SubscribeResponse) String

func (x *SubscribeResponse) String() string

func (*SubscribeResponse) Validate

func (this *SubscribeResponse) Validate() error

type SubscribeResponse_Event

type SubscribeResponse_Event struct {
	Key    string   `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Events []string `protobuf:"bytes,2,rep,name=events,proto3" json:"events,omitempty"`
	// contains filtered or unexported fields
}

func (*SubscribeResponse_Event) Descriptor deprecated

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

Deprecated: Use SubscribeResponse_Event.ProtoReflect.Descriptor instead.

func (*SubscribeResponse_Event) GetEvents

func (x *SubscribeResponse_Event) GetEvents() []string

func (*SubscribeResponse_Event) GetKey

func (x *SubscribeResponse_Event) GetKey() string

func (*SubscribeResponse_Event) ProtoMessage

func (*SubscribeResponse_Event) ProtoMessage()

func (*SubscribeResponse_Event) ProtoReflect

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

func (*SubscribeResponse_Event) Reset

func (x *SubscribeResponse_Event) Reset()

func (*SubscribeResponse_Event) String

func (x *SubscribeResponse_Event) String() string

func (*SubscribeResponse_Event) Validate

func (this *SubscribeResponse_Event) Validate() error

type UnimplementedBlockchainServiceServer

type UnimplementedBlockchainServiceServer struct {
}

UnimplementedBlockchainServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedBlockchainServiceServer) Address

func (*UnimplementedBlockchainServiceServer) Subscribe

type UnimplementedHttpBodyExampleServiceServer

type UnimplementedHttpBodyExampleServiceServer struct {
}

UnimplementedHttpBodyExampleServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedHttpBodyExampleServiceServer) HelloWorld

Jump to

Keyboard shortcuts

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