Documentation
¶
Index ¶
- Variables
- func BuildCommand() *cobra.Command
- func ComposeCommands() *cobra.Command
- func ConvertJSONToConfig(data []byte, c *types.Config) (err error)
- func DeleteCommand() *cobra.Command
- func DeployCommand() *cobra.Command
- func EnvCommand() *cobra.Command
- func ExtractFromDockerImage(imageName string, packageName string, parch string, targetExecutable string, ...) (string, string)
- func GetRootCommand() *cobra.Command
- func ImageCommands() *cobra.Command
- func ImageNameToPackageNameAndVersion(imageName string) (string, string, error)
- func InstanceCommands() *cobra.Command
- func LoadCommand() *cobra.Command
- func MovePackageFiles(origin string, target string) string
- func NetworkCommands() *cobra.Command
- func PackageCommands() *cobra.Command
- func PersistBuildImageCommandFlags(cmdFlags *pflag.FlagSet)
- func PersistConfigCommandFlags(cmdFlags *pflag.FlagSet)
- func PersistCreateInstanceFlags(cmdFlags *pflag.FlagSet)
- func PersistDeleteInstanceFlags(cmdFlags *pflag.FlagSet)
- func PersistGlobalCommandFlags(cmdFlags *pflag.FlagSet)
- func PersistNanosVersionCommandFlags(cmdFlags *pflag.FlagSet)
- func PersistNightlyCommandFlags(cmdFlags *pflag.FlagSet)
- func PersistPkgCommandFlags(cmdFlags *pflag.FlagSet)
- func PersistProviderCommandFlags(cmdFlags *pflag.FlagSet)
- func PersistRunLocalInstanceCommandFlags(cmdFlags *pflag.FlagSet)
- func PrepareNetworkPorts(ports []string) (portsPrepared []string, err error)
- func ProfileCommand() *cobra.Command
- func RunCommand() *cobra.Command
- func RunLocalInstance(c *types.Config) (err error)
- func SubtractTimeNotation(date time.Time, notation string) (newDate time.Time, err error)
- func UpdateCommand() *cobra.Command
- func ValidateNetworkPorts(ports []string) error
- func VersionCommand() *cobra.Command
- func VolumeCommands() *cobra.Command
- type BuildImageCommandFlags
- type Compose
- type ComposeFile
- type ComposePackage
- type ConfigCommandFlags
- type CreateInstanceFlags
- type DeleteInstanceFlags
- type GlobalCommandFlags
- type MergeConfigContainer
- type MergeConfigFlags
- type NanosVersionCommandFlags
- type Network
- type NightlyCommandFlags
- type PkgCommandFlags
- type Profile
- type ProviderCommandFlags
- type RunLocalInstanceCommandFlags
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidFileConfig is used when some error occurred on reading the configuration file. The message also provides instructions to search for how to set up configuration. ErrInvalidFileConfig = func(err error) error { return fmt.Errorf("failed converting configuration file: %v\nSee more details at https://nanovms.gitbook.io/ops/configuration", err) } )
Functions ¶
func BuildCommand ¶
BuildCommand helps you to build image from ELF
func ComposeCommands ¶
ComposeCommands provides support for running binary with nanos
func ConvertJSONToConfig ¶
ConvertJSONToConfig converts a byte array to an object of type configuration
func DeleteCommand ¶
DeleteCommand helps you to run application with package
func DeployCommand ¶
DeployCommand builds image and deploy an instance
func ExtractFromDockerImage ¶
func ExtractFromDockerImage(imageName string, packageName string, parch string, targetExecutable string, quiet bool, verbose bool, copyWholeFS bool, args []string) (string, string)
ExtractFromDockerImage creates a package by extracting an executable and its shared libraries
func GetRootCommand ¶
GetRootCommand provides set all commands for Ops
func ImageCommands ¶
ImageCommands provides image related command on GCP
func ImageNameToPackageNameAndVersion ¶
ImageNameToPackageNameAndVersion converts a Docker image name to a package name and version
func InstanceCommands ¶
InstanceCommands provides instance related commands
func LoadCommand ¶
LoadCommand helps you to run application with package
func MovePackageFiles ¶
MovePackageFiles moves a package from a directory to another
func NetworkCommands ¶
NetworkCommands have the capability of creating/destroying networks. linux only for now - mac uses vmnet-bridged.
func PackageCommands ¶
PackageCommands gives package related commands
func PersistBuildImageCommandFlags ¶
PersistBuildImageCommandFlags append a command the required flags to run an image
func PersistConfigCommandFlags ¶
PersistConfigCommandFlags append a command the required flags to run an image
func PersistCreateInstanceFlags ¶
PersistCreateInstanceFlags specify create instance flags in command
func PersistDeleteInstanceFlags ¶
PersistDeleteInstanceFlags specify delete instance flags in command
func PersistGlobalCommandFlags ¶
PersistGlobalCommandFlags append the global flags to a command
func PersistNanosVersionCommandFlags ¶
PersistNanosVersionCommandFlags append nanos version flag to a command
func PersistNightlyCommandFlags ¶
PersistNightlyCommandFlags append nightly flag to a command
func PersistPkgCommandFlags ¶
PersistPkgCommandFlags append a command the required flags to use a package
func PersistProviderCommandFlags ¶
PersistProviderCommandFlags append a command the required flags to run an image
func PersistRunLocalInstanceCommandFlags ¶
PersistRunLocalInstanceCommandFlags append a command the required flags to run an image
func PrepareNetworkPorts ¶
PrepareNetworkPorts validates ports and split ports strings separated by commas
func ProfileCommand ¶
ProfileCommand provides a profile command
func RunCommand ¶
RunCommand provides support for running binary with nanos
func RunLocalInstance ¶
RunLocalInstance runs a virtual machine in a hypervisor
func SubtractTimeNotation ¶
SubtractTimeNotation subtracts time notation timestamp from date passed by argument
func UpdateCommand ¶
UpdateCommand provides update related commands
func ValidateNetworkPorts ¶
ValidateNetworkPorts verifies ports strings have right format Strings must have only numbers, commas or hyphens. Commas and hypens must separate 2 numbers
func VolumeCommands ¶
VolumeCommands handles volumes related operations
Types ¶
type BuildImageCommandFlags ¶
type BuildImageCommandFlags struct { Type string CmdArgs []string DisableArgsCopy bool CmdEnvs []string ImageName string TFSv4 bool Mounts []string TargetRoot string IPAddress string IPv6Address string Netmask string Gateway string NetConsolePort string NetConsoleIP string Consoles []string }
BuildImageCommandFlags consolidates all command flags required to build an image in one struct
func NewBuildImageCommandFlags ¶
func NewBuildImageCommandFlags(cmdFlags *pflag.FlagSet) (flags *BuildImageCommandFlags)
NewBuildImageCommandFlags returns an instance of BuildImageCommandFlags initialized with command flags values
func (*BuildImageCommandFlags) MergeToConfig ¶
func (flags *BuildImageCommandFlags) MergeToConfig(c *types.Config) (err error)
MergeToConfig overrides configuration passed by argument with command flags values
type Compose ¶
type Compose struct {
// contains filtered or unexported fields
}
Compose holds information related to a compose session.
(eg: starts a dns server for svc discovery && associated unikernels in same network; each unikernel gets an address of name.service)
ops compose up
experimental and objective should be to *not* interfere with existing 'ops run', 'ops pkg load', 'ops instance create' functionality
run first:
ops pkg get eyberg/ops-dns:0.0.1
compose.yaml:
packages:
- pkg: myserver name: mynewserver:0.0.1
- pkg: myclient name: mynewclient:0.0.1
much of this probably belongs in a diff. pkg but not sure what to do there yet
type ComposeFile ¶
type ComposeFile struct {
Packages []ComposePackage
}
ComposeFile represents a configuration for ops compose.
type ComposePackage ¶
type ComposePackage struct { Pkg string Name string Local bool Arch string BaseVolumeSz string `yaml:"base_volume_sz"` }
ComposePackage is a part of the compose yaml file.
type ConfigCommandFlags ¶
type ConfigCommandFlags struct {
Config string
}
ConfigCommandFlags handles config file path flag and build configuration from the file
func NewConfigCommandFlags ¶
func NewConfigCommandFlags(cmdFlags *pflag.FlagSet) (flags *ConfigCommandFlags)
NewConfigCommandFlags returns an instance of ConfigCommandFlags
func (*ConfigCommandFlags) MergeToConfig ¶
func (flags *ConfigCommandFlags) MergeToConfig(c *types.Config) (err error)
MergeToConfig reads a json configuration file
type CreateInstanceFlags ¶
type CreateInstanceFlags struct { DomainName string Flavor string Ports []string UDPPorts []string }
CreateInstanceFlags consolidates flags used to create an instance
func NewCreateInstanceCommandFlags ¶
func NewCreateInstanceCommandFlags(cmdFlags *pflag.FlagSet) (flags *CreateInstanceFlags)
NewCreateInstanceCommandFlags returns an instance of CreateInstanceFlags
func (*CreateInstanceFlags) MergeToConfig ¶
func (f *CreateInstanceFlags) MergeToConfig(config *types.Config) (err error)
MergeToConfig append command flags that are used to create an instance
type DeleteInstanceFlags ¶
type DeleteInstanceFlags struct {
DomainName string
}
DeleteInstanceFlags consolidates flags used for delete an instance
func NewDeleteInstanceCommandFlags ¶
func NewDeleteInstanceCommandFlags(cmdFlags *pflag.FlagSet) (flags *DeleteInstanceFlags)
NewDeleteInstanceCommandFlags returns an instance of DeleteInstanceFlags
func (*DeleteInstanceFlags) MergeToConfig ¶
func (f *DeleteInstanceFlags) MergeToConfig(config *types.Config) (err error)
MergeToConfig append command flags that are used to delete an instance
type GlobalCommandFlags ¶
GlobalCommandFlags are flags accepted by every command
func NewGlobalCommandFlags ¶
func NewGlobalCommandFlags(cmdFlags *pflag.FlagSet) (flags *GlobalCommandFlags)
NewGlobalCommandFlags returns an instance of GlobalCommandFlags
func (*GlobalCommandFlags) MergeToConfig ¶
func (flags *GlobalCommandFlags) MergeToConfig(config *types.Config) (err error)
MergeToConfig append command flags that are used transversally for all commands to configuration
type MergeConfigContainer ¶
type MergeConfigContainer struct {
// contains filtered or unexported fields
}
MergeConfigContainer is responsible for merge a list of flags attributes to ops configuration
func NewMergeConfigContainer ¶
func NewMergeConfigContainer(flags ...MergeConfigFlags) *MergeConfigContainer
NewMergeConfigContainer returns an instance of MergeConfigContainer Flags order matters.
type MergeConfigFlags ¶
MergeConfigFlags are flags structures able to override ops configuration attributes
type NanosVersionCommandFlags ¶
type NanosVersionCommandFlags struct {
NanosVersion string
}
NanosVersionCommandFlags is used to change configuration to use nanos version build tools paths
func NewNanosVersionCommandFlags ¶
func NewNanosVersionCommandFlags(cmdFlags *pflag.FlagSet) (flags *NanosVersionCommandFlags)
NewNanosVersionCommandFlags returns an instance of NanosVersionCommandFlags
func (*NanosVersionCommandFlags) MergeToConfig ¶
func (flags *NanosVersionCommandFlags) MergeToConfig(config *types.Config) (err error)
MergeToConfig downloads specified nanos version build and change configuration nanos tools paths
type NightlyCommandFlags ¶
NightlyCommandFlags is used to change configuration to use nightly build tools paths
func NewNightlyCommandFlags ¶
func NewNightlyCommandFlags(cmdFlags *pflag.FlagSet) (flags *NightlyCommandFlags)
NewNightlyCommandFlags returns an instance of NightlyCommandFlags
func (*NightlyCommandFlags) MergeToConfig ¶
func (flags *NightlyCommandFlags) MergeToConfig(config *types.Config) (err error)
MergeToConfig downloads nightly build and change configuration nanos tools paths
type PkgCommandFlags ¶
PkgCommandFlags consolidates all command flags required to use a provider
func NewPkgCommandFlags ¶
func NewPkgCommandFlags(cmdFlags *pflag.FlagSet) (flags *PkgCommandFlags)
NewPkgCommandFlags returns an instance of PkgCommandFlags
func (*PkgCommandFlags) MergeToConfig ¶
func (flags *PkgCommandFlags) MergeToConfig(c *types.Config) (err error)
MergeToConfig merge package configuration to ops configuration
func (*PkgCommandFlags) PackagePath ¶
func (flags *PkgCommandFlags) PackagePath() string
PackagePath returns the package path in file system
func (*PkgCommandFlags) Parch ¶
func (flags *PkgCommandFlags) Parch() string
Parch returns the user's preferred architecture which can ovveride the machine's architecture with the --arch flag.
type Profile ¶
type Profile struct { OpsVersion string NanosVersion string QemuVersion string OS string Arch string Hypervisor bool }
Profile holds a particular host's configuration that is used to troubleshoot different environments. This is separate and different from a runtime cache.
type ProviderCommandFlags ¶
ProviderCommandFlags consolidates all command flags required to use a provider
func NewProviderCommandFlags ¶
func NewProviderCommandFlags(cmdFlags *pflag.FlagSet) (flags *ProviderCommandFlags)
NewProviderCommandFlags returns an instance of ProviderCommandFlags
func (*ProviderCommandFlags) MergeToConfig ¶
func (flags *ProviderCommandFlags) MergeToConfig(c *types.Config) (err error)
MergeToConfig merge provider flags to configuration
type RunLocalInstanceCommandFlags ¶
type RunLocalInstanceCommandFlags struct { Accel bool Bridged bool BridgeName string BridgeIPAddress string Debug bool Force bool GDBPort int MissingFiles bool NoTrace []string Ports []string UDPPorts []string SkipBuild bool Memory string Smp int SyscallSummary bool TapName string Trace bool Verbose bool Arch string }
RunLocalInstanceCommandFlags consolidates all command flags required to run a local instance in one struct
func NewRunLocalInstanceCommandFlags ¶
func NewRunLocalInstanceCommandFlags(cmdFlags *pflag.FlagSet) (flags *RunLocalInstanceCommandFlags)
NewRunLocalInstanceCommandFlags returns an instance of RunLocalInstanceCommandFlags initialized with command flags values
func (*RunLocalInstanceCommandFlags) MergeToConfig ¶
func (flags *RunLocalInstanceCommandFlags) MergeToConfig(c *types.Config) error
MergeToConfig overrides configuration passed by argument with command flags values
Source Files
¶
- action_confirmation.go
- cmd_build.go
- cmd_compose.go
- cmd_deploy.go
- cmd_env.go
- cmd_image.go
- cmd_instance.go
- cmd_network.go
- cmd_pkg.go
- cmd_profile.go
- cmd_root.go
- cmd_run.go
- cmd_update.go
- cmd_version.go
- cmd_volume.go
- compose.go
- download_package.go
- error.go
- extract_from_docker.go
- flags.go
- flags_build_image.go
- flags_config.go
- flags_create_instance.go
- flags_global.go
- flags_nanos_version.go
- flags_nightly.go
- flags_pkg.go
- flags_provider.go
- flags_run_local_instance.go
- network_ports.go
- print_json.go
- program.go
- provider.go
- run_local_instance.go
- subtract_date_notation.go