models

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InfraTypeNginx    = "nginx"
	InfraTypeCertbot  = "certbot"
	InfraTypeDatabase = "database"
	InfraTypeRedis    = "redis"
	InfraTypePowerDNS = "powerdns"

	InfraStatusRunning  = "running"
	InfraStatusStopped  = "stopped"
	InfraStatusExternal = "external"
	InfraStatusUnknown  = "unknown"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthType added in v0.1.5

type AuthType string
const (
	AuthTypeBasic AuthType = "basic"
	AuthTypeToken AuthType = "token"
)

type BackupHookSpec added in v0.1.5

type BackupHookSpec struct {
	Service string `yaml:"service" json:"service"`
	Command string `yaml:"command" json:"command"`
	Timeout int    `yaml:"timeout,omitempty" json:"timeout,omitempty"`
}

type BackupSpec added in v0.1.5

type BackupSpec struct {
	ContainerPaths  []ContainerBackupPath `yaml:"container_paths,omitempty" json:"container_paths,omitempty"`
	Databases       []DatabaseBackupSpec  `yaml:"databases,omitempty" json:"databases,omitempty"`
	PreHooks        []BackupHookSpec      `yaml:"pre_hooks,omitempty" json:"pre_hooks,omitempty"`
	PostHooks       []BackupHookSpec      `yaml:"post_hooks,omitempty" json:"post_hooks,omitempty"`
	ExcludePatterns []string              `yaml:"exclude_patterns,omitempty" json:"exclude_patterns,omitempty"`
}

type Certificate

type Certificate struct {
	Domain       string    `json:"domain"`
	Issuer       string    `json:"issuer"`
	NotBefore    time.Time `json:"not_before"`
	NotAfter     time.Time `json:"not_after"`
	DaysLeft     int       `json:"days_left"`
	Status       string    `json:"status"`
	Path         string    `json:"path"`
	AutoRenew    bool      `json:"auto_renew"`
	DeploymentID string    `json:"deployment_id,omitempty"`
}

type ContainerBackupPath added in v0.1.5

type ContainerBackupPath struct {
	Service       string `yaml:"service" json:"service"`
	ContainerPath string `yaml:"container_path" json:"container_path"`
	Description   string `yaml:"description,omitempty" json:"description,omitempty"`
	Required      bool   `yaml:"required" json:"required"`
}

type DatabaseBackupSpec added in v0.1.5

type DatabaseBackupSpec struct {
	Service     string `yaml:"service" json:"service"`
	Type        string `yaml:"type" json:"type"`
	HostEnv     string `yaml:"host_env,omitempty" json:"host_env,omitempty"`
	PortEnv     string `yaml:"port_env,omitempty" json:"port_env,omitempty"`
	UserEnv     string `yaml:"user_env,omitempty" json:"user_env,omitempty"`
	PasswordEnv string `yaml:"password_env,omitempty" json:"password_env,omitempty"`
	DatabaseEnv string `yaml:"database_env,omitempty" json:"database_env,omitempty"`
	Host        string `yaml:"host,omitempty" json:"host,omitempty"`
	Port        int    `yaml:"port,omitempty" json:"port,omitempty"`
	User        string `yaml:"user,omitempty" json:"user,omitempty"`
	Password    string `yaml:"password,omitempty" json:"password,omitempty"`
	Database    string `yaml:"database,omitempty" json:"database,omitempty"`
}

type DatabaseConfig added in v0.1.5

type DatabaseConfig struct {
	ID           string `yaml:"id" json:"id"`
	Alias        string `yaml:"alias" json:"alias"`
	Type         string `yaml:"type" json:"type"`
	Mode         string `yaml:"mode" json:"mode"`
	Service      string `yaml:"service,omitempty" json:"service,omitempty"`
	Host         string `yaml:"host,omitempty" json:"host,omitempty"`
	Port         int    `yaml:"port,omitempty" json:"port,omitempty"`
	Container    string `yaml:"container,omitempty" json:"container,omitempty"`
	DatabaseName string `yaml:"database_name,omitempty" json:"database_name,omitempty"`
	Username     string `yaml:"username,omitempty" json:"username,omitempty"`
	EnvPrefix    string `yaml:"env_prefix,omitempty" json:"env_prefix,omitempty"`
	IsShared     bool   `yaml:"is_shared,omitempty" json:"is_shared,omitempty"`
}

type Deployment

type Deployment struct {
	Name      string           `json:"name"`
	Path      string           `json:"path"`
	Status    string           `json:"status"`
	CreatedAt time.Time        `json:"created_at"`
	UpdatedAt time.Time        `json:"updated_at"`
	Services  []Service        `json:"services,omitempty"`
	Metadata  *ServiceMetadata `json:"metadata,omitempty"`
}

type DeploymentRateLimit added in v0.1.5

type DeploymentRateLimit struct {
	Path    string `yaml:"path" json:"path"`
	Rate    int    `yaml:"rate" json:"rate"`
	Burst   int    `yaml:"burst" json:"burst"`
	Enabled bool   `yaml:"enabled" json:"enabled"`
}

type DeploymentSecurityConfig added in v0.1.5

type DeploymentSecurityConfig struct {
	Enabled        bool                  `yaml:"enabled" json:"enabled"`
	BlockedIPs     []string              `yaml:"blocked_ips,omitempty" json:"blocked_ips,omitempty"`
	ProtectedPaths []ProtectedPath       `yaml:"protected_paths,omitempty" json:"protected_paths,omitempty"`
	RateLimits     []DeploymentRateLimit `yaml:"rate_limits,omitempty" json:"rate_limits,omitempty"`
}

type DeploymentStatus

type DeploymentStatus string
const (
	StatusRunning DeploymentStatus = "running"
	StatusStopped DeploymentStatus = "stopped"
	StatusError   DeploymentStatus = "error"
	StatusUnknown DeploymentStatus = "unknown"
)

type DomainConfig added in v0.1.5

type DomainConfig struct {
	ID            string    `yaml:"id" json:"id"`
	Service       string    `yaml:"service" json:"service"`
	ContainerPort int       `yaml:"container_port" json:"container_port"`
	Domain        string    `yaml:"domain" json:"domain"`
	PathPrefix    string    `yaml:"path_prefix,omitempty" json:"path_prefix,omitempty"`
	StripPrefix   bool      `yaml:"strip_prefix,omitempty" json:"strip_prefix,omitempty"`
	SSL           SSLConfig `yaml:"ssl" json:"ssl"`
	Aliases       []string  `yaml:"aliases,omitempty" json:"aliases,omitempty"`
}

type HealthCheckConfig

type HealthCheckConfig struct {
	Path     string `yaml:"path" json:"path"`
	Interval string `yaml:"interval" json:"interval"`
}

type InfraService added in v0.1.5

type InfraService struct {
	Name        string         `json:"name"`
	Type        string         `json:"type"`
	Status      string         `json:"status"`
	Managed     bool           `json:"managed"`
	External    bool           `json:"external"`
	ContainerID string         `json:"container_id,omitempty"`
	Image       string         `json:"image,omitempty"`
	Health      string         `json:"health,omitempty"`
	CreatedAt   time.Time      `json:"created_at,omitempty"`
	Config      map[string]any `json:"config,omitempty"`
}

type Network

type Network struct {
	ID         string             `json:"id"`
	Name       string             `json:"name"`
	Driver     string             `json:"driver"`
	Scope      string             `json:"scope"`
	Subnet     string             `json:"subnet"`
	Gateway    string             `json:"gateway"`
	Containers []NetworkContainer `json:"containers"`
	Labels     map[string]string  `json:"labels"`
	Created    string             `json:"created"`
}

type NetworkContainer

type NetworkContainer struct {
	Name       string `json:"name"`
	IPv4       string `json:"ipv4"`
	MacAddress string `json:"mac_address"`
}

type NetworkingConfig

type NetworkingConfig struct {
	Expose        bool   `yaml:"expose" json:"expose"`
	Domain        string `yaml:"domain" json:"domain"`
	Service       string `yaml:"service,omitempty" json:"service,omitempty"`
	ContainerPort int    `yaml:"container_port" json:"container_port"`
	Protocol      string `yaml:"protocol" json:"protocol"`
	ProxyType     string `yaml:"proxy_type" json:"proxy_type"`
}

type ProtectedCommandRule added in v0.2.0

type ProtectedCommandRule struct {
	ID            string `yaml:"id,omitempty" json:"id,omitempty"`
	Name          string `yaml:"name,omitempty" json:"name,omitempty"`
	Match         string `yaml:"match" json:"match"`
	Pattern       string `yaml:"pattern" json:"pattern"`
	CaseSensitive bool   `yaml:"case_sensitive,omitempty" json:"case_sensitive,omitempty"`
	Description   string `yaml:"description,omitempty" json:"description,omitempty"`
}

type ProtectedModeConfig added in v0.2.0

type ProtectedModeConfig struct {
	Enabled             bool                   `yaml:"enabled" json:"enabled"`
	BlockedActions      []string               `yaml:"blocked_actions,omitempty" json:"blocked_actions,omitempty"`
	BlockedCommandRules []ProtectedCommandRule `yaml:"blocked_command_rules,omitempty" json:"blocked_command_rules,omitempty"`
	DisableTerminal     bool                   `yaml:"disable_terminal,omitempty" json:"disable_terminal,omitempty"`
}

type ProtectedPath added in v0.1.5

type ProtectedPath struct {
	Pattern string `yaml:"pattern" json:"pattern"`
	Enabled bool   `yaml:"enabled" json:"enabled"`
}

type QuickAction added in v0.1.5

type QuickAction struct {
	ID          string `yaml:"id" json:"id"`
	Name        string `yaml:"name" json:"name"`
	Command     string `yaml:"command" json:"command"`
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
	Icon        string `yaml:"icon,omitempty" json:"icon,omitempty"`
	Service     string `yaml:"service,omitempty" json:"service,omitempty"`
}

type RegistryCredential added in v0.1.5

type RegistryCredential struct {
	ID               string    `json:"id" yaml:"id"`
	Name             string    `json:"name" yaml:"name"`
	RegistryTypeSlug string    `json:"registry_type_slug" yaml:"registry_type_slug"`
	RegistryURL      string    `json:"registry_url,omitempty" yaml:"registry_url,omitempty"`
	Username         string    `json:"username" yaml:"username"`
	Password         string    `json:"-" yaml:"password"`
	Email            string    `json:"email,omitempty" yaml:"email,omitempty"`
	IsDefault        bool      `json:"is_default" yaml:"is_default"`
	CreatedAt        time.Time `json:"created_at" yaml:"created_at"`
	UpdatedAt        time.Time `json:"updated_at" yaml:"updated_at"`
}

type RegistryCredentialWithType added in v0.1.5

type RegistryCredentialWithType struct {
	RegistryCredential
	RegistryType *RegistryType `json:"registry_type,omitempty"`
}

type RegistryType added in v0.1.5

type RegistryType struct {
	Slug        string             `json:"slug" yaml:"slug"`
	Name        string             `json:"name" yaml:"name"`
	URLPatterns []string           `json:"url_patterns" yaml:"url_patterns"`
	AuthType    AuthType           `json:"auth_type" yaml:"auth_type"`
	LoginURL    string             `json:"login_url,omitempty" yaml:"login_url,omitempty"`
	DocsURL     string             `json:"docs_url,omitempty" yaml:"docs_url,omitempty"`
	Icon        string             `json:"icon,omitempty" yaml:"icon,omitempty"`
	Source      RegistryTypeSource `json:"source" yaml:"source"`
	IsOfficial  bool               `json:"is_official" yaml:"is_official"`
	CreatedAt   time.Time          `json:"created_at" yaml:"created_at"`
	UpdatedAt   time.Time          `json:"updated_at" yaml:"updated_at"`
}

func DefaultRegistryTypes added in v0.1.5

func DefaultRegistryTypes() []RegistryType

type RegistryTypeSource added in v0.1.5

type RegistryTypeSource string
const (
	RegistrySourceBuiltin     RegistryTypeSource = "builtin"
	RegistrySourceLocal       RegistryTypeSource = "local"
	RegistrySourceMarketplace RegistryTypeSource = "marketplace"
)

type SSLConfig

type SSLConfig struct {
	Enabled  bool `yaml:"enabled" json:"enabled"`
	AutoCert bool `yaml:"auto_cert" json:"auto_cert"`
}

type Service

type Service struct {
	Name        string    `json:"name"`
	ContainerID string    `json:"container_id"`
	Image       string    `json:"image"`
	Status      string    `json:"status"`
	Health      string    `json:"health,omitempty"`
	Ports       []string  `json:"ports,omitempty"`
	Networks    []string  `json:"networks,omitempty"`
	CreatedAt   time.Time `json:"created_at"`
}

type ServiceMetadata

type ServiceMetadata struct {
	Name               string                    `yaml:"name" json:"name"`
	Type               string                    `yaml:"type" json:"type"`
	Networking         NetworkingConfig          `yaml:"networking" json:"networking"`
	SSL                SSLConfig                 `yaml:"ssl" json:"ssl"`
	HealthCheck        HealthCheckConfig         `yaml:"healthcheck" json:"healthcheck"`
	QuickActions       []QuickAction             `yaml:"quick_actions,omitempty" json:"quick_actions,omitempty"`
	Security           *DeploymentSecurityConfig `yaml:"security,omitempty" json:"security,omitempty"`
	Backup             *BackupSpec               `yaml:"backup,omitempty" json:"backup,omitempty"`
	ProtectedMode      *ProtectedModeConfig      `yaml:"protected_mode,omitempty" json:"protected_mode,omitempty"`
	CredentialID       string                    `yaml:"credential_id,omitempty" json:"credential_id,omitempty"`
	ServiceCredentials map[string]string         `yaml:"service_credentials,omitempty" json:"service_credentials,omitempty"`
	Domains            []DomainConfig            `yaml:"domains,omitempty" json:"domains,omitempty"`
	Databases          []DatabaseConfig          `yaml:"databases,omitempty" json:"databases,omitempty"`
}

func (*ServiceMetadata) GetDatabases added in v0.1.5

func (m *ServiceMetadata) GetDatabases() []DatabaseConfig

func (*ServiceMetadata) GetDomains added in v0.1.5

func (m *ServiceMetadata) GetDomains() []DomainConfig

func (*ServiceMetadata) GetPrimaryDatabase added in v0.1.5

func (m *ServiceMetadata) GetPrimaryDatabase() *DatabaseConfig

func (*ServiceMetadata) GetUniqueDomainNames added in v0.1.5

func (m *ServiceMetadata) GetUniqueDomainNames() []string

func (*ServiceMetadata) HasMultipleDatabases added in v0.1.5

func (m *ServiceMetadata) HasMultipleDatabases() bool

func (*ServiceMetadata) HasMultipleDomains added in v0.1.5

func (m *ServiceMetadata) HasMultipleDomains() bool

Jump to

Keyboard shortcuts

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