models

package
v0.0.0-...-ef5cc6b Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: MIT Imports: 8 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register()

Types

type Agent

type Agent struct {
	ID           string        `json:"id"`
	ParentID     *string       `json:"parent_id,omitempty"`
	ContainerID  *string       `json:"container_id,omitempty"`
	Name         string        `json:"name"`
	Description  string        `json:"description"`
	Status       AgentStatus   `json:"status"`
	Instructions *string       `json:"instructions,omitempty"`
	Address      *string       `json:"address,omitempty"`
	ClientID     string        `json:"-"`
	ClientSecret Secret        `json:"-"`
	Settings     AgentSettings `json:"settings"`
	Position     Position      `json:"position,omitempty"`
	CreatedAt    time.Time     `json:"created_at"`
	UpdatedAt    time.Time     `json:"updated_at"`
}

func NewAgent

func NewAgent() Agent

func (Agent) String

func (self Agent) String() string

type AgentLog

type AgentLog struct {
	ID        string    `json:"id"`
	AgentID   string    `json:"agent_id"`
	Level     LogLevel  `json:"level"`
	Text      string    `json:"text"`
	Data      Map[any]  `json:"data"`
	CreatedAt time.Time `json:"created_at"`
}

func NewAgentLog

func NewAgentLog() AgentLog

func (AgentLog) String

func (self AgentLog) String() string

type AgentSettings

func (*AgentSettings) Scan

func (self *AgentSettings) Scan(value any) error

func (AgentSettings) String

func (self AgentSettings) String() string

func (AgentSettings) Value

func (self AgentSettings) Value() (driver.Value, error)

type AgentStat

type AgentStat struct {
	ID          string    `json:"id"`
	SocketID    string    `json:"socket_id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	StartedAt   time.Time `json:"started_at"`
}

func (AgentStat) String

func (self AgentStat) String() string

type AgentStatus

type AgentStatus string
const (
	AGENT_STATUS_UP   AgentStatus = "up"
	AGENT_STATUS_DOWN AgentStatus = "down"
)

func (AgentStatus) Valid

func (self AgentStatus) Valid() bool

type Chat

type Chat struct {
	ID        string    `json:"id"`
	AgentID   string    `json:"agent_id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

func NewChat

func NewChat() Chat

func (Chat) String

func (self Chat) String() string

type LogLevel

type LogLevel string
const (
	LOG_LEVEL_INFO  LogLevel = "info"
	LOG_LEVEL_WARN  LogLevel = "warn"
	LOG_LEVEL_ERROR LogLevel = "error"
	LOG_LEVEL_DEBUG LogLevel = "debug"
)

func (LogLevel) Valid

func (self LogLevel) Valid() bool

type Map

type Map[T any] map[string]T

func (*Map[T]) Scan

func (self *Map[T]) Scan(value any) error

func (Map[T]) String

func (self Map[T]) String() string

func (Map[T]) Value

func (self Map[T]) Value() (driver.Value, error)

type Message

type Message struct {
	ID        string    `json:"id"`
	ChatID    string    `json:"chat_id"`
	FromID    string    `json:"from_id"`
	Text      string    `json:"text"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

func NewMessage

func NewMessage() Message

func (Message) String

func (self Message) String() string

type Position

type Position struct {
	X float64 `json:"x"`
	Y float64 `json:"y"`
}

func (*Position) Scan

func (self *Position) Scan(value any) error

func (Position) String

func (self Position) String() string

func (Position) Value

func (self Position) Value() (driver.Value, error)

type Secret

type Secret string

func (Secret) Equals

func (self Secret) Equals(s string) bool

func (*Secret) Scan

func (self *Secret) Scan(value any) error

func (Secret) String

func (self Secret) String() string

func (Secret) Value

func (self Secret) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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