profile

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FeaturesProfile

type FeaturesProfile struct {
	Debug          bool `toml:"debug"`
	SSL            bool `toml:"ssl"`
	Logging        bool `toml:"logging"`
	Metrics        bool `toml:"metrics"`
	HealthCheck    bool `toml:"health_check"`
	AutoRestart    bool `toml:"auto_restart"`
	ResourceLimits bool `toml:"resource_limits"`
}

FeaturesProfile defines feature flags for a profile

type Manager

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

Manager handles service profile operations

func NewManager

func NewManager(dokuDir string) *Manager

NewManager creates a new profile manager

func (*Manager) CreateDefaultProfiles

func (m *Manager) CreateDefaultProfiles(serviceName string) (*ServiceProfiles, error)

CreateDefaultProfiles creates default development and production profiles for a service

func (*Manager) DeleteProfiles

func (m *Manager) DeleteProfiles(serviceName string) error

DeleteProfiles removes profiles for a service

func (*Manager) EnsureProfilesDir

func (m *Manager) EnsureProfilesDir() error

EnsureProfilesDir creates the profiles directory if it doesn't exist

func (*Manager) GetProfile

func (m *Manager) GetProfile(serviceName, profileName string) (*Profile, error)

GetProfile gets a specific profile for a service

func (*Manager) GetProfilesDir

func (m *Manager) GetProfilesDir() string

GetProfilesDir returns the profiles directory path

func (*Manager) GetServiceProfiles

func (m *Manager) GetServiceProfiles(serviceName string) (*ServiceProfiles, error)

GetServiceProfiles loads profiles for a specific service

func (*Manager) HasProfiles

func (m *Manager) HasProfiles(serviceName string) bool

HasProfiles checks if a service has profiles defined

func (*Manager) ListAllServices

func (m *Manager) ListAllServices() ([]string, error)

ListAllServices returns all services that have profiles defined

func (*Manager) ListProfiles

func (m *Manager) ListProfiles(serviceName string) ([]string, error)

ListProfiles returns all profiles for a service

func (*Manager) SaveServiceProfiles

func (m *Manager) SaveServiceProfiles(profiles *ServiceProfiles) error

SaveServiceProfiles saves profiles for a specific service

type Profile

type Profile struct {
	Name        string            `toml:"name"`
	Type        ProfileType       `toml:"type"`
	Description string            `toml:"description"`
	Environment map[string]string `toml:"environment"`
	Resources   ResourceProfile   `toml:"resources"`
	Volumes     []VolumeProfile   `toml:"volumes"`
	Replicas    int               `toml:"replicas"`
	Features    FeaturesProfile   `toml:"features"`
}

Profile represents a service configuration profile

func GetDevelopmentProfile

func GetDevelopmentProfile(serviceName string) *Profile

GetDevelopmentProfile returns a default development profile

func GetProductionProfile

func GetProductionProfile(serviceName string) *Profile

GetProductionProfile returns a default production profile

func (*Profile) MergeEnvironment

func (p *Profile) MergeEnvironment(existing map[string]string) map[string]string

MergeEnvironment merges profile environment variables with existing ones Profile values take precedence

type ProfileType

type ProfileType string

ProfileType represents the type of profile

const (
	ProfileDevelopment ProfileType = "development"
	ProfileProduction  ProfileType = "production"
	ProfileCustom      ProfileType = "custom"
)

type ResourceProfile

type ResourceProfile struct {
	MemoryLimit string `toml:"memory_limit"`
	MemoryMin   string `toml:"memory_min"`
	CPULimit    string `toml:"cpu_limit"`
	CPUMin      string `toml:"cpu_min"`
}

ResourceProfile defines resource allocation for a profile

type ServiceProfiles

type ServiceProfiles struct {
	Service  string              `toml:"service"`
	Default  string              `toml:"default"`
	Profiles map[string]*Profile `toml:"profiles"`
}

ServiceProfiles holds profiles for a specific service

type VolumeProfile

type VolumeProfile struct {
	Source      string `toml:"source"`
	Target      string `toml:"target"`
	Type        string `toml:"type"` // bind, volume, tmpfs
	Persistent  bool   `toml:"persistent"`
	Description string `toml:"description"`
}

VolumeProfile defines volume configuration for a profile

Jump to

Keyboard shortcuts

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