proto

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: AGPL-3.0 Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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 GenericResponse struct {
	OK      bool
	Message string
}

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 MathResponse struct {
	Valid        bool
	ErrorMessage string
	Result       float64
}

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

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 {
}

Jump to

Keyboard shortcuts

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