models

package
v0.2.82 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResetColor added in v0.0.4

func ResetColor() string

ResetColor returns ANSI reset code

Types

type Addon added in v0.0.4

type Addon struct {
	ID          string            `json:"id"`
	Name        string            `json:"name"`
	Description string            `json:"description"`
	Category    string            `json:"category"`
	Version     string            `json:"version"`
	Status      string            `json:"status"`
	Image       string            `json:"image"`
	Icon        string            `json:"icon,omitempty"`
	Tags        []string          `json:"tags,omitempty"`
	Ports       []int             `json:"ports,omitempty"`
	EnvVars     map[string]string `json:"env_vars,omitempty"`
	CreatedAt   time.Time         `json:"created_at"`
	UpdatedAt   time.Time         `json:"updated_at"`
}

Addon represents an addon service that can be deployed

type AddonDeployRequest added in v0.0.4

type AddonDeployRequest struct {
	ID        string            `json:"id"`
	Server    string            `json:"Server"`
	Workspace string            `json:"Workspace"`
	ProjectID string            `json:"project_id,omitempty"`
	Name      string            `json:"name,omitempty"`
	EnvVars   map[string]string `json:"env_vars,omitempty"`
	Config    map[string]string `json:"config,omitempty"`
}

AddonDeployRequest represents a request to deploy an addon

type AddonDeployResponse added in v0.0.4

type AddonDeployResponse struct {
	DeploymentID string `json:"deployment_id"`
	Status       string `json:"status"`
	Message      string `json:"message"`
}

AddonDeployResponse represents the response when deploying an addon

type AddonDeployment added in v0.0.4

type AddonDeployment struct {
	ID            string    `json:"id"`
	Name          string    `json:"name"`
	DeploymentURL string    `json:"deployment_url,omitempty"`
	Category      string    `json:"category"`
	Status        string    `json:"status"`
	Environment   string    `json:"environment,omitempty"`
	Version       string    `json:"version,omitempty"`
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
}

AddonDeployment represents a deployed addon instance

type AddonDeploymentsResponse added in v0.0.4

type AddonDeploymentsResponse struct {
	Deployments []AddonDeployment `json:"deployments"`
	Total       int               `json:"total"`
}

AddonDeploymentsResponse represents the response when listing addon deployments

type AddonListResponse added in v0.0.4

type AddonListResponse struct {
	Addons []Addon `json:"addons"`
	Total  int     `json:"total"`
}

AddonListResponse represents the response when listing addons

type ContainerInfo added in v0.0.4

type ContainerInfo struct {
	Name         string            `json:"name"`
	ServiceName  string            `json:"service_name"`  // parent service name
	Image        string            `json:"image"`         // container image
	Status       string            `json:"status"`        // "running", "stopped", "restarting", etc.
	RestartCount int               `json:"restart_count"` // number of restarts
	Labels       map[string]string `json:"labels,omitempty"`
	CreatedAt    string            `json:"created_at"`
	StartedAt    string            `json:"started_at,omitempty"`
}

ContainerInfo represents information about a container that can be accessed

type ExecMessage added in v0.0.4

type ExecMessage struct {
	Type      string `json:"type"`                // "stdin", "stdout", "stderr", "resize", "exit"
	Data      string `json:"data"`                // message data (base64 encoded for binary data)
	Timestamp string `json:"timestamp"`           // message timestamp
	ExitCode  int    `json:"exit_code,omitempty"` // exit code (only for "exit" type)
}

ExecMessage represents a message in the WebSocket stream

type ExecRequest added in v0.0.4

type ExecRequest struct {
	ProjectID   string            `json:"project_id"`
	AddonID     string            `json:"addon_id,omitempty"`    // optional, for addon containers
	ServiceName string            `json:"service_name"`          // service to execute in
	Container   string            `json:"container,omitempty"`   // specific container name (if service has multiple)
	Command     []string          `json:"command"`               // command to execute
	Interactive bool              `json:"interactive"`           // whether to allocate a TTY
	Environment map[string]string `json:"environment,omitempty"` // environment variables
	WorkingDir  string            `json:"working_dir,omitempty"` // working directory
	User        string            `json:"user,omitempty"`        // user to run command as
}

ExecRequest represents a request to execute a command in a container

type ExecResponse added in v0.0.4

type ExecResponse struct {
	ExecID       string `json:"exec_id"`       // unique identifier for this exec session
	WebSocketURL string `json:"websocket_url"` // WebSocket URL for interactive session
	Status       string `json:"status"`        // "starting", "running", "completed", "error"
	StartedAt    string `json:"started_at"`    // when the exec session was started
}

ExecResponse represents the response when starting an exec session

type ExecStatus added in v0.0.4

type ExecStatus struct {
	ExecID    string `json:"exec_id"`
	Status    string `json:"status"` // "running", "completed", "error"
	StartedAt string `json:"started_at"`
	ExitCode  int    `json:"exit_code,omitempty"`
	Error     string `json:"error,omitempty"`
}

ExecStatus represents the status of an exec session

type ListContainersResponse added in v0.0.4

type ListContainersResponse struct {
	Containers []ContainerInfo `json:"containers"`
	Total      int             `json:"total"`
}

ListContainersResponse represents available containers for a project/addon

type ListExecResponse added in v0.0.4

type ListExecResponse struct {
	Sessions []ExecStatus `json:"sessions"`
	Total    int          `json:"total"`
}

ListExecResponse represents the response when listing exec sessions

type ListProxiesResponse added in v0.0.4

type ListProxiesResponse struct {
	Proxies []ProxyStatus `json:"proxies"`
	Total   int           `json:"total"`
}

ListProxiesResponse represents the response when listing active proxies

type ListServicesResponse added in v0.0.4

type ListServicesResponse struct {
	Services []ServiceInfo `json:"services"`
	Total    int           `json:"total"`
}

ListServicesResponse represents available services for a project/addon

type LogEntry added in v0.0.4

type LogEntry struct {
	ID        string            `json:"id"`
	Timestamp time.Time         `json:"timestamp"`
	Level     LogLevel          `json:"level"`
	Message   string            `json:"message"`
	Source    string            `json:"source"`           // e.g., "app", "nginx", "database"
	Container string            `json:"container"`        // container name/id
	Pod       string            `json:"pod"`              // kubernetes pod name
	Node      string            `json:"node"`             // kubernetes node name
	Labels    map[string]string `json:"labels,omitempty"` // additional metadata
}

LogEntry represents a single log entry

type LogLevel added in v0.0.4

type LogLevel string

LogLevel represents the severity level of a log entry

const (
	LogLevelDebug LogLevel = "debug"
	LogLevelInfo  LogLevel = "info"
	LogLevelWarn  LogLevel = "warn"
	LogLevelError LogLevel = "error"
	LogLevelFatal LogLevel = "fatal"
)

func (LogLevel) GetColor added in v0.0.4

func (l LogLevel) GetColor() string

GetLogLevelColor returns ANSI color code for log levels

type LogsExecRequest added in v0.0.4

type LogsExecRequest struct {
	ExecID string `json:"exec_id"`
	Lines  int    `json:"lines,omitempty"` // number of lines to get from the end
}

LogsExecRequest represents a request to get logs from an exec session

type LogsExecResponse added in v0.0.4

type LogsExecResponse struct {
	ExecID string   `json:"exec_id"`
	Logs   []string `json:"logs"`
}

LogsExecResponse represents logs from an exec session

type LogsRequest added in v0.0.4

type LogsRequest struct {
	ProjectID string     `json:"project_id"`
	AddonID   string     `json:"addon_id,omitempty"`  // optional, for addon logs
	Level     LogLevel   `json:"level,omitempty"`     // filter by minimum level
	Source    string     `json:"source,omitempty"`    // filter by source
	Container string     `json:"container,omitempty"` // filter by container
	Since     *time.Time `json:"since,omitempty"`     // logs since this time
	Until     *time.Time `json:"until,omitempty"`     // logs until this time
	Limit     int        `json:"limit,omitempty"`     // max number of logs to return
	Cursor    string     `json:"cursor,omitempty"`    // pagination cursor
	Follow    bool       `json:"follow,omitempty"`    // stream logs in real-time
	Tail      int        `json:"tail,omitempty"`      // get last N lines
}

LogsRequest represents a request for logs with filtering options

type LogsResponse added in v0.0.4

type LogsResponse struct {
	Logs       []LogEntry `json:"logs"`
	TotalCount int        `json:"total_count"`
	HasMore    bool       `json:"has_more"`
	NextCursor string     `json:"next_cursor,omitempty"`
}

LogsResponse represents the response from the logs API

type LogsStreamResponse added in v0.0.4

type LogsStreamResponse struct {
	Entry *StreamLogEntry `json:"entry,omitempty"`
	Error string          `json:"error,omitempty"`
}

LogsStreamResponse represents a streaming logs response

type PipeOpsTokenVerificationResponse

type PipeOpsTokenVerificationResponse struct {
	Valid    bool   `json:"valid"`
	ErrorMsg string `json:"error_msg,omitempty"`
}

TokenVerificationResponse represents the response structure from PipeOps API

type Project added in v0.0.4

type Project struct {
	ID          string    `json:"id"`
	Name        string    `json:"name"`
	Description string    `json:"description,omitempty"`
	Status      string    `json:"status"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
	UserID      string    `json:"user_id"`
}

Project represents a PipeOps project

type ProjectCreateRequest added in v0.0.4

type ProjectCreateRequest struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
}

ProjectCreateRequest represents the request to create a project

type ProjectUpdateRequest added in v0.0.4

type ProjectUpdateRequest struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	Status      string `json:"status,omitempty"`
}

ProjectUpdateRequest represents the request to update a project

type ProjectsResponse added in v0.0.4

type ProjectsResponse struct {
	Projects []Project `json:"projects"`
	Total    int       `json:"total"`
	Page     int       `json:"page"`
	PerPage  int       `json:"per_page"`
}

ProjectsResponse represents the response from the projects API

type ProxyRequest added in v0.0.4

type ProxyRequest struct {
	Target    ProxyTarget `json:"target"`
	LocalPort int         `json:"local_port,omitempty"` // desired local port (0 for auto-assign)
}

ProxyRequest represents a request to start a proxy

type ProxyResponse added in v0.0.4

type ProxyResponse struct {
	ProxyID    string      `json:"proxy_id"`    // unique identifier for this proxy session
	Target     ProxyTarget `json:"target"`      // target information
	LocalPort  int         `json:"local_port"`  // actual local port assigned
	RemoteHost string      `json:"remote_host"` // remote host to connect to
	RemotePort int         `json:"remote_port"` // remote port to connect to
	Status     string      `json:"status"`      // proxy status
	StartedAt  string      `json:"started_at"`  // when the proxy was started
}

ProxyResponse represents the response when starting a proxy

type ProxyStatus added in v0.0.4

type ProxyStatus struct {
	ProxyID       string `json:"proxy_id"`
	Status        string `json:"status"` // "active", "stopped", "error"
	LocalPort     int    `json:"local_port"`
	RemoteHost    string `json:"remote_host"`
	RemotePort    int    `json:"remote_port"`
	BytesIn       int64  `json:"bytes_in"`       // bytes received from remote
	BytesOut      int64  `json:"bytes_out"`      // bytes sent to remote
	ConnectionsIn int    `json:"connections_in"` // current inbound connections
	StartedAt     string `json:"started_at"`
	LastActivity  string `json:"last_activity,omitempty"`
	Error         string `json:"error,omitempty"`
}

ProxyStatus represents the current status of a proxy

type ProxyStopRequest added in v0.0.4

type ProxyStopRequest struct {
	ProxyID string `json:"proxy_id"`
}

ProxyStopRequest represents a request to stop a proxy

type ProxyTarget added in v0.0.4

type ProxyTarget struct {
	ProjectID   string `json:"project_id"`
	AddonID     string `json:"addon_id,omitempty"` // optional, for addon services
	ServiceName string `json:"service_name"`       // name of the service to proxy to
	Port        int    `json:"port"`               // target port on the service
}

ProxyTarget represents a target service to proxy to

type ResizeMessage added in v0.0.4

type ResizeMessage struct {
	Type string `json:"type"` // "resize"
	Cols int    `json:"cols"` // terminal columns
	Rows int    `json:"rows"` // terminal rows
}

ResizeMessage represents a terminal resize message

type Server added in v0.2.9

type Server struct {
	ID          string            `json:"id"`
	Name        string            `json:"name"`
	Description string            `json:"description,omitempty"`
	Status      string            `json:"status"` // "running", "stopped", "starting", "stopping", "error"
	Type        string            `json:"type"`   // "k3s", "docker", "kubernetes", etc.
	Region      string            `json:"region"`
	IP          string            `json:"ip,omitempty"`
	Port        int               `json:"port,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
	CreatedAt   time.Time         `json:"created_at"`
	UpdatedAt   time.Time         `json:"updated_at"`
	UserID      string            `json:"user_id"`
}

Server represents a PipeOps server

type ServerCreateRequest added in v0.2.9

type ServerCreateRequest struct {
	Name        string            `json:"name"`
	Description string            `json:"description,omitempty"`
	Type        string            `json:"type"`
	Region      string            `json:"region"`
	Labels      map[string]string `json:"labels,omitempty"`
}

ServerCreateRequest represents the request to create a server

type ServerStatus added in v0.2.9

type ServerStatus struct {
	ID           string    `json:"id"`
	Status       string    `json:"status"`
	CPUUsage     float64   `json:"cpu_usage,omitempty"`
	MemoryUsage  float64   `json:"memory_usage,omitempty"`
	DiskUsage    float64   `json:"disk_usage,omitempty"`
	Uptime       string    `json:"uptime,omitempty"`
	LastSeen     time.Time `json:"last_seen,omitempty"`
	ErrorMessage string    `json:"error_message,omitempty"`
}

ServerStatus represents the current status of a server

type ServerUpdateRequest added in v0.2.9

type ServerUpdateRequest struct {
	Name        string            `json:"name,omitempty"`
	Description string            `json:"description,omitempty"`
	Status      string            `json:"status,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
}

ServerUpdateRequest represents the request to update a server

type ServersResponse added in v0.2.9

type ServersResponse struct {
	Servers []Server `json:"servers"`
	Total   int      `json:"total"`
	Page    int      `json:"page"`
	PerPage int      `json:"per_page"`
}

ServersResponse represents the response from the servers API

type Service added in v0.2.23

type Service struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Status    string `json:"status"`
	ProjectID string `json:"project_id"`
}

Service represents a service in a project

type ServiceInfo added in v0.0.4

type ServiceInfo struct {
	Name        string            `json:"name"`
	Type        string            `json:"type"` // "web", "api", "database", etc.
	Port        int               `json:"port"`
	Protocol    string            `json:"protocol"` // "http", "https", "tcp", "udp"
	Description string            `json:"description"`
	Labels      map[string]string `json:"labels,omitempty"`
	Health      string            `json:"health"` // "healthy", "unhealthy", "unknown"
}

ServiceInfo represents information about a service that can be proxied

type ShellRequest added in v0.0.4

type ShellRequest struct {
	ProjectID   string            `json:"project_id"`
	AddonID     string            `json:"addon_id,omitempty"`    // optional, for addon containers
	ServiceName string            `json:"service_name"`          // service to connect to
	Container   string            `json:"container,omitempty"`   // specific container name
	Shell       string            `json:"shell,omitempty"`       // shell to use (bash, sh, zsh, etc.)
	Environment map[string]string `json:"environment,omitempty"` // environment variables
	WorkingDir  string            `json:"working_dir,omitempty"` // working directory
	User        string            `json:"user,omitempty"`        // user to run shell as
	Cols        int               `json:"cols,omitempty"`        // terminal columns
	Rows        int               `json:"rows,omitempty"`        // terminal rows
}

ShellRequest represents a request to start an interactive shell

type ShellResponse added in v0.0.4

type ShellResponse struct {
	SessionID    string `json:"session_id"`    // unique identifier for this shell session
	WebSocketURL string `json:"websocket_url"` // WebSocket URL for interactive session
	Status       string `json:"status"`        // "starting", "running", "completed", "error"
	StartedAt    string `json:"started_at"`    // when the shell session was started
}

ShellResponse represents the response when starting a shell session

type StreamLogEntry added in v0.0.4

type StreamLogEntry struct {
	LogEntry
	StreamID string `json:"stream_id"` // unique identifier for this stream
	EOF      bool   `json:"eof"`       // indicates end of stream
}

StreamLogEntry represents a log entry in a streaming context

Jump to

Keyboard shortcuts

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