service

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package service is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthService        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowService          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupService = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterServiceHandler

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

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

func RegisterServiceHandlerClient

func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServiceClient) error

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

func RegisterServiceHandlerFromEndpoint

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

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

func RegisterServiceHandlerServer

func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServiceServer) error

RegisterServiceHandlerServer registers the http handlers for service Service to "mux". UnaryRPC :call ServiceServer 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 RegisterServiceHandlerFromEndpoint instead.

func RegisterServiceServer

func RegisterServiceServer(s grpc1.Server, srv ServiceServer)

Types

type ServiceClient

type ServiceClient interface {
	// Simulate simulates executing a transaction for estimating gas usage.
	Simulate(ctx context.Context, in *SimulateRequest, opts ...grpc.CallOption) (*SimulateResponse, error)
}

ServiceClient is the client API for Service service.

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

func NewServiceClient

func NewServiceClient(cc grpc1.ClientConn) ServiceClient

type ServiceServer

type ServiceServer interface {
	// Simulate simulates executing a transaction for estimating gas usage.
	Simulate(context.Context, *SimulateRequest) (*SimulateResponse, error)
}

ServiceServer is the server API for Service service.

type SimulateRequest

type SimulateRequest struct {
	// tx is the transaction to simulate.
	Tx []byte `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"`
}

SimulateRequest is the request type for the Service.Simulate RPC method.

func (*SimulateRequest) Descriptor

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

func (*SimulateRequest) GetTx

func (m *SimulateRequest) GetTx() []byte

func (*SimulateRequest) Marshal

func (m *SimulateRequest) Marshal() (dAtA []byte, err error)

func (*SimulateRequest) MarshalTo

func (m *SimulateRequest) MarshalTo(dAtA []byte) (int, error)

func (*SimulateRequest) MarshalToSizedBuffer

func (m *SimulateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SimulateRequest) ProtoMessage

func (*SimulateRequest) ProtoMessage()

func (*SimulateRequest) Reset

func (m *SimulateRequest) Reset()

func (*SimulateRequest) Size

func (m *SimulateRequest) Size() (n int)

func (*SimulateRequest) String

func (m *SimulateRequest) String() string

func (*SimulateRequest) Unmarshal

func (m *SimulateRequest) Unmarshal(dAtA []byte) error

func (*SimulateRequest) XXX_DiscardUnknown

func (m *SimulateRequest) XXX_DiscardUnknown()

func (*SimulateRequest) XXX_Marshal

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

func (*SimulateRequest) XXX_Merge

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

func (*SimulateRequest) XXX_Size

func (m *SimulateRequest) XXX_Size() int

func (*SimulateRequest) XXX_Unmarshal

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

type SimulateResponse

type SimulateResponse struct {
	// result is the result of the simulation.
	Result *types.Result `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
}

SimulateResponse is the response type for the Service.SimulateRPC method.

func (*SimulateResponse) Descriptor

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

func (*SimulateResponse) GetResult

func (m *SimulateResponse) GetResult() *types.Result

func (*SimulateResponse) Marshal

func (m *SimulateResponse) Marshal() (dAtA []byte, err error)

func (*SimulateResponse) MarshalTo

func (m *SimulateResponse) MarshalTo(dAtA []byte) (int, error)

func (*SimulateResponse) MarshalToSizedBuffer

func (m *SimulateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SimulateResponse) ProtoMessage

func (*SimulateResponse) ProtoMessage()

func (*SimulateResponse) Reset

func (m *SimulateResponse) Reset()

func (*SimulateResponse) Size

func (m *SimulateResponse) Size() (n int)

func (*SimulateResponse) String

func (m *SimulateResponse) String() string

func (*SimulateResponse) Unmarshal

func (m *SimulateResponse) Unmarshal(dAtA []byte) error

func (*SimulateResponse) XXX_DiscardUnknown

func (m *SimulateResponse) XXX_DiscardUnknown()

func (*SimulateResponse) XXX_Marshal

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

func (*SimulateResponse) XXX_Merge

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

func (*SimulateResponse) XXX_Size

func (m *SimulateResponse) XXX_Size() int

func (*SimulateResponse) XXX_Unmarshal

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

type UnimplementedServiceServer

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedServiceServer) Simulate

Jump to

Keyboard shortcuts

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