types

package
v0.0.0-...-e47c314 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	// ModuleName defines the module name
	ModuleName = "samplemod"

	// Version defines the current version the samplemod
	// module supports
	Version = "samplemod-1"

	// StoreKey defines the primary module store key
	StoreKey = ModuleName

	// RouterKey is the message route for slashing
	RouterKey = ModuleName

	// QuerierRoute defines the module's query routing key
	QuerierRoute = ModuleName

	// MemStoreKey defines the in-memory store key
	MemStoreKey = "mem_capability"
)

Variables

View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// ModuleCdc references the global x/ibc-transfer module codec. Note, the codec
	// should ONLY be used in certain instances of tests and for JSON encoding.
	//
	// The actual codec used for serialization should be provided to x/ibc-transfer and
	// defined at the application level.
	ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry())
)

Functions

func RegisterInterfaces

func RegisterInterfaces(registry codectypes.InterfaceRegistry)

RegisterInterfaces register the ibc transfer module interfaces to protobuf Any.

func RegisterQueryHandler

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

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

func RegisterQueryHandlerClient

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

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

func RegisterQueryHandlerFromEndpoint

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

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

func RegisterQueryHandlerServer

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type ContractCallRequest

type ContractCallRequest struct {
	Method string   `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"`
	Args   []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`
}

func NewContractCallRequest

func NewContractCallRequest(method string, args ...string) ContractCallRequest

NewContractCallRequest creates a new instance of ContractCallRequest

func (ContractCallRequest) ContractCallInfo

ContractCallInfo converts the ContractCallRequest to a ContractCallInfo

func (*ContractCallRequest) Descriptor

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

func (*ContractCallRequest) Marshal

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

func (*ContractCallRequest) MarshalTo

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

func (*ContractCallRequest) MarshalToSizedBuffer

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

func (*ContractCallRequest) ProtoMessage

func (*ContractCallRequest) ProtoMessage()

func (*ContractCallRequest) Reset

func (m *ContractCallRequest) Reset()

func (*ContractCallRequest) Size

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

func (*ContractCallRequest) String

func (m *ContractCallRequest) String() string

func (*ContractCallRequest) Unmarshal

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

func (*ContractCallRequest) XXX_DiscardUnknown

func (m *ContractCallRequest) XXX_DiscardUnknown()

func (*ContractCallRequest) XXX_Marshal

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

func (*ContractCallRequest) XXX_Merge

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

func (*ContractCallRequest) XXX_Size

func (m *ContractCallRequest) XXX_Size() int

func (*ContractCallRequest) XXX_Unmarshal

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

type GenesisState

type GenesisState struct {
}

func DefaultGenesis

func DefaultGenesis() *GenesisState

DefaultGenesis returns a GenesisState instance

func NewGenesisState

func NewGenesisState() *GenesisState

NewGenesisState creates a new cross module GenesisState instance.

func (*GenesisState) Descriptor

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

func (*GenesisState) Marshal

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

func (*GenesisState) MarshalTo

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

func (*GenesisState) MarshalToSizedBuffer

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

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

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

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

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

func (GenesisState) Validate

func (gs GenesisState) Validate() error

Validate performs basic genesis state validation returning an error upon any failure.

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

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

func (*GenesisState) XXX_Merge

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

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

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

type QueryClient

type QueryClient interface {
	Counter(ctx context.Context, in *QueryCounterRequest, opts ...grpc.CallOption) (*QueryCounterResponse, error)
}

QueryClient is the client API for Query service.

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

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryCounterRequest

type QueryCounterRequest struct {
	Account github_com_datachainlab_cross_x_core_account_types.AccountID `` /* 137-byte string literal not displayed */
}

func (*QueryCounterRequest) Descriptor

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

func (*QueryCounterRequest) Marshal

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

func (*QueryCounterRequest) MarshalTo

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

func (*QueryCounterRequest) MarshalToSizedBuffer

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

func (*QueryCounterRequest) ProtoMessage

func (*QueryCounterRequest) ProtoMessage()

func (*QueryCounterRequest) Reset

func (m *QueryCounterRequest) Reset()

func (*QueryCounterRequest) Size

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

func (*QueryCounterRequest) String

func (m *QueryCounterRequest) String() string

func (*QueryCounterRequest) Unmarshal

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

func (*QueryCounterRequest) XXX_DiscardUnknown

func (m *QueryCounterRequest) XXX_DiscardUnknown()

func (*QueryCounterRequest) XXX_Marshal

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

func (*QueryCounterRequest) XXX_Merge

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

func (*QueryCounterRequest) XXX_Size

func (m *QueryCounterRequest) XXX_Size() int

func (*QueryCounterRequest) XXX_Unmarshal

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

type QueryCounterResponse

type QueryCounterResponse struct {
	Value uint64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
}

func (*QueryCounterResponse) Descriptor

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

func (*QueryCounterResponse) Marshal

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

func (*QueryCounterResponse) MarshalTo

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

func (*QueryCounterResponse) MarshalToSizedBuffer

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

func (*QueryCounterResponse) ProtoMessage

func (*QueryCounterResponse) ProtoMessage()

func (*QueryCounterResponse) Reset

func (m *QueryCounterResponse) Reset()

func (*QueryCounterResponse) Size

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

func (*QueryCounterResponse) String

func (m *QueryCounterResponse) String() string

func (*QueryCounterResponse) Unmarshal

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

func (*QueryCounterResponse) XXX_DiscardUnknown

func (m *QueryCounterResponse) XXX_DiscardUnknown()

func (*QueryCounterResponse) XXX_Marshal

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

func (*QueryCounterResponse) XXX_Merge

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

func (*QueryCounterResponse) XXX_Size

func (m *QueryCounterResponse) XXX_Size() int

func (*QueryCounterResponse) XXX_Unmarshal

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

type QueryServer

type QueryServer interface {
	Counter(context.Context, *QueryCounterRequest) (*QueryCounterResponse, error)
}

QueryServer is the server API for Query service.

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Counter

Jump to

Keyboard shortcuts

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