Documentation
¶
Index ¶
- Constants
- func DownloadFromGithub(name string, store Persist.Store) (string, error)
- func GetActions(macro Macro) []string
- func GetAliases(macro Macro) []string
- func GetContainerPath(volume Device) string
- func GetDescription(macro Macro) string
- func GetDevices(config Config) map[string]Device
- func GetDockerImage(config Config) string
- func GetEnvironmentVariables(config Config) map[string]string
- func GetFullContainerPath(volume Volume, context Utils.Context) (string, error)
- func GetFullHostPath(volume Volume, context Utils.Context) (string, error)
- func GetHostPath(volume Device) string
- func GetMacros(config Project) map[string]Macro
- func GetNetworkMode(config Config) string
- func GetOptions(bind Bind) string
- func GetPorts(config Config) []string
- func GetProjectName(config Config) string
- func GetSecurityOpts(config Config) []string
- func GetSyntaxVersion(config Config) string
- func GetUTSMode(config Config) string
- func GetUsage(macro Macro) string
- func GetUsageText(macro Macro) string
- func GetVolumeName(volume Volume) string
- func GetVolumes(config Config, context Utils.Context) map[string]Volume
- func GetWorkInProjectFolderAs(config Config) string
- func GetWorkingDir(config Config) string
- func IsCurrentUserEnabled(config Config) bool
- func IsDetached(config Config) bool
- func IsGUIEnabled(config Config) bool
- func IsNvidiaDevicesEnabled(config Config) bool
- func IsPrivileged(config Config) bool
- func ResolveDependencies(project Project, store Persist.Store, nutFilePath string) (err error)
- func SetParentProject(child Project, parent Project)
- func ToYAML(in interface{}) (out []byte, err error)
- func TruthyString(s string) (bool, bool)
- type BaseEnvironment
- type BaseEnvironmentBase
- type BaseEnvironmentV5
- type BaseEnvironmentV6
- type BaseEnvironmentV7
- type Bind
- type Config
- type ConfigBase
- type ConfigV5
- type ConfigV6
- type ConfigV7
- type Device
- type DeviceBase
- type DeviceV7
- type Macro
- type MacroBase
- type MacroV5
- type MacroV6
- type MacroV7
- type Project
- type ProjectBase
- type ProjectV5
- type ProjectV6
- type ProjectV7
- type Volume
- type VolumeBase
- type VolumeV5
- type VolumeV6
- type VolumeV7
Constants ¶
View Source
const NutFileName = "nut.yml"
View Source
const NutOverrideFileName = "nut.override.yml"
View Source
const NutProjectFolderKey = "NUT_PROJECT_FOLDER"
Variables ¶
This section is empty.
Functions ¶
func DownloadFromGithub ¶
/ Load project from given Github name / If not found on the file system, download it. / Returns the name of the file where / it has been saved from Github, and an error.
func GetActions ¶
func GetAliases ¶
func GetContainerPath ¶
func GetDescription ¶
func GetDevices ¶
func GetDockerImage ¶
func GetEnvironmentVariables ¶
func GetFullContainerPath ¶
func GetNetworkMode ¶
func GetOptions ¶
func GetProjectName ¶
func GetSecurityOpts ¶
func GetSyntaxVersion ¶
func GetUTSMode ¶
func GetUsageText ¶
func GetVolumeName ¶
func GetWorkingDir ¶
func IsCurrentUserEnabled ¶
func IsDetached ¶
func IsGUIEnabled ¶
func IsNvidiaDevicesEnabled ¶
func IsPrivileged ¶
func ResolveDependencies ¶
/ Resolve dependencies of the given project / (e.g. by loading other projects from files or downloading them / from Github)
func SetParentProject ¶
func TruthyString ¶
/ Returns the boolean value, and whether there is or not a value
Types ¶
type BaseEnvironment ¶
type BaseEnvironment interface {
// contains filtered or unexported methods
}
func GetBaseEnv ¶
func GetBaseEnv(config Config) BaseEnvironment
type BaseEnvironmentBase ¶
type BaseEnvironmentBase struct { }
type BaseEnvironmentV5 ¶
type BaseEnvironmentV5 struct { BaseEnvironmentBase `yaml:"inheritedValues,inline"` FilePath string `yaml:"nut_file_path,omitempty"` GitHub string `yaml:"github,omitempty"` DockerImage string `yaml:"docker_image,omitempty"` }
type BaseEnvironmentV6 ¶
type BaseEnvironmentV6 struct { BaseEnvironmentBase `yaml:"inheritedValues,inline"` FilePath string `yaml:"nut_file_path,omitempty"` GitHub string `yaml:"github,omitempty"` }
type BaseEnvironmentV7 ¶
type BaseEnvironmentV7 struct { BaseEnvironmentBase `yaml:"inheritedValues,inline"` FilePath string `yaml:"nut_file_path,omitempty"` GitHub string `yaml:"github,omitempty"` }
type ConfigBase ¶
type ConfigBase struct { }
type ConfigV5 ¶
type ConfigV5 struct { ConfigBase `yaml:"inheritedValues,inline"` Mount map[string][]string `yaml:"mount,omitempty"` WorkingDir string `yaml:"container_working_directory,omitempty"` EnvironmentVariables map[string]string `yaml:"environment,omitempty"` Ports []string `yaml:"ports,omitempty"` EnableGUI string `yaml:"enable_gui,omitempty"` EnableNvidiaDevices string `yaml:"enable_nvidia_devices,omitempty"` Privileged string `yaml:"privileged,omitempty"` SecurityOpts []string `yaml:"security_opts,omitempty"` // contains filtered or unexported fields }
func NewConfigV5 ¶
type ConfigV6 ¶
type ConfigV6 struct { ConfigBase `yaml:"inheritedValues,inline"` DockerImage string `yaml:"docker_image,omitempty"` Mount map[string][]string `yaml:"mount,omitempty"` WorkingDir string `yaml:"container_working_directory,omitempty"` EnvironmentVariables map[string]string `yaml:"environment,omitempty"` Ports []string `yaml:"ports,omitempty"` EnableGUI string `yaml:"enable_gui,omitempty"` EnableNvidiaDevices string `yaml:"enable_nvidia_devices,omitempty"` Privileged string `yaml:"privileged,omitempty"` SecurityOpts []string `yaml:"security_opts,omitempty"` // contains filtered or unexported fields }
func NewConfigV6 ¶
type ConfigV7 ¶
type ConfigV7 struct { ConfigBase `yaml:"inheritedValues,inline"` DockerImage string `yaml:"docker_image,omitempty"` Volumes map[string]*VolumeV7 `yaml:"volumes,omitempty"` WorkingDir string `yaml:"container_working_directory,omitempty"` EnvironmentVariables map[string]string `yaml:"environment,omitempty"` Ports []string `yaml:"ports,omitempty"` EnableGUI string `yaml:"enable_gui,omitempty"` EnableNvidiaDevices string `yaml:"enable_nvidia_devices,omitempty"` Privileged string `yaml:"privileged,omitempty"` SecurityOpts []string `yaml:"security_opts,omitempty"` Detached string `yaml:"detached,omitempty"` UTSMode string `yaml:"uts,omitempty"` NetworkMode string `yaml:"net,omitempty"` Devices map[string]*DeviceV7 `yaml:"devices,omitempty"` EnableCurrentUser string `yaml:"enable_current_user,omitempty"` WorkInProjectFolderAs string `yaml:"work_in_project_folder_as,omitempty"` // contains filtered or unexported fields }
func NewConfigV7 ¶
type DeviceBase ¶
type DeviceBase struct { }
type DeviceV7 ¶
type DeviceV7 struct { DeviceBase `yaml:"inheritedValues,inline"` Host string `yaml:"host_path"` Container string `yaml:"container_path"` Options string `yaml:"options,omitempty"` }
type MacroV5 ¶
type MacroV5 struct { // A short description of the usage of this macro Usage string `yaml:"usage,omitempty"` // The commands to execute when this macro is invoked Actions []string `yaml:"actions,omitempty"` // A list of aliases for the macro Aliases []string `yaml:"aliases,omitempty"` // Custom text to show on USAGE section of help UsageText string `yaml:"usage_for_help_section,omitempty"` // A longer explanation of how the macro works Description string `yaml:"description,omitempty"` MacroBase `yaml:"inheritedValues,inline"` ConfigV5 `yaml:"inheritedValues,inline"` }
type MacroV6 ¶
type MacroV6 struct { // A short description of the usage of this macro Usage string `yaml:"usage,omitempty"` // The commands to execute when this macro is invoked Actions []string `yaml:"actions,omitempty"` // A list of aliases for the macro Aliases []string `yaml:"aliases,omitempty"` // Custom text to show on USAGE section of help UsageText string `yaml:"usage_for_help_section,omitempty"` // A longer explanation of how the macro works Description string `yaml:"description,omitempty"` MacroBase `yaml:"inheritedValues,inline"` ConfigV6 `yaml:"inheritedValues,inline"` }
type MacroV7 ¶
type MacroV7 struct { // A short description of the usage of this macro Usage string `yaml:"usage,omitempty"` // The commands to execute when this macro is invoked Actions []string `yaml:"actions,omitempty"` // A list of aliases for the macro Aliases []string `yaml:"aliases,omitempty"` // Custom text to show on USAGE section of help UsageText string `yaml:"usage_for_help_section,omitempty"` // A longer explanation of how the macro works Description string `yaml:"description,omitempty"` MacroBase `yaml:"inheritedValues,inline"` ConfigV7 `yaml:"inheritedValues,inline"` }
type Project ¶
type Project interface {
// contains filtered or unexported methods
}
func FindProject ¶
/ Look for a file from which to parse configuration (nut.yml in current / directory). Parse the file, and returns an updated context (root directory) / TODO: look for nut.yml file in parent folders
func GetSyntaxes ¶
func GetSyntaxes() []Project
func LoadProjectFromFile ¶
/ Parse Project from file. Given filename must be absolute.
func ProjectFromYAML ¶
type ProjectBase ¶
type ProjectBase struct { }
type ProjectV5 ¶
type ProjectV5 struct { SyntaxVersion string `yaml:"syntax_version"` ProjectName string `yaml:"project_name"` Base BaseEnvironmentV5 `yaml:"based_on"` Macros map[string]*MacroV5 `yaml:"macros,omitempty"` ProjectBase `yaml:"inheritedValues,inline"` ConfigV5 `yaml:"inheritedValues,inline"` // contains filtered or unexported fields }
func NewProjectV5 ¶
type ProjectV6 ¶
type ProjectV6 struct { SyntaxVersion string `yaml:"syntax_version"` ProjectName string `yaml:"project_name"` Base BaseEnvironmentV6 `yaml:"based_on,omitempty"` Macros map[string]*MacroV6 `yaml:"macros,omitempty"` ProjectBase `yaml:"inheritedValues,inline"` ConfigV6 `yaml:"inheritedValues,inline"` // contains filtered or unexported fields }
func NewProjectV6 ¶
type ProjectV7 ¶
type ProjectV7 struct { SyntaxVersion string `yaml:"syntax_version"` ProjectName string `yaml:"project_name"` Base BaseEnvironmentV7 `yaml:"based_on,omitempty"` Macros map[string]*MacroV7 `yaml:"macros,omitempty"` ProjectBase `yaml:"inheritedValues,inline"` ConfigV7 `yaml:"inheritedValues,inline"` // contains filtered or unexported fields }
func NewProjectV7 ¶
type VolumeBase ¶
type VolumeBase struct { }
type VolumeV5 ¶
type VolumeV5 struct { VolumeBase `yaml:"inheritedValues,inline"` Host string `yaml:host_path` Container string `yaml:container_path` }
type VolumeV6 ¶
type VolumeV6 struct { VolumeBase `yaml:"inheritedValues,inline"` Host string `yaml:host_path` Container string `yaml:container_path` }
Click to show internal directories.
Click to hide internal directories.