Documentation ¶
Overview ¶
Package types is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterInterfaces(registry types.InterfaceRegistry)
- func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
- func RegisterMsgServer(s grpc1.Server, srv MsgServer)
- func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error
- func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error
- func RegisterQueryServer(s grpc1.Server, srv QueryServer)
- func SessionStoreKey(id SessionID) []byte
- func ValidateGenesis(state *GenesisState) error
- type GenesisState
- func (*GenesisState) Descriptor() ([]byte, []int)
- func (m *GenesisState) GetDefaultSessionLength() uint64
- func (m *GenesisState) GetSessions() []Session
- func (m *GenesisState) Marshal() (dAtA []byte, err error)
- func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)
- func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GenesisState) ProtoMessage()
- func (m *GenesisState) Reset()
- func (m *GenesisState) Size() (n int)
- func (m *GenesisState) String() string
- func (m *GenesisState) Unmarshal(dAtA []byte) error
- func (m *GenesisState) XXX_DiscardUnknown()
- func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GenesisState) XXX_Merge(src proto.Message)
- func (m *GenesisState) XXX_Size() int
- func (m *GenesisState) XXX_Unmarshal(b []byte) error
- type MsgClient
- type MsgCreateSession
- func (*MsgCreateSession) Descriptor() ([]byte, []int)
- func (msg MsgCreateSession) GetSignBytes() []byte
- func (msg MsgCreateSession) GetSigners() []sdk.AccAddress
- func (m *MsgCreateSession) Marshal() (dAtA []byte, err error)
- func (m *MsgCreateSession) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgCreateSession) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgCreateSession) ProtoMessage()
- func (m *MsgCreateSession) Reset()
- func (msg MsgCreateSession) Route() string
- func (m *MsgCreateSession) Size() (n int)
- func (m *MsgCreateSession) String() string
- func (msg MsgCreateSession) Type() string
- func (m *MsgCreateSession) Unmarshal(dAtA []byte) error
- func (msg MsgCreateSession) ValidateBasic() error
- func (m *MsgCreateSession) XXX_DiscardUnknown()
- func (m *MsgCreateSession) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgCreateSession) XXX_Merge(src proto.Message)
- func (m *MsgCreateSession) XXX_Size() int
- func (m *MsgCreateSession) XXX_Unmarshal(b []byte) error
- type MsgCreateSessionResponse
- func (*MsgCreateSessionResponse) Descriptor() ([]byte, []int)
- func (m *MsgCreateSessionResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgCreateSessionResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgCreateSessionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgCreateSessionResponse) ProtoMessage()
- func (m *MsgCreateSessionResponse) Reset()
- func (m *MsgCreateSessionResponse) Size() (n int)
- func (m *MsgCreateSessionResponse) String() string
- func (m *MsgCreateSessionResponse) Unmarshal(dAtA []byte) error
- func (m *MsgCreateSessionResponse) XXX_DiscardUnknown()
- func (m *MsgCreateSessionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgCreateSessionResponse) XXX_Merge(src proto.Message)
- func (m *MsgCreateSessionResponse) XXX_Size() int
- func (m *MsgCreateSessionResponse) XXX_Unmarshal(b []byte) error
- type MsgServer
- type QueryClient
- type QueryServer
- type QuerySessionRequest
- func (*QuerySessionRequest) Descriptor() ([]byte, []int)
- func (m *QuerySessionRequest) Marshal() (dAtA []byte, err error)
- func (m *QuerySessionRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *QuerySessionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QuerySessionRequest) ProtoMessage()
- func (m *QuerySessionRequest) Reset()
- func (m *QuerySessionRequest) Size() (n int)
- func (m *QuerySessionRequest) String() string
- func (m *QuerySessionRequest) Unmarshal(dAtA []byte) error
- func (m *QuerySessionRequest) XXX_DiscardUnknown()
- func (m *QuerySessionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QuerySessionRequest) XXX_Merge(src proto.Message)
- func (m *QuerySessionRequest) XXX_Size() int
- func (m *QuerySessionRequest) XXX_Unmarshal(b []byte) error
- type QuerySessionResponse
- func (*QuerySessionResponse) Descriptor() ([]byte, []int)
- func (m *QuerySessionResponse) GetSession() *Session
- func (m *QuerySessionResponse) Marshal() (dAtA []byte, err error)
- func (m *QuerySessionResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *QuerySessionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QuerySessionResponse) ProtoMessage()
- func (m *QuerySessionResponse) Reset()
- func (m *QuerySessionResponse) Size() (n int)
- func (m *QuerySessionResponse) String() string
- func (m *QuerySessionResponse) Unmarshal(dAtA []byte) error
- func (m *QuerySessionResponse) XXX_DiscardUnknown()
- func (m *QuerySessionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QuerySessionResponse) XXX_Merge(src proto.Message)
- func (m *QuerySessionResponse) XXX_Size() int
- func (m *QuerySessionResponse) XXX_Unmarshal(b []byte) error
- type Session
- func (*Session) Descriptor() ([]byte, []int)
- func (this *Session) Equal(that interface{}) bool
- func (m *Session) GetCreationTime() uint64
- func (m *Session) GetExpirationTime() uint64
- func (m *Session) GetExternalOwner() string
- func (m *Session) GetNamespace() string
- func (m *Session) GetOwner() string
- func (m *Session) GetPublicKey() string
- func (m *Session) GetSessionId() SessionID
- func (m *Session) GetSignature() string
- func (m *Session) Marshal() (dAtA []byte, err error)
- func (m *Session) MarshalTo(dAtA []byte) (int, error)
- func (m *Session) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Session) ProtoMessage()
- func (m *Session) Reset()
- func (m *Session) Size() (n int)
- func (m *Session) String() string
- func (m *Session) Unmarshal(dAtA []byte) error
- func (m *Session) XXX_DiscardUnknown()
- func (m *Session) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Session) XXX_Merge(src proto.Message)
- func (m *Session) XXX_Size() int
- func (m *Session) XXX_Unmarshal(b []byte) error
- type SessionID
- func (*SessionID) Descriptor() ([]byte, []int)
- func (this *SessionID) Equal(that interface{}) bool
- func (m *SessionID) GetValue() uint64
- func (m *SessionID) Marshal() (dAtA []byte, err error)
- func (m *SessionID) MarshalTo(dAtA []byte) (int, error)
- func (m *SessionID) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (id SessionID) Next() SessionID
- func (*SessionID) ProtoMessage()
- func (m *SessionID) Reset()
- func (m *SessionID) Size() (n int)
- func (m *SessionID) String() string
- func (m *SessionID) Unmarshal(dAtA []byte) error
- func (id SessionID) Valid() bool
- func (m *SessionID) XXX_DiscardUnknown()
- func (m *SessionID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SessionID) XXX_Merge(src proto.Message)
- func (m *SessionID) XXX_Size() int
- func (m *SessionID) XXX_Unmarshal(b []byte) error
- type UnimplementedMsgServer
- type UnimplementedQueryServer
Constants ¶
const ( EventTypeCreateSession = "create_session" AttributeKeySessionID = "session_id" AttributeKeyNamespace = "namespace" AttributeKeyExternalOwner = "external_owner" AttributeKeyExpiry = "expiry" AttributeValueCategory = ModuleName )
Magpie module event types
const ( ModuleName = "magpie" RouterKey = ModuleName StoreKey = ModuleName ActionCreationSession = "create_session" )
Variables ¶
var ( ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") )
var ( SessionLengthKey = []byte("default_session_length") LastSessionIDStoreKey = []byte("last_session_id") SessionStorePrefix = []byte("session") )
var ( ErrInvalidLengthModels = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowModels = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupModels = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthMsgs = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowMsgs = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupMsgs = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") )
var (
ModuleCdc = codec.NewAminoCodec(amino)
)
Functions ¶
func RegisterInterfaces ¶ added in v0.15.0
func RegisterInterfaces(registry types.InterfaceRegistry)
func RegisterLegacyAminoCodec ¶ added in v0.15.0
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
RegisterLegacyAminoCodec registers concrete types on the Amino codec
func RegisterMsgServer ¶ added in v0.15.0
func RegisterQueryHandler ¶ added in v0.15.0
RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterQueryHandlerClient ¶ added in v0.15.0
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 ¶ added in v0.15.0
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 ¶ added in v0.15.0
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 ¶ added in v0.15.0
func RegisterQueryServer(s grpc1.Server, srv QueryServer)
func SessionStoreKey ¶
SessionStoreKey turns a session id to a key used to store a session into the sessions store nolint: interfacer
func ValidateGenesis ¶
func ValidateGenesis(state *GenesisState) error
ValidateGenesis validates the given genesis state and returns an error if something is invalid
Types ¶
type GenesisState ¶
type GenesisState struct { DefaultSessionLength uint64 `` /* 154-byte string literal not displayed */ Sessions []Session `protobuf:"bytes,2,rep,name=sessions,proto3" json:"sessions"` }
GenesisState defines the magpie module's genesis state.
func DefaultGenesisState ¶
func DefaultGenesisState() *GenesisState
DefaultGenesisState returns a default GenesisState
func NewGenesisState ¶
func NewGenesisState(defaultSessionLength uint64, sessions []Session) *GenesisState
NewGenesisState allows to create a new genesis state containing the given default session length and sessions
func (*GenesisState) Descriptor ¶ added in v0.15.0
func (*GenesisState) Descriptor() ([]byte, []int)
func (*GenesisState) GetDefaultSessionLength ¶ added in v0.15.0
func (m *GenesisState) GetDefaultSessionLength() uint64
func (*GenesisState) GetSessions ¶ added in v0.15.0
func (m *GenesisState) GetSessions() []Session
func (*GenesisState) Marshal ¶ added in v0.15.0
func (m *GenesisState) Marshal() (dAtA []byte, err error)
func (*GenesisState) MarshalTo ¶ added in v0.15.0
func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)
func (*GenesisState) MarshalToSizedBuffer ¶ added in v0.15.0
func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GenesisState) ProtoMessage ¶ added in v0.15.0
func (*GenesisState) ProtoMessage()
func (*GenesisState) Reset ¶ added in v0.15.0
func (m *GenesisState) Reset()
func (*GenesisState) Size ¶ added in v0.15.0
func (m *GenesisState) Size() (n int)
func (*GenesisState) String ¶ added in v0.15.0
func (m *GenesisState) String() string
func (*GenesisState) Unmarshal ¶ added in v0.15.0
func (m *GenesisState) Unmarshal(dAtA []byte) error
func (*GenesisState) XXX_DiscardUnknown ¶ added in v0.15.0
func (m *GenesisState) XXX_DiscardUnknown()
func (*GenesisState) XXX_Marshal ¶ added in v0.15.0
func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GenesisState) XXX_Merge ¶ added in v0.15.0
func (m *GenesisState) XXX_Merge(src proto.Message)
func (*GenesisState) XXX_Size ¶ added in v0.15.0
func (m *GenesisState) XXX_Size() int
func (*GenesisState) XXX_Unmarshal ¶ added in v0.15.0
func (m *GenesisState) XXX_Unmarshal(b []byte) error
type MsgClient ¶ added in v0.15.0
type MsgClient interface { // CreateSession defines a method for creating a new session CreateSession(ctx context.Context, in *MsgCreateSession, opts ...grpc.CallOption) (*MsgCreateSessionResponse, 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 ¶ added in v0.15.0
func NewMsgClient(cc grpc1.ClientConn) MsgClient
type MsgCreateSession ¶
type MsgCreateSession struct { Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty" yaml:"namespace"` ExternalOwner string `protobuf:"bytes,3,opt,name=external_owner,json=externalOwner,proto3" json:"external_owner,omitempty" yaml:"external_owner"` PubKey string `protobuf:"bytes,4,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty" yaml:"pub_key"` Signature string `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty" yaml:"signature"` }
MsgCreateSession represents a message to create a session for a user from a different cosmos chain.
func NewMsgCreateSession ¶
func NewMsgCreateSession( owner string, namespace string, externalOwner string, pubkey string, signature string, ) *MsgCreateSession
NewMsgCreateSession is the constructor of MsgCreateSession
func (*MsgCreateSession) Descriptor ¶ added in v0.15.0
func (*MsgCreateSession) Descriptor() ([]byte, []int)
func (MsgCreateSession) GetSignBytes ¶
func (msg MsgCreateSession) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgCreateSession) GetSigners ¶
func (msg MsgCreateSession) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (*MsgCreateSession) Marshal ¶ added in v0.15.0
func (m *MsgCreateSession) Marshal() (dAtA []byte, err error)
func (*MsgCreateSession) MarshalTo ¶ added in v0.15.0
func (m *MsgCreateSession) MarshalTo(dAtA []byte) (int, error)
func (*MsgCreateSession) MarshalToSizedBuffer ¶ added in v0.15.0
func (m *MsgCreateSession) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgCreateSession) ProtoMessage ¶ added in v0.15.0
func (*MsgCreateSession) ProtoMessage()
func (*MsgCreateSession) Reset ¶ added in v0.15.0
func (m *MsgCreateSession) Reset()
func (MsgCreateSession) Route ¶
func (msg MsgCreateSession) Route() string
Route should return the name of the module
func (*MsgCreateSession) Size ¶ added in v0.15.0
func (m *MsgCreateSession) Size() (n int)
func (*MsgCreateSession) String ¶ added in v0.15.0
func (m *MsgCreateSession) String() string
func (MsgCreateSession) Type ¶
func (msg MsgCreateSession) Type() string
Type should return the action
func (*MsgCreateSession) Unmarshal ¶ added in v0.15.0
func (m *MsgCreateSession) Unmarshal(dAtA []byte) error
func (MsgCreateSession) ValidateBasic ¶
func (msg MsgCreateSession) ValidateBasic() error
ValidateBasic runs stateless checks on the message
func (*MsgCreateSession) XXX_DiscardUnknown ¶ added in v0.15.0
func (m *MsgCreateSession) XXX_DiscardUnknown()
func (*MsgCreateSession) XXX_Marshal ¶ added in v0.15.0
func (m *MsgCreateSession) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgCreateSession) XXX_Merge ¶ added in v0.15.0
func (m *MsgCreateSession) XXX_Merge(src proto.Message)
func (*MsgCreateSession) XXX_Size ¶ added in v0.15.0
func (m *MsgCreateSession) XXX_Size() int
func (*MsgCreateSession) XXX_Unmarshal ¶ added in v0.15.0
func (m *MsgCreateSession) XXX_Unmarshal(b []byte) error
type MsgCreateSessionResponse ¶ added in v0.15.0
type MsgCreateSessionResponse struct { }
MsgCreateSessionResponse defines the Msg/CreateSession response type.
func (*MsgCreateSessionResponse) Descriptor ¶ added in v0.15.0
func (*MsgCreateSessionResponse) Descriptor() ([]byte, []int)
func (*MsgCreateSessionResponse) Marshal ¶ added in v0.15.0
func (m *MsgCreateSessionResponse) Marshal() (dAtA []byte, err error)
func (*MsgCreateSessionResponse) MarshalTo ¶ added in v0.15.0
func (m *MsgCreateSessionResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgCreateSessionResponse) MarshalToSizedBuffer ¶ added in v0.15.0
func (m *MsgCreateSessionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgCreateSessionResponse) ProtoMessage ¶ added in v0.15.0
func (*MsgCreateSessionResponse) ProtoMessage()
func (*MsgCreateSessionResponse) Reset ¶ added in v0.15.0
func (m *MsgCreateSessionResponse) Reset()
func (*MsgCreateSessionResponse) Size ¶ added in v0.15.0
func (m *MsgCreateSessionResponse) Size() (n int)
func (*MsgCreateSessionResponse) String ¶ added in v0.15.0
func (m *MsgCreateSessionResponse) String() string
func (*MsgCreateSessionResponse) Unmarshal ¶ added in v0.15.0
func (m *MsgCreateSessionResponse) Unmarshal(dAtA []byte) error
func (*MsgCreateSessionResponse) XXX_DiscardUnknown ¶ added in v0.15.0
func (m *MsgCreateSessionResponse) XXX_DiscardUnknown()
func (*MsgCreateSessionResponse) XXX_Marshal ¶ added in v0.15.0
func (m *MsgCreateSessionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgCreateSessionResponse) XXX_Merge ¶ added in v0.15.0
func (m *MsgCreateSessionResponse) XXX_Merge(src proto.Message)
func (*MsgCreateSessionResponse) XXX_Size ¶ added in v0.15.0
func (m *MsgCreateSessionResponse) XXX_Size() int
func (*MsgCreateSessionResponse) XXX_Unmarshal ¶ added in v0.15.0
func (m *MsgCreateSessionResponse) XXX_Unmarshal(b []byte) error
type MsgServer ¶ added in v0.15.0
type MsgServer interface { // CreateSession defines a method for creating a new session CreateSession(context.Context, *MsgCreateSession) (*MsgCreateSessionResponse, error) }
MsgServer is the server API for Msg service.
type QueryClient ¶ added in v0.15.0
type QueryClient interface { // Sessions queries the sessions having a specific ID. Session(ctx context.Context, in *QuerySessionRequest, opts ...grpc.CallOption) (*QuerySessionResponse, 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 ¶ added in v0.15.0
func NewQueryClient(cc grpc1.ClientConn) QueryClient
type QueryServer ¶ added in v0.15.0
type QueryServer interface { // Sessions queries the sessions having a specific ID. Session(context.Context, *QuerySessionRequest) (*QuerySessionResponse, error) }
QueryServer is the server API for Query service.
type QuerySessionRequest ¶ added in v0.15.0
type QuerySessionRequest struct { // id is the session it to query for Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` }
QuerySessionRequest is the request type for the Query/Session RPC method.
func (*QuerySessionRequest) Descriptor ¶ added in v0.15.0
func (*QuerySessionRequest) Descriptor() ([]byte, []int)
func (*QuerySessionRequest) Marshal ¶ added in v0.15.0
func (m *QuerySessionRequest) Marshal() (dAtA []byte, err error)
func (*QuerySessionRequest) MarshalTo ¶ added in v0.15.0
func (m *QuerySessionRequest) MarshalTo(dAtA []byte) (int, error)
func (*QuerySessionRequest) MarshalToSizedBuffer ¶ added in v0.15.0
func (m *QuerySessionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QuerySessionRequest) ProtoMessage ¶ added in v0.15.0
func (*QuerySessionRequest) ProtoMessage()
func (*QuerySessionRequest) Reset ¶ added in v0.15.0
func (m *QuerySessionRequest) Reset()
func (*QuerySessionRequest) Size ¶ added in v0.15.0
func (m *QuerySessionRequest) Size() (n int)
func (*QuerySessionRequest) String ¶ added in v0.15.0
func (m *QuerySessionRequest) String() string
func (*QuerySessionRequest) Unmarshal ¶ added in v0.15.0
func (m *QuerySessionRequest) Unmarshal(dAtA []byte) error
func (*QuerySessionRequest) XXX_DiscardUnknown ¶ added in v0.15.0
func (m *QuerySessionRequest) XXX_DiscardUnknown()
func (*QuerySessionRequest) XXX_Marshal ¶ added in v0.15.0
func (m *QuerySessionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QuerySessionRequest) XXX_Merge ¶ added in v0.15.0
func (m *QuerySessionRequest) XXX_Merge(src proto.Message)
func (*QuerySessionRequest) XXX_Size ¶ added in v0.15.0
func (m *QuerySessionRequest) XXX_Size() int
func (*QuerySessionRequest) XXX_Unmarshal ¶ added in v0.15.0
func (m *QuerySessionRequest) XXX_Unmarshal(b []byte) error
type QuerySessionResponse ¶ added in v0.15.0
type QuerySessionResponse struct { // balance is the balance of the coin. Session *Session `protobuf:"bytes,1,opt,name=session,proto3" json:"session,omitempty"` }
QuerySessionResponse is the response type for the Query/Session RPC method.
func (*QuerySessionResponse) Descriptor ¶ added in v0.15.0
func (*QuerySessionResponse) Descriptor() ([]byte, []int)
func (*QuerySessionResponse) GetSession ¶ added in v0.15.0
func (m *QuerySessionResponse) GetSession() *Session
func (*QuerySessionResponse) Marshal ¶ added in v0.15.0
func (m *QuerySessionResponse) Marshal() (dAtA []byte, err error)
func (*QuerySessionResponse) MarshalTo ¶ added in v0.15.0
func (m *QuerySessionResponse) MarshalTo(dAtA []byte) (int, error)
func (*QuerySessionResponse) MarshalToSizedBuffer ¶ added in v0.15.0
func (m *QuerySessionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QuerySessionResponse) ProtoMessage ¶ added in v0.15.0
func (*QuerySessionResponse) ProtoMessage()
func (*QuerySessionResponse) Reset ¶ added in v0.15.0
func (m *QuerySessionResponse) Reset()
func (*QuerySessionResponse) Size ¶ added in v0.15.0
func (m *QuerySessionResponse) Size() (n int)
func (*QuerySessionResponse) String ¶ added in v0.15.0
func (m *QuerySessionResponse) String() string
func (*QuerySessionResponse) Unmarshal ¶ added in v0.15.0
func (m *QuerySessionResponse) Unmarshal(dAtA []byte) error
func (*QuerySessionResponse) XXX_DiscardUnknown ¶ added in v0.15.0
func (m *QuerySessionResponse) XXX_DiscardUnknown()
func (*QuerySessionResponse) XXX_Marshal ¶ added in v0.15.0
func (m *QuerySessionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QuerySessionResponse) XXX_Merge ¶ added in v0.15.0
func (m *QuerySessionResponse) XXX_Merge(src proto.Message)
func (*QuerySessionResponse) XXX_Size ¶ added in v0.15.0
func (m *QuerySessionResponse) XXX_Size() int
func (*QuerySessionResponse) XXX_Unmarshal ¶ added in v0.15.0
func (m *QuerySessionResponse) XXX_Unmarshal(b []byte) error
type Session ¶
type Session struct { SessionId SessionID `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id" yaml:"session_id"` Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` CreationTime uint64 `protobuf:"varint,3,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty" yaml:"creation_time"` ExpirationTime uint64 `` /* 127-byte string literal not displayed */ Namespace string `protobuf:"bytes,5,opt,name=namespace,proto3" json:"namespace,omitempty" yaml:"namespace"` ExternalOwner string `protobuf:"bytes,6,opt,name=external_owner,json=externalOwner,proto3" json:"external_owner,omitempty" yaml:"external_owner"` PublicKey string `protobuf:"bytes,7,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty" yaml:"pub_key"` Signature string `protobuf:"bytes,8,opt,name=signature,proto3" json:"signature,omitempty" yaml:"signature"` }
Session represents an inter-chain session used to authenticate a user from another Cosmos chain
func NewSession ¶
func NewSession( id SessionID, owner string, created, expiry uint64, namespace, externalOwner, pubKey, signature string, ) Session
NewSession return a new session containing the given parameters
func (*Session) Descriptor ¶ added in v0.15.0
func (*Session) GetCreationTime ¶ added in v0.15.0
func (*Session) GetExpirationTime ¶ added in v0.15.0
func (*Session) GetExternalOwner ¶ added in v0.15.0
func (*Session) GetNamespace ¶ added in v0.15.0
func (*Session) GetPublicKey ¶ added in v0.15.0
func (*Session) GetSessionId ¶ added in v0.15.0
func (*Session) GetSignature ¶ added in v0.15.0
func (*Session) MarshalToSizedBuffer ¶ added in v0.15.0
func (*Session) ProtoMessage ¶ added in v0.15.0
func (*Session) ProtoMessage()
func (*Session) XXX_DiscardUnknown ¶ added in v0.15.0
func (m *Session) XXX_DiscardUnknown()
func (*Session) XXX_Marshal ¶ added in v0.15.0
func (*Session) XXX_Unmarshal ¶ added in v0.15.0
type SessionID ¶
type SessionID struct {
Value uint64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
}
SessionID represents a unique session id
func NewSessionID ¶ added in v0.15.0
NewSessionID returns a new SessionID value containing the given value
func ParseSessionID ¶
ParseSessionID take the given string value and parses it returning a SessionID. If the given value is not valid, returns an error instead
func (*SessionID) Descriptor ¶ added in v0.15.0
func (*SessionID) MarshalToSizedBuffer ¶ added in v0.15.0
func (*SessionID) ProtoMessage ¶ added in v0.15.0
func (*SessionID) ProtoMessage()
func (SessionID) Valid ¶
Valid returns true if and only if this id can be considered valid to be stored on the chain
func (*SessionID) XXX_DiscardUnknown ¶ added in v0.15.0
func (m *SessionID) XXX_DiscardUnknown()
func (*SessionID) XXX_Marshal ¶ added in v0.15.0
func (*SessionID) XXX_Unmarshal ¶ added in v0.15.0
type UnimplementedMsgServer ¶ added in v0.15.0
type UnimplementedMsgServer struct { }
UnimplementedMsgServer can be embedded to have forward compatible implementations.
func (*UnimplementedMsgServer) CreateSession ¶ added in v0.15.0
func (*UnimplementedMsgServer) CreateSession(ctx context.Context, req *MsgCreateSession) (*MsgCreateSessionResponse, error)
type UnimplementedQueryServer ¶ added in v0.15.0
type UnimplementedQueryServer struct { }
UnimplementedQueryServer can be embedded to have forward compatible implementations.
func (*UnimplementedQueryServer) Session ¶ added in v0.15.0
func (*UnimplementedQueryServer) Session(ctx context.Context, req *QuerySessionRequest) (*QuerySessionResponse, error)