api

package
v0.0.0-...-cdb22de Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

templ: version: v0.3.977

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dashboard

func Dashboard(port int, status Status) templ.Component

Types

type App

type App struct {
	Config      []string  `json:"config"`
	CreatedAt   time.Time `json:"created_at"`
	DatabaseURL string    `json:"database_url"`
	Dir         string    `json:"dir"`
	Health      Health    `json:"health"`
	Logs        []Log     `json:"logs"`
	Ports       Ports     `json:"ports"`
	Space       string    `json:"space"`
	Watch       Watch     `json:"watch"`
}

type AppIn

type AppIn struct {
	Config []string `json:"config"`
	Dir    string   `json:"dir"`
	Space  string   `json:"space"`
	Watch  Watch    `json:"watch"`
}

type AppOut

type AppOut struct {
	DatabaseURL string            `json:"database_url"`
	Env         map[string]string `json:"env,omitempty"`
	Ports       Ports             `json:"ports"`
	Space       string            `json:"space"`
}

type Client

type Client struct {
	URL string
}

func NewClient

func NewClient(url string) *Client

func (*Client) AppDelete

func (c *Client) AppDelete(space string)

func (*Client) AppPost

func (c *Client) AppPost(req AppIn) (*AppOut, error)

func (*Client) HealthUpdate

func (c *Client) HealthUpdate(space string, portActive int, status string)

func (*Client) LogPost

func (c *Client) LogPost(space string, entries []Log)

type EnvExportIn

type EnvExportIn struct {
	App        string `json:"app"`
	Passphrase string `json:"passphrase"`
}

type EnvExportOut

type EnvExportOut struct {
	Blob string `json:"blob"`
}

type EnvImportIn

type EnvImportIn struct {
	Blob       string `json:"blob"`
	Passphrase string `json:"passphrase"`
}

type EnvImportOut

type EnvImportOut struct {
	App  string            `json:"app"`
	Vars map[string]string `json:"vars"`
}

type Health

type Health struct {
	Status    string    `json:"status"`
	UpdatedAt time.Time `json:"updated_at"`
}

type Log

type Log struct {
	Level     string    `json:"level"`
	Message   string    `json:"message"`
	Timestamp time.Time `json:"timestamp"`
}

type Ports

type Ports struct {
	Active int `json:"active"`
	Blue   int `json:"blue"`
	Green  int `json:"green"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(cfg ServerConfig, logger *slog.Logger) *Server

func (*Server) LoadState

func (s *Server) LoadState(path string)

func (*Server) Middleware

func (s *Server) Middleware(e *echo.Echo)

func (*Server) PeriodicSave

func (s *Server) PeriodicSave(path string, interval time.Duration)

func (*Server) Routes

func (s *Server) Routes(e *echo.Echo)

func (*Server) SaveState

func (s *Server) SaveState(path string)

func (*Server) SetPostgres

func (s *Server) SetPostgres(running bool, pgURL string)

type ServerConfig

type ServerConfig struct {
	BluePortStart int
	DashboardPort int
	PostgresPort  int
}

type Status

type Status struct {
	AppCount        int    `json:"app_count"`
	PostgresPort    int    `json:"postgres_port"`
	PostgresRunning bool   `json:"postgres_running"`
	PostgresURL     string `json:"postgres_url"`
	Uptime          string `json:"uptime"`
	Version         string `json:"version"`
}

type Watch

type Watch struct {
	Ignore []string `json:"ignore"`
	Match  []string `json:"match"`
}

Jump to

Keyboard shortcuts

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