Documentation
¶
Index ¶
- func ContractFor() (factory arctic.ContractFactory[Contract])
- func StreamingContractFor() (factory arctic.ContractFactory[StreamingContract])
- type Contract
- func (contract Contract) AddInboundMiddleware(middleware arctic.ContractMiddleware)
- func (contract Contract) AddOutboundMiddleware(middleware arctic.ContractMiddleware)
- func (contract Contract) DataStreaming(ctx *DataStreamingContext, request DataStreamingRequest) (response GenericResponse, err error)
- func (contract Contract) Done(ctx context.Context, request struct{}) (response GenericResponse, err error)
- func (contract Contract) Join(ctx context.Context, request InitialRequest) (response GenericResponse, err error)
- func (contract Contract) Math(ctx context.Context, request MathRequest) (response MathResponse, err error)
- func (contract Contract) NewDataStreamingContext(parent context.Context) (streamContext *DataStreamingContext)
- func (contract Contract) OnDataStreaming(handler func(*DataStreamingContext, DataStreamingRequest) GenericResponse)
- func (contract Contract) OnDone(handler func(*arctic.ContractContext, struct{}) GenericResponse)
- func (contract Contract) OnJoin(handler func(*arctic.ContractContext, InitialRequest) GenericResponse)
- func (contract Contract) OnMath(handler func(*arctic.ContractContext, MathRequest) MathResponse)
- type ContractDefinition
- type ContractMessageType
- type ContractOptions
- type DataStreamingBody
- type DataStreamingContext
- type DataStreamingRequest
- type GenericResponse
- type InitialRequest
- type MathOperand
- type MathRequest
- type MathResponse
- type StreamingContract
- func (contract StreamingContract) AddInboundMiddleware(middleware arctic.ContractMiddleware)
- func (contract StreamingContract) AddOutboundMiddleware(middleware arctic.ContractMiddleware)
- func (contract StreamingContract) Data(ctx context.Context, request DataStreamingBody) (response DataStreamingBody, err error)
- func (contract StreamingContract) OnData(handler func(*arctic.ContractContext, DataStreamingBody) DataStreamingBody)
- type StreamingContractDefinition
- type StreamingContractOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContractFor ¶
func ContractFor() (factory arctic.ContractFactory[Contract])
func StreamingContractFor ¶ added in v0.0.7
func StreamingContractFor() (factory arctic.ContractFactory[StreamingContract])
Types ¶
type Contract ¶
type Contract struct {
// contains filtered or unexported fields
}
func (Contract) AddInboundMiddleware ¶ added in v0.0.8
func (contract Contract) AddInboundMiddleware(middleware arctic.ContractMiddleware)
func (Contract) AddOutboundMiddleware ¶ added in v0.0.8
func (contract Contract) AddOutboundMiddleware(middleware arctic.ContractMiddleware)
func (Contract) DataStreaming ¶ added in v0.0.7
func (contract Contract) DataStreaming(ctx *DataStreamingContext, request DataStreamingRequest) (response GenericResponse, err error)
func (Contract) Done ¶ added in v0.0.6
func (contract Contract) Done(ctx context.Context, request struct{}) (response GenericResponse, err error)
func (Contract) Join ¶
func (contract Contract) Join(ctx context.Context, request InitialRequest) (response GenericResponse, err error)
func (Contract) Math ¶
func (contract Contract) Math(ctx context.Context, request MathRequest) (response MathResponse, err error)
func (Contract) NewDataStreamingContext ¶ added in v0.0.7
func (contract Contract) NewDataStreamingContext(parent context.Context) (streamContext *DataStreamingContext)
func (Contract) OnDataStreaming ¶ added in v0.0.7
func (contract Contract) OnDataStreaming(handler func(*DataStreamingContext, DataStreamingRequest) GenericResponse)
func (Contract) OnDone ¶ added in v0.0.6
func (contract Contract) OnDone(handler func(*arctic.ContractContext, struct{}) GenericResponse)
func (Contract) OnJoin ¶
func (contract Contract) OnJoin(handler func(*arctic.ContractContext, InitialRequest) GenericResponse)
func (Contract) OnMath ¶
func (contract Contract) OnMath(handler func(*arctic.ContractContext, MathRequest) MathResponse)
type ContractDefinition ¶
type ContractDefinition interface {
Join(InitialRequest) GenericResponse
Math(MathRequest) MathResponse
Done(struct{}) GenericResponse
DataStreaming(DataStreamingRequest) GenericResponse
// contains filtered or unexported methods
}
type ContractMessageType ¶ added in v0.0.8
type ContractMessageType = arctic.ContractMessageType
const ( ContractMessageStreamingContractData ContractMessageType = iota ContractMessageContractJoin ContractMessageContractMath ContractMessageContractDone ContractMessageContractDataStreaming )
type ContractOptions ¶
type ContractOptions struct {
Join struct{} `arctic:"direction=client-server,one-at-once"`
DataStreaming StreamingContractDefinition `arctic:"streaming"`
}
type DataStreamingBody ¶ added in v0.0.7
type DataStreamingBody struct {
Chunk []byte
}
type DataStreamingContext ¶ added in v0.0.7
type DataStreamingContext struct {
*arctic.ContractContext
Stream StreamingContract
}
type DataStreamingRequest ¶ added in v0.0.7
type DataStreamingRequest struct {
NumExpectedChunks int
}
type GenericResponse ¶
type InitialRequest ¶
type InitialRequest struct {
Message string
}
type MathOperand ¶
type MathOperand uint8
const ( MathOperandAddition MathOperand = iota MathOperandSubtraction MathOperandMultiplication MathOperandDivision )
type MathRequest ¶
type MathRequest struct {
FirstOperator, SecondOperator float64
Operand MathOperand
}
type MathResponse ¶
type StreamingContract ¶ added in v0.0.7
type StreamingContract struct {
// contains filtered or unexported fields
}
func (StreamingContract) AddInboundMiddleware ¶ added in v0.0.8
func (contract StreamingContract) AddInboundMiddleware(middleware arctic.ContractMiddleware)
func (StreamingContract) AddOutboundMiddleware ¶ added in v0.0.8
func (contract StreamingContract) AddOutboundMiddleware(middleware arctic.ContractMiddleware)
func (StreamingContract) Data ¶ added in v0.0.7
func (contract StreamingContract) Data(ctx context.Context, request DataStreamingBody) (response DataStreamingBody, err error)
func (StreamingContract) OnData ¶ added in v0.0.7
func (contract StreamingContract) OnData(handler func(*arctic.ContractContext, DataStreamingBody) DataStreamingBody)
type StreamingContractDefinition ¶ added in v0.0.7
type StreamingContractDefinition interface {
Data(DataStreamingBody) DataStreamingBody
// contains filtered or unexported methods
}
type StreamingContractOptions ¶ added in v0.0.7
type StreamingContractOptions struct {
}
Click to show internal directories.
Click to hide internal directories.