Documentation ¶
Index ¶
- Constants
- func RegisterRunnerServer(s *grpc.Server, srv RunnerServer)
- type EventRequest
- func (*EventRequest) Descriptor() ([]byte, []int)
- func (m *EventRequest) GetData() *types.Struct
- func (m *EventRequest) GetKey() string
- func (*EventRequest) ProtoMessage()
- func (m *EventRequest) Reset()
- func (m *EventRequest) String() string
- func (m *EventRequest) XXX_DiscardUnknown()
- func (m *EventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EventRequest) XXX_Merge(src proto.Message)
- func (m *EventRequest) XXX_Size() int
- func (m *EventRequest) XXX_Unmarshal(b []byte) error
- type EventResponse
- func (*EventResponse) Descriptor() ([]byte, []int)
- func (*EventResponse) ProtoMessage()
- func (m *EventResponse) Reset()
- func (m *EventResponse) String() string
- func (m *EventResponse) XXX_DiscardUnknown()
- func (m *EventResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EventResponse) XXX_Merge(src proto.Message)
- func (m *EventResponse) XXX_Size() int
- func (m *EventResponse) XXX_Unmarshal(b []byte) error
- type ExecutionRequest
- func (*ExecutionRequest) Descriptor() ([]byte, []int)
- func (*ExecutionRequest) ProtoMessage()
- func (m *ExecutionRequest) Reset()
- func (m *ExecutionRequest) String() string
- func (m *ExecutionRequest) XXX_DiscardUnknown()
- func (m *ExecutionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ExecutionRequest) XXX_Merge(src proto.Message)
- func (m *ExecutionRequest) XXX_Size() int
- func (m *ExecutionRequest) XXX_Unmarshal(b []byte) error
- type ResultRequest
- func (*ResultRequest) Descriptor() ([]byte, []int)
- func (m *ResultRequest) GetError() string
- func (m *ResultRequest) GetExecutionHash() github_com_mesg_foundation_engine_hash.Hash
- func (m *ResultRequest) GetOutputs() *types.Struct
- func (m *ResultRequest) GetResult() isResultRequest_Result
- func (*ResultRequest) ProtoMessage()
- func (m *ResultRequest) Reset()
- func (m *ResultRequest) String() string
- func (m *ResultRequest) XXX_DiscardUnknown()
- func (m *ResultRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ResultRequest) XXX_Merge(src proto.Message)
- func (*ResultRequest) XXX_OneofWrappers() []interface{}
- func (m *ResultRequest) XXX_Size() int
- func (m *ResultRequest) XXX_Unmarshal(b []byte) error
- type ResultRequest_Error
- type ResultRequest_Outputs
- type ResultResponse
- func (*ResultResponse) Descriptor() ([]byte, []int)
- func (*ResultResponse) ProtoMessage()
- func (m *ResultResponse) Reset()
- func (m *ResultResponse) String() string
- func (m *ResultResponse) XXX_DiscardUnknown()
- func (m *ResultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ResultResponse) XXX_Merge(src proto.Message)
- func (m *ResultResponse) XXX_Size() int
- func (m *ResultResponse) XXX_Unmarshal(b []byte) error
- type RunnerClient
- type RunnerServer
- type Runner_ExecutionClient
- type Runner_ExecutionServer
- type Server
- type UnimplementedRunnerServer
- func (*UnimplementedRunnerServer) Event(ctx context.Context, req *EventRequest) (*EventResponse, error)
- func (*UnimplementedRunnerServer) Execution(req *ExecutionRequest, srv Runner_ExecutionServer) error
- func (*UnimplementedRunnerServer) Result(ctx context.Context, req *ResultRequest) (*ResultResponse, error)
Constants ¶
const CredentialToken = "mesg_credential_token"
CredentialToken is the name to use in the gRPC metadata to set and read the credential token.
Variables ¶
This section is empty.
Functions ¶
func RegisterRunnerServer ¶
func RegisterRunnerServer(s *grpc.Server, srv RunnerServer)
Types ¶
type EventRequest ¶
type EventRequest struct { // Event's key Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty" validate:"required,printascii"` // Event's data Data *types.Struct `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
EventRequest is the request of the endpoint Event.
func (*EventRequest) Descriptor ¶
func (*EventRequest) Descriptor() ([]byte, []int)
func (*EventRequest) GetData ¶
func (m *EventRequest) GetData() *types.Struct
func (*EventRequest) GetKey ¶
func (m *EventRequest) GetKey() string
func (*EventRequest) ProtoMessage ¶
func (*EventRequest) ProtoMessage()
func (*EventRequest) Reset ¶
func (m *EventRequest) Reset()
func (*EventRequest) String ¶
func (m *EventRequest) String() string
func (*EventRequest) XXX_DiscardUnknown ¶
func (m *EventRequest) XXX_DiscardUnknown()
func (*EventRequest) XXX_Marshal ¶
func (m *EventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EventRequest) XXX_Merge ¶
func (m *EventRequest) XXX_Merge(src proto.Message)
func (*EventRequest) XXX_Size ¶
func (m *EventRequest) XXX_Size() int
func (*EventRequest) XXX_Unmarshal ¶
func (m *EventRequest) XXX_Unmarshal(b []byte) error
type EventResponse ¶
type EventResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
EventResponse is the response of the endpoint Event.
func (*EventResponse) Descriptor ¶
func (*EventResponse) Descriptor() ([]byte, []int)
func (*EventResponse) ProtoMessage ¶
func (*EventResponse) ProtoMessage()
func (*EventResponse) Reset ¶
func (m *EventResponse) Reset()
func (*EventResponse) String ¶
func (m *EventResponse) String() string
func (*EventResponse) XXX_DiscardUnknown ¶
func (m *EventResponse) XXX_DiscardUnknown()
func (*EventResponse) XXX_Marshal ¶
func (m *EventResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EventResponse) XXX_Merge ¶
func (m *EventResponse) XXX_Merge(src proto.Message)
func (*EventResponse) XXX_Size ¶
func (m *EventResponse) XXX_Size() int
func (*EventResponse) XXX_Unmarshal ¶
func (m *EventResponse) XXX_Unmarshal(b []byte) error
type ExecutionRequest ¶
type ExecutionRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
ExecutionRequest is the request of the endpoint Execution.
func (*ExecutionRequest) Descriptor ¶
func (*ExecutionRequest) Descriptor() ([]byte, []int)
func (*ExecutionRequest) ProtoMessage ¶
func (*ExecutionRequest) ProtoMessage()
func (*ExecutionRequest) Reset ¶
func (m *ExecutionRequest) Reset()
func (*ExecutionRequest) String ¶
func (m *ExecutionRequest) String() string
func (*ExecutionRequest) XXX_DiscardUnknown ¶
func (m *ExecutionRequest) XXX_DiscardUnknown()
func (*ExecutionRequest) XXX_Marshal ¶
func (m *ExecutionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ExecutionRequest) XXX_Merge ¶
func (m *ExecutionRequest) XXX_Merge(src proto.Message)
func (*ExecutionRequest) XXX_Size ¶
func (m *ExecutionRequest) XXX_Size() int
func (*ExecutionRequest) XXX_Unmarshal ¶
func (m *ExecutionRequest) XXX_Unmarshal(b []byte) error
type ResultRequest ¶
type ResultRequest struct { // Execution's hash of the executed execution. ExecutionHash github_com_mesg_foundation_engine_hash.Hash `` /* 157-byte string literal not displayed */ // Execution's result. // // Types that are valid to be assigned to Result: // *ResultRequest_Outputs // *ResultRequest_Error Result isResultRequest_Result `protobuf_oneof:"result"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
EventRequest is the request of the endpoint Result.
func (*ResultRequest) Descriptor ¶
func (*ResultRequest) Descriptor() ([]byte, []int)
func (*ResultRequest) GetError ¶
func (m *ResultRequest) GetError() string
func (*ResultRequest) GetExecutionHash ¶
func (m *ResultRequest) GetExecutionHash() github_com_mesg_foundation_engine_hash.Hash
func (*ResultRequest) GetOutputs ¶
func (m *ResultRequest) GetOutputs() *types.Struct
func (*ResultRequest) GetResult ¶
func (m *ResultRequest) GetResult() isResultRequest_Result
func (*ResultRequest) ProtoMessage ¶
func (*ResultRequest) ProtoMessage()
func (*ResultRequest) Reset ¶
func (m *ResultRequest) Reset()
func (*ResultRequest) String ¶
func (m *ResultRequest) String() string
func (*ResultRequest) XXX_DiscardUnknown ¶
func (m *ResultRequest) XXX_DiscardUnknown()
func (*ResultRequest) XXX_Marshal ¶
func (m *ResultRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ResultRequest) XXX_Merge ¶
func (m *ResultRequest) XXX_Merge(src proto.Message)
func (*ResultRequest) XXX_OneofWrappers ¶
func (*ResultRequest) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*ResultRequest) XXX_Size ¶
func (m *ResultRequest) XXX_Size() int
func (*ResultRequest) XXX_Unmarshal ¶
func (m *ResultRequest) XXX_Unmarshal(b []byte) error
type ResultRequest_Error ¶
type ResultRequest_Error struct {
Error string `protobuf:"bytes,3,opt,name=error,proto3,oneof" json:"error,omitempty"`
}
type ResultRequest_Outputs ¶
type ResultResponse ¶
type ResultResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
ResultResponse is the response of the endpoint Result.
func (*ResultResponse) Descriptor ¶
func (*ResultResponse) Descriptor() ([]byte, []int)
func (*ResultResponse) ProtoMessage ¶
func (*ResultResponse) ProtoMessage()
func (*ResultResponse) Reset ¶
func (m *ResultResponse) Reset()
func (*ResultResponse) String ¶
func (m *ResultResponse) String() string
func (*ResultResponse) XXX_DiscardUnknown ¶
func (m *ResultResponse) XXX_DiscardUnknown()
func (*ResultResponse) XXX_Marshal ¶
func (m *ResultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ResultResponse) XXX_Merge ¶
func (m *ResultResponse) XXX_Merge(src proto.Message)
func (*ResultResponse) XXX_Size ¶
func (m *ResultResponse) XXX_Size() int
func (*ResultResponse) XXX_Unmarshal ¶
func (m *ResultResponse) XXX_Unmarshal(b []byte) error
type RunnerClient ¶
type RunnerClient interface { // Execution returns a stream of executions that contains the Execution the Runner must execute. // This request requires the credential token, obtained from the Register endpoint, to be injected in the request's metadata using the key "mesg_credential_token". Execution(ctx context.Context, in *ExecutionRequest, opts ...grpc.CallOption) (Runner_ExecutionClient, error) // Result should be used to return the result of an Execution. // This request requires the credential token, obtained from the Register endpoint, to be injected in the request's metadata using the key "mesg_credential_token". Result(ctx context.Context, in *ResultRequest, opts ...grpc.CallOption) (*ResultResponse, error) // Event should be used to emits an event. // This request requires the credential token, obtained from the Register endpoint, to be injected in the request's metadata using the key "mesg_credential_token". Event(ctx context.Context, in *EventRequest, opts ...grpc.CallOption) (*EventResponse, error) }
RunnerClient is the client API for Runner service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewRunnerClient ¶
func NewRunnerClient(cc *grpc.ClientConn) RunnerClient
type RunnerServer ¶
type RunnerServer interface { // Execution returns a stream of executions that contains the Execution the Runner must execute. // This request requires the credential token, obtained from the Register endpoint, to be injected in the request's metadata using the key "mesg_credential_token". Execution(*ExecutionRequest, Runner_ExecutionServer) error // Result should be used to return the result of an Execution. // This request requires the credential token, obtained from the Register endpoint, to be injected in the request's metadata using the key "mesg_credential_token". Result(context.Context, *ResultRequest) (*ResultResponse, error) // Event should be used to emits an event. // This request requires the credential token, obtained from the Register endpoint, to be injected in the request's metadata using the key "mesg_credential_token". Event(context.Context, *EventRequest) (*EventResponse, error) }
RunnerServer is the server API for Runner service.
type Runner_ExecutionClient ¶
type Runner_ExecutionClient interface { Recv() (*execution.Execution, error) grpc.ClientStream }
type Runner_ExecutionServer ¶
type Runner_ExecutionServer interface { Send(*execution.Execution) error grpc.ServerStream }
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the type to aggregate all Runner APIs.
func NewServer ¶
func NewServer(rpc *cosmos.RPC, eventPublisher *publisher.EventPublisher, tokenToRunnerHash *sync.Map) *Server
NewServer creates a new Server.
func (*Server) Event ¶
func (s *Server) Event(ctx context.Context, req *EventRequest) (*EventResponse, error)
Event emits an event.
func (*Server) Execution ¶
func (s *Server) Execution(req *ExecutionRequest, stream Runner_ExecutionServer) error
Execution returns a stream of Execution for a specific Runner.
func (*Server) Result ¶
func (s *Server) Result(ctx context.Context, req *ResultRequest) (*ResultResponse, error)
Result emits the result of an Execution.
type UnimplementedRunnerServer ¶
type UnimplementedRunnerServer struct { }
UnimplementedRunnerServer can be embedded to have forward compatible implementations.
func (*UnimplementedRunnerServer) Event ¶
func (*UnimplementedRunnerServer) Event(ctx context.Context, req *EventRequest) (*EventResponse, error)
func (*UnimplementedRunnerServer) Execution ¶
func (*UnimplementedRunnerServer) Execution(req *ExecutionRequest, srv Runner_ExecutionServer) error
func (*UnimplementedRunnerServer) Result ¶
func (*UnimplementedRunnerServer) Result(ctx context.Context, req *ResultRequest) (*ResultResponse, error)