config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

README

UCM configuration

The config file for ucm is ~/.ucmconfig.yaml stored at user's home directory.

This file holds next information:

  • profiles:profiles: List of known profiles
  • active_profile: Name of an active profile
  • modules: Settings for modules

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotExists = os.ErrNotExist

Functions

func Write

func Write(config Ucm) error

Types

type HostsSettings

type HostsSettings struct {
	ModuleSettings
	HeaderComment string `yaml:"header"`
	FooterComment string `yaml:"footer"`
	EditMode      string `yaml:"editMode"` // Options: inline, block_top, block_bottom, block_first, block_last
}

type ModuleSettings

type ModuleSettings struct {
	Disabled bool     `yaml:"disabled,omitempty"`
	Requires []string `yaml:"requires,omitempty"`
}

ModuleSettings

type NodeJsSettings

type NodeJsSettings struct {
	ModuleSettings
	VersionManager string `yaml:"version_manager"`
}

NodeJsSettings holds configuration about settings related to NodeJS

type ProfileSettings

type ProfileSettings struct {
	Name string `yaml:"name"`
	Path string `yaml:"path,omitempty"`
	URL  string `yaml:"url,omitempty"`
	ETag string `yaml:"etag,omitempty"`
}

ProfileSettings points to profile

func (ProfileSettings) DisplayPath

func (v ProfileSettings) DisplayPath() string

type Ucm

type Ucm struct {
	Path          string            `yaml:"-"`
	Raw           []byte            `yaml:"-"`
	ActiveProfile string            `yaml:"active_profile"`
	Profiles      []ProfileSettings `yaml:"profiles"`
	Git           *ModuleSettings   `yaml:"git,omitempty"`
	Hosts         *HostsSettings    `yaml:"hosts,omitempty"`
	EnvVars       *ModuleSettings   `yaml:"environment_variables,omitempty"`
	NodeJs        *NodeJsSettings   `yaml:"nodejs,omitempty"`
}

Ucm holds configuration for what settings are required and what not.

func Read

func Read() (config Ucm, err error)

Jump to

Keyboard shortcuts

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