types

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CatalogService

type CatalogService struct {
	Name        string                  `toml:"name"`
	Description string                  `toml:"description"`
	Category    string                  `toml:"category"` // database, cache, queue, monitoring, etc.
	Icon        string                  `toml:"icon"`     // emoji or icon reference
	Versions    map[string]*ServiceSpec `toml:"versions"`
	Tags        []string                `toml:"tags"`
	Links       *ServiceLinks           `toml:"links"`
}

CatalogService represents a service definition in the catalog

type CertificatesConfig

type CertificatesConfig struct {
	CACert   string
	CAKey    string
	CertsDir string
}

CertificatesConfig holds SSL certificate configuration

type Config

type Config struct {
	Preferences  PreferencesConfig
	Network      NetworkGlobalConfig
	Traefik      TraefikGlobalConfig
	Certificates CertificatesConfig
	Instances    map[string]*Instance
	Projects     map[string]*Project
}

Config represents the main Doku configuration

type ConfigOption

type ConfigOption struct {
	Name        string   `toml:"name"`                 // Option name
	Description string   `toml:"description"`          // Option description
	Type        string   `toml:"type"`                 // string, int, bool, select
	Default     string   `toml:"default"`              // Default value
	Required    bool     `toml:"required"`             // Whether required
	EnvVar      string   `toml:"env_var"`              // Environment variable name
	Options     []string `toml:"options,omitempty"`    // For select type
	Validation  string   `toml:"validation,omitempty"` // Validation regex
}

ConfigOption represents a single configuration option

type ConnectionInfo

type ConnectionInfo struct {
	Host     string            `json:"host"`
	Port     int               `json:"port"`
	URL      string            `json:"url"`
	Protocol string            `json:"protocol"`
	Env      map[string]string `json:"env"` // Environment variables for connection
}

ConnectionInfo represents service connection information

type DiscoveryConfig

type DiscoveryConfig struct {
	Type               string
	Protocol           string
	DefaultPort        int
	ConnectionTemplate string
	EnvVars            map[string]string
	CompatibleWith     []string
}

DiscoveryConfig holds service discovery metadata

type DockerConfig

type DockerConfig struct {
	Image       string
	DefaultTag  string
	Ports       []PortConfig
	Environment []EnvVar
	Volumes     []VolumeConfig
	HealthCheck *HealthCheck
}

DockerConfig holds Docker-specific configuration

type EnvVar

type EnvVar struct {
	Key         string
	Default     string
	Description string
	Required    bool
	Prompt      string
}

EnvVar defines an environment variable

type HealthCheck

type HealthCheck struct {
	Test     []string
	Interval string
	Timeout  string
	Retries  int
}

HealthCheck defines container health check

type Healthcheck

type Healthcheck struct {
	Test     []string `toml:"test"`         // Health check command
	Interval string   `toml:"interval"`     // Check interval (e.g., "30s")
	Timeout  string   `toml:"timeout"`      // Check timeout
	Retries  int      `toml:"retries"`      // Number of retries
	Start    string   `toml:"start_period"` // Start period before checks begin
}

Healthcheck defines health check configuration

type Instance

type Instance struct {
	Name             string
	ServiceType      string
	Version          string
	Status           ServiceStatus
	ContainerName    string
	URL              string
	ConnectionString string
	CreatedAt        time.Time
	UpdatedAt        time.Time
	Network          NetworkConfig
	Resources        ResourceConfig
	Traefik          TraefikInstanceConfig
	Volumes          map[string]string
	Environment      map[string]string
}

Instance represents an installed service instance

type NetworkConfig

type NetworkConfig struct {
	Name         string
	InternalPort int
	HostPort     int
}

NetworkConfig holds network configuration for an instance

type NetworkGlobalConfig

type NetworkGlobalConfig struct {
	Name    string
	Subnet  string
	Gateway string
}

NetworkGlobalConfig holds global network configuration

type PortConfig

type PortConfig struct {
	Container    int
	HostDefault  int
	Description  string
	ExposeToHost bool
}

PortConfig defines a port mapping

type PreferencesConfig

type PreferencesConfig struct {
	Protocol       string
	Domain         string
	CatalogVersion string
	LastUpdate     time.Time
	DNSSetup       string
}

PreferencesConfig holds user preferences

type Project

type Project struct {
	Name          string
	Path          string
	Dockerfile    string
	Status        ServiceStatus
	ContainerName string
	URL           string
	Port          int
	CreatedAt     time.Time
	Dependencies  []string
	Environment   map[string]string
}

Project represents a local user project

type ResourceConfig

type ResourceConfig struct {
	MemoryLimit string
	MemoryUsage string
	CPULimit    string
	CPUUsage    string
}

ResourceConfig holds resource limits and usage

type ResourceRequirements

type ResourceRequirements struct {
	MemoryMin string `toml:"memory_min"` // Minimum memory (e.g., "256m")
	MemoryMax string `toml:"memory_max"` // Maximum memory (e.g., "1g")
	CPUMin    string `toml:"cpu_min"`    // Minimum CPU (e.g., "0.25")
	CPUMax    string `toml:"cpu_max"`    // Maximum CPU (e.g., "1.0")
}

ResourceRequirements defines default resource requirements

type Service

type Service struct {
	Name         string
	DisplayName  string
	Description  string
	Category     string
	Icon         string
	Tags         []string
	OfficialDocs string
	Versions     VersionConfig
	Docker       DockerConfig
	Traefik      TraefikConfig
	Discovery    DiscoveryConfig
}

Service represents a service from the catalog

type ServiceCatalog

type ServiceCatalog struct {
	Version  string                     `toml:"version"`
	Services map[string]*CatalogService `toml:"services"`
}

ServiceCatalog represents the complete catalog structure

type ServiceConfiguration

type ServiceConfiguration struct {
	Options []ConfigOption `toml:"options"` // Configuration options
}

ServiceConfiguration defines configurable options

type ServiceLinks struct {
	Homepage      string `toml:"homepage"`
	Documentation string `toml:"documentation"`
	Repository    string `toml:"repository"`
}

ServiceLinks contains useful links for a service

type ServiceSpec

type ServiceSpec struct {
	Image         string                `toml:"image"`         // Docker image with tag
	Description   string                `toml:"description"`   // Version-specific description
	Port          int                   `toml:"port"`          // Main service port
	AdminPort     int                   `toml:"admin_port"`    // Optional admin/management port
	Protocol      string                `toml:"protocol"`      // http, tcp, grpc, etc.
	Environment   map[string]string     `toml:"environment"`   // Default environment variables
	Volumes       []string              `toml:"volumes"`       // Volume mount paths
	Command       []string              `toml:"command"`       // Custom command
	Healthcheck   *Healthcheck          `toml:"healthcheck"`   // Health check configuration
	Resources     *ResourceRequirements `toml:"resources"`     // CPU/memory requirements
	Configuration *ServiceConfiguration `toml:"configuration"` // Configuration options
	Dependencies  []string              `toml:"dependencies"`  // Other services this depends on
}

ServiceSpec represents a specific version of a service

type ServiceStatus

type ServiceStatus string

ServiceStatus represents the status of a service instance

const (
	StatusRunning ServiceStatus = "running"
	StatusStopped ServiceStatus = "stopped"
	StatusFailed  ServiceStatus = "failed"
	StatusUnknown ServiceStatus = "unknown"
)

type TraefikConfig

type TraefikConfig struct {
	Enabled         bool
	Port            int
	HasWebInterface bool
	WebPort         int
	CustomRules     []string
}

TraefikConfig holds Traefik routing configuration

type TraefikGlobalConfig

type TraefikGlobalConfig struct {
	ContainerName    string
	Status           ServiceStatus
	DashboardEnabled bool
	HTTPPort         int
	HTTPSPort        int
	DashboardURL     string
}

TraefikGlobalConfig holds Traefik global configuration

type TraefikInstanceConfig

type TraefikInstanceConfig struct {
	Enabled   bool
	Subdomain string
	Port      int
	Protocol  string
}

TraefikInstanceConfig holds Traefik configuration for an instance

type VersionConfig

type VersionConfig struct {
	Default    string
	Supported  []string
	Deprecated []string
	EOL        []string
}

VersionConfig holds version information

type VolumeConfig

type VolumeConfig struct {
	ContainerPath string
	HostPath      string
	Description   string
	Required      bool
}

VolumeConfig defines a volume mount

Jump to

Keyboard shortcuts

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