config

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2018 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EnableExperimental bool
)

Functions

func Encode added in v1.22.0

func Encode(w io.Writer, m ViperConfig) error

func IsHyperV added in v1.15.0

func IsHyperV() bool

func IsKVM added in v1.15.0

func IsKVM() bool

func IsPositive added in v1.5.0

func IsPositive(name string, val string) error

func IsSystemTrayAvailable added in v1.25.0

func IsSystemTrayAvailable(_ string, _ string) error

func IsValidCIDR added in v1.5.0

func IsValidCIDR(name string, cidr string) error

func IsValidDiskSize added in v1.5.0

func IsValidDiskSize(name string, diskSize string) error

func IsValidDriver added in v1.5.0

func IsValidDriver(string, driver string) error

func IsValidHypervVirtualSwitch added in v1.19.0

func IsValidHypervVirtualSwitch(name string, network string) error

func IsValidIPv4Address added in v1.7.0

func IsValidIPv4Address(name string, address string) error

func IsValidIPv4AddressSlice added in v1.15.0

func IsValidIPv4AddressSlice(name string, addressSlice string) error

func IsValidISOUrl added in v1.14.0

func IsValidISOUrl(_ string, isoURL string) error

func IsValidMemorySize added in v1.5.0

func IsValidMemorySize(name string, memorySize string) error

func IsValidNetmask added in v1.7.0

func IsValidNetmask(name string, mask string) error

func IsValidPath added in v1.5.0

func IsValidPath(name string, path string) error

func IsValidPort added in v1.15.0

func IsValidPort(name string, p string) error

func IsValidProxy added in v1.5.0

func IsValidProxy(name string, uri string) error

func IsValidTimezone added in v1.26.0

func IsValidTimezone(_ string, timezone string) error

func IsVirtualBox added in v1.15.0

func IsVirtualBox() bool

func IsXhyve added in v1.15.0

func IsXhyve() bool

func WriteViperConfig added in v1.22.0

func WriteViperConfig(configfile string, m ViperConfig) error

Writes a config to the $MINISHIFT_HOME/config/config.json file

Types

type GlobalConfigType

type GlobalConfigType struct {
	FilePath string `json:"-"`

	HostFolders   []config.HostFolderConfig
	ActiveProfile string
	SftpdPID      int
	ProxyPID      int
	SystrayPID    int
}
var AllInstancesConfig *GlobalConfigType

func NewAllInstancesConfig

func NewAllInstancesConfig(path string) (*GlobalConfigType, error)

Create new object with data if file exists or Create json file and return object if doesn't exists

func (*GlobalConfigType) Delete

func (cfg *GlobalConfigType) Delete() error

func (*GlobalConfigType) Write

func (cfg *GlobalConfigType) Write() error

type InstanceConfigType

type InstanceConfigType struct {
	FilePath    string   `json:"-"`
	CacheImages []string `json:"cache-images"`
	HostFolders []hostFolderConfig.HostFolderConfig
	AddonConfig map[string]*addOnConfig.AddOnConfig `json:"addons"`
}
var InstanceConfig *InstanceConfigType

func NewInstanceConfig

func NewInstanceConfig(path string) (*InstanceConfigType, error)

Create new object with data if file exists or Create json file and return object if doesn't exists

func (*InstanceConfigType) Delete

func (cfg *InstanceConfigType) Delete() error

func (*InstanceConfigType) Write

func (cfg *InstanceConfigType) Write() error

type InstanceStateConfigType added in v1.22.0

type InstanceStateConfigType struct {
	FilePath                  string                    `json:"-"`
	OcPath                    string                    // minishift state
	IsRegistered              bool                      // minishift state
	IsRHELBased               bool                      // minishift state
	SupportsNetworkAssignment bool                      // minishift state
	SupportsDnsmasqServer     bool                      // minishift state
	OpenshiftVersion          string                    // minishift state
	TimeZone                  string                    // minishift state
	HostFolders               []config.HostFolderConfig // This is temporary and should be removed after 2-3 release.

	VMDriver string // general config
}
var InstanceStateConfig *InstanceStateConfigType

func NewInstanceStateConfig added in v1.22.0

func NewInstanceStateConfig(path string) (*InstanceStateConfigType, error)

Create new object with data if file exists or Create json file and return object if doesn't exists

func (*InstanceStateConfigType) Delete added in v1.22.0

func (cfg *InstanceStateConfigType) Delete() error

func (*InstanceStateConfigType) Write added in v1.22.0

func (cfg *InstanceStateConfigType) Write() error

type ViperConfig added in v1.22.0

type ViperConfig map[string]interface{}

func Decode added in v1.22.0

func Decode(r io.Reader) (ViperConfig, error)

func ReadViperConfig added in v1.22.0

func ReadViperConfig(configfile string) (ViperConfig, error)

ReadConfig reads the config from $MINISHIFT_HOME/config/config.json file

Jump to

Keyboard shortcuts

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