runner

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
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 (*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 ResultRequest_Outputs struct {
	Outputs *types.Struct `protobuf:"bytes,2,opt,name=outputs,proto3,oneof" json:"outputs,omitempty"`
}

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, logger tmlog.Logger) *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) Execution

func (*UnimplementedRunnerServer) Result

Jump to

Keyboard shortcuts

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