models

package
v0.0.0-...-e8b7ea3 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2025 License: AGPL-3.0, AGPL-3.0-or-later Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetValidator

func GetValidator() *validator.Validate

Types

type ArchType

type ArchType string

ArchType represents CPU architecture enum

const (
	ArchTypeAMD64 ArchType = "amd64"
	ArchTypeARM64 ArchType = "arm64"
)

func (*ArchType) Scan

func (arch *ArchType) Scan(value any) error

func (ArchType) String

func (arch ArchType) String() string

func (ArchType) Valid

func (arch ArchType) Valid() error

func (ArchType) Value

func (arch ArchType) Value() (driver.Value, error)

type CheckUpdatesRequest

type CheckUpdatesRequest struct {
	InstallerVersion string   `json:"installer_version" validate:"required,semver"`
	InstallerOS      OSType   `json:"installer_os" validate:"required,valid"`
	InstallerArch    ArchType `json:"installer_arch" validate:"required,valid"`

	// Current installed components
	Components []ComponentInfo `json:"components" validate:"dive,valid"`
}

CheckUpdatesRequest represents public API request for checking updates

func (CheckUpdatesRequest) Valid

func (p CheckUpdatesRequest) Valid() error

type CheckUpdatesResponse

type CheckUpdatesResponse struct {
	Updates []UpdateInfo `json:"updates" validate:"dive,valid"`
}

CheckUpdatesResponse represents response for update check

func (CheckUpdatesResponse) Valid

func (c CheckUpdatesResponse) Valid() error

type ComponentInfo

type ComponentInfo struct {
	Component  ComponentType   `json:"component" validate:"required,valid"`
	Status     ComponentStatus `json:"status" validate:"required,valid"`
	Version    *string         `json:"version,omitempty" validate:"omitempty,semver"`
	Hash       *string         `json:"hash,omitempty" validate:"omitempty,min=1,max=255"`
	Repository *string         `json:"repository,omitempty" validate:"omitempty,min=1,max=255"`
	Tag        *string         `json:"tag,omitempty" validate:"omitempty,min=1,max=100"`
}

ComponentInfo represents information about installed component

func (ComponentInfo) Valid

func (c ComponentInfo) Valid() error

type ComponentStatus

type ComponentStatus string

ComponentStatus represents component status enum

const (
	ComponentStatusUnused    ComponentStatus = "unused"
	ComponentStatusConnected ComponentStatus = "connected"
	ComponentStatusInstalled ComponentStatus = "installed"
	ComponentStatusRunning   ComponentStatus = "running"
)

func (*ComponentStatus) Scan

func (cs *ComponentStatus) Scan(value any) error

func (ComponentStatus) String

func (cs ComponentStatus) String() string

func (ComponentStatus) Valid

func (cs ComponentStatus) Valid() error

func (ComponentStatus) Value

func (cs ComponentStatus) Value() (driver.Value, error)

type ComponentType

type ComponentType string

ComponentType represents component type enum

const (
	ComponentTypePentagi        ComponentType = "pentagi"
	ComponentTypeScraper        ComponentType = "scraper"
	ComponentTypeLangfuseWorker ComponentType = "langfuse-worker"
	ComponentTypeLangfuseWeb    ComponentType = "langfuse-web"
	ComponentTypeGrafana        ComponentType = "grafana"
	ComponentTypeOtelcol        ComponentType = "otelcol"
	ComponentTypeWorker         ComponentType = "worker"
	ComponentTypeInstaller      ComponentType = "installer"
	ComponentTypeEngine         ComponentType = "engine"
)

func (*ComponentType) Scan

func (ct *ComponentType) Scan(value any) error

func (ComponentType) String

func (ct ComponentType) String() string

func (ComponentType) Valid

func (ct ComponentType) Valid() error

func (ComponentType) Value

func (ct ComponentType) Value() (driver.Value, error)

type DownloadPackageRequest

type DownloadPackageRequest struct {
	Component ComponentType `json:"component" validate:"required,valid"`
	Version   string        `json:"version" validate:"required,semver"`
	OS        OSType        `json:"os" validate:"required,valid"`
	Arch      ArchType      `json:"arch" validate:"required,valid"`
}

DownloadPackageRequest represents public API request to download package

func (DownloadPackageRequest) Query

func (p DownloadPackageRequest) Query() map[string]string

func (DownloadPackageRequest) Valid

func (p DownloadPackageRequest) Valid() error

type IQuery

type IQuery interface {
	Query() map[string]string
}

IQuery is interface to control all models from user code

type IValid

type IValid interface {
	Valid() error
}

IValid is interface to control all models from user code

type OSType

type OSType string

OSType represents operating system enum

const (
	OSTypeWindows OSType = "windows"
	OSTypeLinux   OSType = "linux"
	OSTypeDarwin  OSType = "darwin"
)

func (*OSType) Scan

func (os *OSType) Scan(value any) error

func (OSType) String

func (os OSType) String() string

func (OSType) Valid

func (os OSType) Valid() error

func (OSType) Value

func (os OSType) Value() (driver.Value, error)

type PackageInfoRequest

type PackageInfoRequest struct {
	Component ComponentType `json:"component" validate:"required,valid"`
	Version   string        `json:"version" validate:"required,semver"`
	OS        OSType        `json:"os" validate:"required,valid"`
	Arch      ArchType      `json:"arch" validate:"required,valid"`
}

PackageInfoRequest represents public API request to get package info

func (PackageInfoRequest) Query

func (p PackageInfoRequest) Query() map[string]string

func (PackageInfoRequest) Valid

func (p PackageInfoRequest) Valid() error

type PackageInfoResponse

type PackageInfoResponse struct {
	Size      int64          `json:"size" validate:"required,min=1"`
	Hash      string         `json:"hash" validate:"required,len=64"`
	Version   string         `json:"version" validate:"required,semver"`
	OS        OSType         `json:"os" validate:"required,valid"`
	Arch      ArchType       `json:"arch" validate:"required,valid"`
	Signature SignatureValue `json:"signature,omitempty" validate:"omitempty,valid"`
}

PackageInfoResponse represents response for package info

func (PackageInfoResponse) Valid

func (p PackageInfoResponse) Valid() error

type ProductStack

type ProductStack string

ProductStack represents product stack enum

const (
	ProductStackPentagi       ProductStack = "pentagi"
	ProductStackLangfuse      ProductStack = "langfuse"
	ProductStackObservability ProductStack = "observability"
	ProductStackWorker        ProductStack = "worker"
	ProductStackInstaller     ProductStack = "installer"
	ProductStackEngine        ProductStack = "engine"
)

func (*ProductStack) Scan

func (ps *ProductStack) Scan(value any) error

func (ProductStack) String

func (ps ProductStack) String() string

func (ProductStack) Valid

func (ps ProductStack) Valid() error

func (ProductStack) Value

func (ps ProductStack) Value() (driver.Value, error)

type SignatureReader

type SignatureReader interface {
	io.Reader
	IValid
}

type SignatureValue

type SignatureValue string

func (*SignatureValue) FromBytes

func (sv *SignatureValue) FromBytes(b []byte) (SignatureValue, error)

func (*SignatureValue) Scan

func (sv *SignatureValue) Scan(value any) error

func (SignatureValue) String

func (sv SignatureValue) String() string

func (SignatureValue) ToBytes

func (sv SignatureValue) ToBytes() ([]byte, error)

func (SignatureValue) Valid

func (sv SignatureValue) Valid() error

func (SignatureValue) ValidateData

func (sv SignatureValue) ValidateData(data []byte) error

func (SignatureValue) ValidateFile

func (sv SignatureValue) ValidateFile(path string) error

func (SignatureValue) ValidateHash

func (sv SignatureValue) ValidateHash(hash []byte) error

func (SignatureValue) ValidateWrapReader

func (sv SignatureValue) ValidateWrapReader(r io.Reader) SignatureReader

func (SignatureValue) ValidateWrapWriter

func (sv SignatureValue) ValidateWrapWriter(w io.Writer) SignatureWriter

func (SignatureValue) Value

func (sv SignatureValue) Value() (driver.Value, error)

type SignatureWriter

type SignatureWriter interface {
	io.Writer
	IValid
}

type SupportErrorRequest

type SupportErrorRequest struct {
	Component    ComponentType `json:"component" validate:"required,valid"`
	Version      string        `json:"version" validate:"required,semver"`
	OS           OSType        `json:"os" validate:"required,valid"`
	Arch         ArchType      `json:"arch" validate:"required,valid"`
	ErrorDetails any           `json:"error_details" validate:"required"`
}

SupportErrorRequest represents public API request to report an error automatically

func (SupportErrorRequest) Valid

func (p SupportErrorRequest) Valid() error

type SupportErrorResponse

type SupportErrorResponse struct {
}

SupportErrorResponse represents response for error reporting (empty for now, reserved for future)

func (SupportErrorResponse) Valid

func (ser SupportErrorResponse) Valid() error

type SupportInvestigationRequest

type SupportInvestigationRequest struct {
	IssueID   uuid.UUID `json:"issue_id" validate:"required"`
	UseSteam  bool      `json:"use_steam,omitempty" validate:"omitempty"`
	UserInput string    `json:"user_input" validate:"required,min=1,max=4000"`
}

SupportInvestigationRequest represents public API request to investigate an issue with AI assistance

func (SupportInvestigationRequest) Valid

func (sir SupportInvestigationRequest) Valid() error

type SupportInvestigationResponse

type SupportInvestigationResponse struct {
	Answer string `json:"answer" validate:"required"`
}

SupportInvestigationResponse represents response for investigation of issue with AI assistance (without steam response)

func (SupportInvestigationResponse) Valid

func (sir SupportInvestigationResponse) Valid() error

type SupportIssueRequest

type SupportIssueRequest struct {
	Component    ComponentType `json:"component" validate:"required,valid"`
	Version      string        `json:"version" validate:"required,semver"`
	OS           OSType        `json:"os" validate:"required,valid"`
	Arch         ArchType      `json:"arch" validate:"required,valid"`
	Logs         []SupportLogs `json:"logs" validate:"omitempty,valid"`
	ErrorDetails any           `json:"error_details" validate:"required"`
}

SupportIssueRequest represents public API request to report an issue manually with AI assistance

func (SupportIssueRequest) Valid

func (sir SupportIssueRequest) Valid() error

type SupportIssueResponse

type SupportIssueResponse struct {
	IssueID uuid.UUID `json:"issue_id" validate:"required"`
}

SupportIssueResponse represents response for issue reporting with AI assistance

func (SupportIssueResponse) Valid

func (sir SupportIssueResponse) Valid() error

type SupportLogs

type SupportLogs struct {
	Component ComponentType `json:"component" validate:"required,valid"`
	Logs      []string      `json:"logs" validate:"omitempty,dive,min=1,max=8192"`
}

SupportLogs represents logs for a component

func (SupportLogs) Valid

func (sl SupportLogs) Valid() error

type UpdateInfo

type UpdateInfo struct {
	Stack          ProductStack `json:"stack" validate:"required,valid" swaggertype:"string"`
	HasUpdate      bool         `json:"has_update"`
	CurrentVersion *string      `json:"current_version,omitempty" validate:"omitempty,semver"`
	LatestVersion  *string      `json:"latest_version,omitempty" validate:"omitempty,semver"`
	Changelog      *string      `json:"changelog,omitempty" validate:"omitempty"`
	ReleaseNotes   *string      `json:"release_notes,omitempty" validate:"omitempty"`
}

UpdateInfo represents available update information

func (UpdateInfo) Valid

func (u UpdateInfo) Valid() error

Jump to

Keyboard shortcuts

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