Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeConfiguration(data *vagrant_plugin_sdk.Args_ConfigData, i interface{}, args ...argmapper.Arg) (err error)
- func EncodeConfiguration(c interface{}, args ...argmapper.Arg) (*vagrant_plugin_sdk.Args_Hash, error)
- func EncodeVagrantfile(v *Vagrantfile, args ...argmapper.Arg) (*vagrant_plugin_sdk.Args_ConfigData, error)
- func ExistingPath(dir path.Path, filenames []string) (p path.Path, err error)
- func FindPath(start path.Path, filenames []string) (p path.Path, err error)
- func GetVagrantfileName() []string
- func RestoreConfiguration(s []byte, i interface{}) (err error)
- type CloudInit
- type Communicator
- type Disk
- type Network
- type Plugin
- type Provider
- type Provisioner
- type Range
- type SSH
- type SyncedFolder
- type Target
- type VM
- type Vagrant
- type Vagrantfile
- func DecodeVagrantfile(data *vagrant_plugin_sdk.Args_ConfigData, args ...argmapper.Arg) (v *Vagrantfile, err error)
- func LoadHCLVagrantfile(p path.Path) (*Vagrantfile, error)
- func LoadRubyVagrantfile(p path.Path, rubyRuntime parser) (*Vagrantfile, error)
- func LoadVagrantfile(content []byte, loc string, kind VagrantfileFormat) (*Vagrantfile, error)
- func RestoreVagrantfile(s []byte, args ...argmapper.Arg) (v *Vagrantfile, err error)
- type VagrantfileFormat
Constants ¶
const HCLFilename = "Vagrantfile.hcl"
HCLFilename is the default HCL based Vagrantfile name
const RubyFilename = "Vagrantfile"
RubyFilename is the default Ruby based Vagrantfile name
Variables ¶
var Mappers []*argmapper.Func
Functions ¶
func DecodeConfiguration ¶
func DecodeConfiguration( data *vagrant_plugin_sdk.Args_ConfigData, i interface{}, args ...argmapper.Arg, ) (err error)
func EncodeConfiguration ¶
func EncodeConfiguration( c interface{}, args ...argmapper.Arg, ) (*vagrant_plugin_sdk.Args_Hash, error)
Encode a piece of the configuration
func EncodeVagrantfile ¶
func EncodeVagrantfile( v *Vagrantfile, args ...argmapper.Arg, ) (*vagrant_plugin_sdk.Args_ConfigData, error)
Encode the Vagrantfile for storage
func ExistingPath ¶
Detect existing path within directory
func FindPath ¶
FindPath looks for our configuration file starting at "start" and traversing parent directories until it is found. If it is found, the path is returned. If it is not found, nil is returned. Error will be non-nil only if an error occurred.
If start is nil, start will be the current working directory. If filenames are nil, it will default to the value(s) from GetVagrantfileName().
func GetVagrantfileName ¶
func GetVagrantfileName() []string
Returns the valid file names for the Vagrantfile. If the VAGRANT_VAGRANTFILE environment variable is set, the slice will only contain that value.
func RestoreConfiguration ¶
Restore a piece of the confiugration
Types ¶
type Communicator ¶
type Communicator struct { Name string `hcl:"name,label"` Body hcl.Body `hcl:",body" json:"-"` Remain hcl.Body `hcl:",remain" json:"-"` }
type Disk ¶
type Disk struct { Name string `hcl:"name,label" json:"name"` DiskExt *string `hcl:"disk_ext,optional" json:",omitempty"` File *string `hcl:"file,optional" json:",omitempty"` Primary *bool `hcl:"primary,optional" json:",omitempty"` ProviderConfig map[string]string `hcl:"provider_config,optional" json:",omitempty"` Size *string `hcl:"size"` Body hcl.Body `hcl:",body" json:"-"` Remain hcl.Body `hcl:",remain" json:"-"` }
type Network ¶
type Network struct { Kind *string `hcl:"kind,label" json:"kind"` Body hcl.Body `hcl:",body" json:"-"` Remain hcl.Body `hcl:",remain" json:"-"` }
type Plugin ¶
type Plugin struct { Name string `hcl:"name,label" json:"name"` EntryPoint *string `hcl:"entry_point,optional" json:",omitempty"` Sources []string `hcl:"sources,optional" json:",omitempty"` Version *string `hcl:"version,optional" json:",omitempty"` Body hcl.Body `hcl:",body" json:"-"` Remain hcl.Body `hcl:",remain" json:"-"` }
type Provider ¶
type Provider struct { Name string `hcl:"name,label" json:"name"` Body hcl.Body `hcl:",body" json:"-"` Remain hcl.Body `hcl:",remain" json:"-"` }
type Provisioner ¶
type Provisioner struct { Kind string `hcl:"kind,label" json:"kind"` Body hcl.Body `hcl:",body" json:"-"` Remain hcl.Body `hcl:",remain" json:"-"` }
type SSH ¶
type SSH struct {
ConnectTimeout *int32 `hcl:"connect_timeout,optional" json:",omitempty"`
}
type SyncedFolder ¶
type SyncedFolder struct { Source string `hcl:"source,label" json:"source"` Destination string `hcl:"destination,label" json:"destination"` Disabled *bool `hcl:"disabled,optional" json:",omitempty"` Group *string `hcl:"group,optional" json:",omitempty"` ID *string `hcl:"id,optional" json:",omitempty"` MountOptions []string `hcl:"mount_options,optional" json:",omitempty"` Owner *string `hcl:"owner,optional" json:",omitempty"` Type *string `hcl:"type,optional" json:",omitempty"` Body hcl.Body `hcl:",body" json:"-"` Remain hcl.Body `hcl:",remain" json:"-"` }
type VM ¶
type VM struct { Name string `hcl:"name,label" json:"name"` AllowFstabModification *bool `hcl:"allow_fstab_modification,optional" json:",omitempty"` AllowHostsModification *bool `hcl:"allow_hosts_modification,optional" json:",omitempty"` AutoStart *bool `hcl:"autostart,optional" json:",omitempty"` BaseMAC *string `hcl:"base_mac,optional" json:",omitempty"` BootTimeout *int32 `hcl:"boot_timeout,optional" json:",omitempty"` Box *string `hcl:"box,optional" json:",omitempty"` BoxCheckUpdate *bool `hcl:"box_check_update,optional" json:",omitempty"` BoxDownloadChecksum *string `hcl:"box_download_checksum,optional" json:",omitempty"` BoxDownloadChecksumType *string `hcl:"box_download_checksum_type,optional" json:",omitempty"` BoxDownloadClientCert *string `hcl:"box_download_client_cert,optional" json:",omitempty"` BoxDownloadCACert *string `hcl:"box_download_ca_cert,optional" json:",omitempty"` BoxDownloadCAPath *string `hcl:"box_download_ca_path,optional" json:",omitempty"` BoxDownloadOptions map[string]string `hcl:"box_download_options,optional" json:",omitempty"` BoxDownloadInsecure *bool `hcl:"box_download_insecure,optional" json:",omitempty"` BoxDownloadLocationTrusted *bool `hcl:"box_download_location_trusted,optional" json:",omitempty"` BoxURL *string `hcl:"box_url,optional" json:",omitempty"` BoxVersion *string `hcl:"box_version,optional" json:",omitempty"` // CloudInit *CloudInit `hcl:"cloud_init,block" json:",omitempty"` Communicator *string `hcl:"communicator,optional" json:",omitempty"` // Disk *Disk `hcl:"disk,optional" json:",omitempty"` GracefulHaltTimeout *int32 `hcl:"graceful_halt_timeout,optional" json:",omitempty"` Guest *string `hcl:"guest,optional" json:",omitempty"` Hostname *string `hcl:"hostname,optional" json:",omitempty"` IgnoreBoxVagrantfile *bool `hcl:"ignore_box_vagrantfile,optional" json:",omitempty"` // Networks []*Network `hcl:"network,block" json:",omitempty"` PostUpMessage *string `hcl:"post_up_message,optional" json:",omitempty"` Primary *bool `hcl:"primary,optional" json:",omitempty"` }
type Vagrantfile ¶
type Vagrantfile struct { Communicators []*Communicator `hcl:"communicator,block" json:",omitempty"` DefinedVms []*VM `hcl:"define_vm,block" json:",omitempty"` SSH *SSH `hcl:"ssh,block" json:",omitempty"` Vagrant *Vagrant `hcl:"vagrant,block" json:",omitempty"` VM *VM `hcl:"vm,block" json:",omitempty"` DefinedVmKeys []string `json:",omitempty"` ListVMs []*VM `json:",omitempty"` Body hcl.Body `hcl:",body" json:"-"` Remain hcl.Body `hcl:",remain" json:"-"` }
func DecodeVagrantfile ¶
func DecodeVagrantfile( data *vagrant_plugin_sdk.Args_ConfigData, args ...argmapper.Arg, ) (v *Vagrantfile, err error)
Decode a proto encoded Vagrantfile
func LoadHCLVagrantfile ¶
func LoadHCLVagrantfile( p path.Path, ) (*Vagrantfile, error)
Load Vagrant configuration using an HCL based Vagrantfile
func LoadRubyVagrantfile ¶
func LoadRubyVagrantfile( p path.Path, rubyRuntime parser, ) (*Vagrantfile, error)
Load Vagrant configuration using a Ruby based Vagrantfile
func LoadVagrantfile ¶
func LoadVagrantfile( content []byte, loc string, kind VagrantfileFormat, ) (*Vagrantfile, error)
Load a Vagrantfile
func RestoreVagrantfile ¶
func RestoreVagrantfile( s []byte, args ...argmapper.Arg, ) (v *Vagrantfile, err error)
Restore an encoded Vagrantfile
type VagrantfileFormat ¶
type VagrantfileFormat uint8
const ( JSON VagrantfileFormat = iota HCL RUBY )