Documentation ¶
Overview ¶
Package atp provides a client and server implementation of the Arcaflow Transport Protocol, which transports schema information and calls plugins.
Index ¶
Constants ¶
const ( MessageTypeWorkStart uint32 = 1 MessageTypeWorkDone uint32 = 2 MessageTypeSignal uint32 = 3 MessageTypeClientDone uint32 = 4 MessageTypeError uint32 = 5 )
All messages that can be contained in a RuntimeMessage struct.
const ProtocolVersion int64 = 3
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // ReadSchema reads the schema from the ATP server. ReadSchema() (*schema.SchemaSchema, error) // Execute executes a step with a given context and returns the resulting output. Assumes you called ReadSchema first. Execute(input schema.Input, receivedSignals chan schema.Input, emittedSignals chan<- schema.Input) ExecutionResult Close() error Encoder() *cbor.Encoder Decoder() *cbor.Decoder }
Client is the way to read information from the ATP server and then send a task to it in the form of a step. A step can only be sent once, but signals can be sent until the step is over. It is a single session.
func NewClient ¶
func NewClient( channel ClientChannel, ) Client
NewClient creates a new ATP client (part of the engine code).
func NewClientWithLogger ¶
func NewClientWithLogger( channel ClientChannel, logger log.Logger, ) Client
NewClientWithLogger creates a new ATP client (part of the engine code) with a logger.
type ClientChannel ¶
ClientChannel holds the methods to talking to an ATP server (plugin).
type DecodedRuntimeMessage ¶ added in v0.4.1
type ErrorMessage ¶ added in v0.5.0
type ErrorMessage struct { Error string `cbor:"error"` StepFatal bool `cbor:"step_fatal"` ServerFatal bool `cbor:"server_fatal"` }
func (ErrorMessage) ToString ¶ added in v0.5.0
func (e ErrorMessage) ToString(runID string) string
type ExecutionResult ¶ added in v0.5.0
func NewErrorExecutionResult ¶ added in v0.5.0
func NewErrorExecutionResult(err error) ExecutionResult
type HelloMessage ¶ added in v0.2.0
type RuntimeMessage ¶ added in v0.4.1
type ServerError ¶ added in v0.5.0
func RunATPServer ¶
func RunATPServer( ctx context.Context, stdin io.ReadCloser, stdout io.WriteCloser, pluginSchema *schema.CallableSchema, ) []*ServerError
RunATPServer runs an ArcaflowTransportProtocol server with a given schema.
func (ServerError) String ¶ added in v0.5.0
func (e ServerError) String() string