common

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WritePacket

func WritePacket(conn net.Conn, packetType PacketType, namespace string, payload []byte) error

Types

type Config

type Config struct {
	Host        string
	Port        int
	Namespace   string
	ChannelSize int
}

type PacketType

type PacketType byte
const (
	DISCONNECT PacketType = iota
	PRODUCER_MESSAGE
	CONSUMER_MESSAGE
	SERVER_ERROR
	SERVER_MESSAGE
)

func ReadPacket

func ReadPacket(conn net.Conn) (packetType PacketType, namespace string, payload []byte, err error)

type Task

type Task struct {
	TaskId             string      `json:"task_id"`
	RequestId          string      `json:"request_id"`
	Namespace          string      `json:"namespace"`
	Status             TaskStatus  `json:"task_status"`
	Prompt             []byte      `json:"prompt"`
	Response           interface{} `json:"response"`
	CreatedTimestamp   int64       `json:"created_timestamp"`
	CompletedTimestamp int64       `json:"completed_timestamp"`
}

type TaskStatus

type TaskStatus byte
const (
	CREATED TaskStatus = iota
	CONSUMED
	COMPLETED
	CONSTRAINT_VIOLATION
	ERROR
)

Jump to

Keyboard shortcuts

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