unwrap

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Overview

Package unwrap is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthMessage        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMessage          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMessage = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTransactionResponse        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTransactionResponse          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTransactionResponse = fmt.Errorf("proto: unexpected end of group")
)
View Source
var Transaction = baseHelpers.NewTransaction(
	name.GetPackageName(dummy{}),
	"",
	"",

	requestPrototype,
	messagePrototype,
	keeperPrototype,

	func(server grpc.Server, keeper helpers.TransactionKeeper) {
		RegisterMsgServer(server, keeper.(transactionKeeper))
	},
	func(clientCtx client.Context, mux *runtime.ServeMux) error {
		return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx))
	},

	constants.FromIdentityID,
	constants.Coins,
)

Functions

func NewMessage

func NewMessage(from sdkTypes.AccAddress, fromID ids.IdentityID, coins sdkTypes.Coins) sdkTypes.Msg

func RegisterMsgHandler

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

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

func RegisterMsgHandlerClient

func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error

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

func RegisterMsgHandlerFromEndpoint

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

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

func RegisterMsgHandlerServer

func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error

RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". UnaryRPC :call MsgServer 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 RegisterMsgHandlerFromEndpoint instead.

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

Types

type Message

type Message struct {
	From   string                                   `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"`
	FromID *base.IdentityID                         `protobuf:"bytes,2,opt,name=from_i_d,json=fromID,proto3" json:"from_i_d,omitempty"`
	Coins  github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=coins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coins"`
}

func (*Message) Descriptor

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

func (*Message) GetCoins

func (*Message) GetFrom

func (m *Message) GetFrom() string

func (*Message) GetFromID

func (m *Message) GetFromID() *base.IdentityID

func (*Message) GetSigners

func (message *Message) GetSigners() []sdkTypes.AccAddress

func (*Message) Marshal

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

func (*Message) MarshalTo

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

func (*Message) MarshalToSizedBuffer

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

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) RegisterInterface

func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry)

func (*Message) RegisterLegacyAminoCodec

func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino)

func (*Message) Reset

func (m *Message) Reset()

func (*Message) Size

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

func (*Message) String

func (m *Message) String() string

func (*Message) Type

func (message *Message) Type() string

func (*Message) Unmarshal

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

func (*Message) ValidateBasic

func (message *Message) ValidateBasic() error

func (*Message) XXX_DiscardUnknown

func (m *Message) XXX_DiscardUnknown()

func (*Message) XXX_Marshal

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

func (*Message) XXX_Merge

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

func (*Message) XXX_Size

func (m *Message) XXX_Size() int

func (*Message) XXX_Unmarshal

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

type MsgClient

type MsgClient interface {
	Handle(ctx context.Context, in *Message, opts ...grpc.CallOption) (*TransactionResponse, error)
}

MsgClient is the client API for Msg service.

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

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgServer

type MsgServer interface {
	Handle(context.Context, *Message) (*TransactionResponse, error)
}

MsgServer is the server API for Msg service.

type TransactionResponse

type TransactionResponse struct {
}

func (*TransactionResponse) Descriptor

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

func (*TransactionResponse) GetResult

func (*TransactionResponse) GetResult() *sdkTypes.Result

func (*TransactionResponse) Marshal

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

func (*TransactionResponse) MarshalTo

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

func (*TransactionResponse) MarshalToSizedBuffer

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

func (*TransactionResponse) ProtoMessage

func (*TransactionResponse) ProtoMessage()

func (*TransactionResponse) Reset

func (m *TransactionResponse) Reset()

func (*TransactionResponse) Size

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

func (*TransactionResponse) String

func (m *TransactionResponse) String() string

func (*TransactionResponse) Unmarshal

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

func (*TransactionResponse) XXX_DiscardUnknown

func (m *TransactionResponse) XXX_DiscardUnknown()

func (*TransactionResponse) XXX_Marshal

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

func (*TransactionResponse) XXX_Merge

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

func (*TransactionResponse) XXX_Size

func (m *TransactionResponse) XXX_Size() int

func (*TransactionResponse) XXX_Unmarshal

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

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) Handle

Jump to

Keyboard shortcuts

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