config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FirstNonEmpty

func FirstNonEmpty(s ...string) string

func NewFileLogger

func NewFileLogger(path string) (*slog.Logger, func() error, error)

NewFileLogger creates a new logger that writes to a file.

Types

type Address

type Address struct {
	Path            string      `json:"path,omitempty"`
	Dir             string      `json:"dir,omitempty"`
	Name            string      `json:"name,omitempty"`
	DirPermissions  os.FileMode `json:"dirPermissions,omitempty"`
	FilePermissions os.FileMode `json:"filePermissions,omitempty"`
}

Address contains address confiuration.

type Client

type Client struct {
	StderrBuffer bool `json:"stderrBuffer,omitempty"`
}

Client holds client configuration.

type Command

type Command struct{}

Command contains configuration for commands.

type Configuration

type Configuration struct {
	Address       Address            `json:"address,omitzero"`
	Server        Server             `json:"server,omitzero"`
	Client        Client             `json:"client,omitzero"`
	Commands      map[string]Command `json:"commands,omitempty"`
	WorkspaceRoot string             `json:"workspaceRoot,omitempty"`
	Version       string             `json:"-"`
	ConfigDir     string             `json:"-"`
}

Configuration holds configuration for both client and server.

func Configure

func Configure() (Configuration, error)

Configure creates and returns a new Configuration.

func (*Configuration) UnmarshalJSON

func (c *Configuration) UnmarshalJSON(b []byte) error

type Container

type Container struct {
	Env     map[string]string `json:"env,omitempty"`
	Volumes map[string]string `json:"volumes,omitempty"`
	Image   string            `json:"image,omitempty"`
	EnvFile string            `json:"envFile,omitempty"`
	CPUs    float64           `json:"cpus,omitempty"`
	Memory  string            `json:"memory,omitempty"`
	Enable  bool              `json:"enable,omitempty"`
	User    User              `json:"user,omitzero"`
}

Container contains server container configuration.

type Server

type Server struct {
	Container Container `json:"container,omitzero"`
}

Server contains server configuration.

type User

type User struct {
	Username string `json:"username"`
	HomeDir  string `json:"homeDir,omitempty"`
	UID      string `json:"uid,omitempty"`
	GID      string `json:"gid,omitempty"`
}

Jump to

Keyboard shortcuts

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