Documentation ¶
Overview ¶
Package deputize is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func NewMessage(from sdkTypes.AccAddress, fromID ids.IdentityID, toID ids.IdentityID, ...) sdkTypes.Msg
- func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error
- func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error
- func RegisterMsgServer(s grpc1.Server, srv MsgServer)
- type Message
- func (*Message) Descriptor() ([]byte, []int)
- func (m *Message) GetCanAddMaintainer() bool
- func (m *Message) GetCanCancelOrder() bool
- func (m *Message) GetCanMakeOrder() bool
- func (m *Message) GetCanMutateMaintainer() bool
- func (m *Message) GetCanRemoveMaintainer() bool
- func (m *Message) GetClassificationID() *base.ClassificationID
- func (m *Message) GetFrom() string
- func (m *Message) GetFromID() *base.IdentityID
- func (m *Message) GetMaintainedProperties() *base1.PropertyList
- func (message *Message) GetSigners() []sdkTypes.AccAddress
- func (m *Message) GetToID() *base.IdentityID
- func (m *Message) Marshal() (dAtA []byte, err error)
- func (m *Message) MarshalTo(dAtA []byte) (int, error)
- func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Message) ProtoMessage()
- func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry)
- func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino)
- func (m *Message) Reset()
- func (m *Message) Size() (n int)
- func (m *Message) String() string
- func (message *Message) Type() string
- func (m *Message) Unmarshal(dAtA []byte) error
- func (message *Message) ValidateBasic() error
- func (m *Message) XXX_DiscardUnknown()
- func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Message) XXX_Merge(src proto.Message)
- func (m *Message) XXX_Size() int
- func (m *Message) XXX_Unmarshal(b []byte) error
- type MsgClient
- type MsgServer
- type TransactionResponse
- func (*TransactionResponse) Descriptor() ([]byte, []int)
- func (*TransactionResponse) GetResult() *sdkTypes.Result
- func (m *TransactionResponse) Marshal() (dAtA []byte, err error)
- func (m *TransactionResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *TransactionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*TransactionResponse) ProtoMessage()
- func (m *TransactionResponse) Reset()
- func (m *TransactionResponse) Size() (n int)
- func (m *TransactionResponse) String() string
- func (m *TransactionResponse) Unmarshal(dAtA []byte) error
- func (m *TransactionResponse) XXX_DiscardUnknown()
- func (m *TransactionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TransactionResponse) XXX_Merge(src proto.Message)
- func (m *TransactionResponse) XXX_Size() int
- func (m *TransactionResponse) XXX_Unmarshal(b []byte) error
- type UnimplementedMsgServer
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthMessage = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowMessage = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupMessage = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthTransactionResponse = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTransactionResponse = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTransactionResponse = fmt.Errorf("proto: unexpected end of group") )
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.ToIdentityID, constants.ClassificationID, constants.MaintainedProperties, constants.CanMakeOrder, constants.CanCancelOrder, constants.CanAddMaintainer, constants.CanRemoveMaintainer, constants.CanMutateMaintainer, )
Functions ¶
func NewMessage ¶
func NewMessage(from sdkTypes.AccAddress, fromID ids.IdentityID, toID ids.IdentityID, classificationID ids.ClassificationID, maintainedProperties lists.PropertyList, canMakeOrder bool, canCancelOrder bool, canAddMaintainer bool, canRemoveMaintainer bool, canMutateMaintainer bool) sdkTypes.Msg
func RegisterMsgHandler ¶
RegisterMsgHandler registers the http handlers for service Msg to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterMsgHandlerClient ¶
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 ¶
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 ¶
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"` ToID *base.IdentityID `protobuf:"bytes,3,opt,name=to_i_d,json=toID,proto3" json:"to_i_d,omitempty"` ClassificationID *base.ClassificationID `protobuf:"bytes,4,opt,name=classification_i_d,json=classificationID,proto3" json:"classification_i_d,omitempty"` MaintainedProperties *base1.PropertyList `protobuf:"bytes,5,opt,name=maintained_properties,json=maintainedProperties,proto3" json:"maintained_properties,omitempty"` CanMakeOrder bool `protobuf:"varint,6,opt,name=can_make_order,json=canMakeOrder,proto3" json:"can_make_order,omitempty"` CanCancelOrder bool `protobuf:"varint,7,opt,name=can_cancel_order,json=canCancelOrder,proto3" json:"can_cancel_order,omitempty"` CanAddMaintainer bool `protobuf:"varint,8,opt,name=can_add_maintainer,json=canAddMaintainer,proto3" json:"can_add_maintainer,omitempty"` CanRemoveMaintainer bool `protobuf:"varint,9,opt,name=can_remove_maintainer,json=canRemoveMaintainer,proto3" json:"can_remove_maintainer,omitempty"` CanMutateMaintainer bool `protobuf:"varint,10,opt,name=can_mutate_maintainer,json=canMutateMaintainer,proto3" json:"can_mutate_maintainer,omitempty"` }
func (*Message) Descriptor ¶
func (*Message) GetCanAddMaintainer ¶
func (*Message) GetCanCancelOrder ¶
func (*Message) GetCanMakeOrder ¶
func (*Message) GetCanMutateMaintainer ¶
func (*Message) GetCanRemoveMaintainer ¶
func (*Message) GetClassificationID ¶
func (m *Message) GetClassificationID() *base.ClassificationID
func (*Message) GetFromID ¶
func (m *Message) GetFromID() *base.IdentityID
func (*Message) GetMaintainedProperties ¶
func (m *Message) GetMaintainedProperties() *base1.PropertyList
func (*Message) GetSigners ¶
func (message *Message) GetSigners() []sdkTypes.AccAddress
func (*Message) GetToID ¶
func (m *Message) GetToID() *base.IdentityID
func (*Message) MarshalToSizedBuffer ¶
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) ValidateBasic ¶
func (*Message) XXX_DiscardUnknown ¶
func (m *Message) XXX_DiscardUnknown()
func (*Message) XXX_Marshal ¶
func (*Message) XXX_Unmarshal ¶
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 ¶
func (*UnimplementedMsgServer) Handle(ctx context.Context, req *Message) (*TransactionResponse, error)