models

package
v0.1.5-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OverwriteDevModelFromFile

func OverwriteDevModelFromFile(fileName string, model DevModel) error

OverwriteDevModelFromFile replace default config with config from provided file

Types

type DevModel

type DevModel interface {
	Adapters() []*config.SystemAdapter
	Networks() []*config.NetworkConfig
	PhysicalIOs() []*config.PhysicalIO
	SetPhysicalIOs([]*config.PhysicalIO)
	AdapterForSwitches() []string
	DevModelType() string
	SetWiFiParams(ssid string, psk string)
	GetPortConfig(ssid string, psk string) string
	DiskFormat() string
	DiskReadyMessage() string
	Config() map[string]interface{}
}

DevModel is an interface to use for describe device

func GetDevModel

func GetDevModel(devModelType devModelType) (DevModel, error)

GetDevModel return DevModel object by DevModelType

func GetDevModelByName

func GetDevModelByName(modelType string) (DevModel, error)

GetDevModelByName return DevModel object by DevModelType string

type DevModelGCP

type DevModelGCP struct {
	// contains filtered or unexported fields
}

DevModelGCP is dev model fields

func (*DevModelGCP) AdapterForSwitches

func (ctx *DevModelGCP) AdapterForSwitches() []string

AdapterForSwitches returns adapterForSwitches of devModel

func (*DevModelGCP) Adapters

func (ctx *DevModelGCP) Adapters() []*config.SystemAdapter

Adapters returns adapters of devModel

func (*DevModelGCP) Config

func (ctx *DevModelGCP) Config() map[string]interface{}

Config returns map with config overwrites

func (*DevModelGCP) DevModelType

func (ctx *DevModelGCP) DevModelType() string

DevModelType returns devModelType of devModel

func (*DevModelGCP) DiskFormat

func (ctx *DevModelGCP) DiskFormat() string

DiskFormat to use for build image

func (*DevModelGCP) DiskReadyMessage

func (ctx *DevModelGCP) DiskReadyMessage() string

DiskReadyMessage to show when image is ready

func (*DevModelGCP) GetPortConfig

func (ctx *DevModelGCP) GetPortConfig(_ string, _ string) string

GetPortConfig returns PortConfig overwrite

func (*DevModelGCP) Networks

func (ctx *DevModelGCP) Networks() []*config.NetworkConfig

Networks returns networks of devModel

func (*DevModelGCP) PhysicalIOs

func (ctx *DevModelGCP) PhysicalIOs() []*config.PhysicalIO

PhysicalIOs returns physicalIOs of devModel

func (*DevModelGCP) SetPhysicalIOs

func (ctx *DevModelGCP) SetPhysicalIOs(physicalIOs []*config.PhysicalIO)

SetPhysicalIOs sets physicalIOs of devModel

func (*DevModelGCP) SetWiFiParams

func (ctx *DevModelGCP) SetWiFiParams(_ string, _ string)

SetWiFiParams not implemented for Qemu

type DevModelGeneral

type DevModelGeneral struct {
	// contains filtered or unexported fields
}

DevModelGeneral is dev model fields

func (*DevModelGeneral) AdapterForSwitches

func (ctx *DevModelGeneral) AdapterForSwitches() []string

AdapterForSwitches returns adapterForSwitches of devModel

func (*DevModelGeneral) Adapters

func (ctx *DevModelGeneral) Adapters() []*config.SystemAdapter

Adapters returns adapters of devModel

func (*DevModelGeneral) Config

func (ctx *DevModelGeneral) Config() map[string]interface{}

Config returns map with config overwrites

func (*DevModelGeneral) DevModelType

func (ctx *DevModelGeneral) DevModelType() string

DevModelType returns devModelType of devModel

func (*DevModelGeneral) DiskFormat

func (ctx *DevModelGeneral) DiskFormat() string

DiskFormat to use for build image

func (*DevModelGeneral) DiskReadyMessage

func (ctx *DevModelGeneral) DiskReadyMessage() string

DiskReadyMessage to show when image is ready

func (*DevModelGeneral) GetPortConfig

func (ctx *DevModelGeneral) GetPortConfig(_ string, _ string) string

GetPortConfig returns PortConfig overwrite

func (*DevModelGeneral) Networks

func (ctx *DevModelGeneral) Networks() []*config.NetworkConfig

Networks returns networks of devModel

func (*DevModelGeneral) PhysicalIOs

func (ctx *DevModelGeneral) PhysicalIOs() []*config.PhysicalIO

PhysicalIOs returns physicalIOs of devModel

func (*DevModelGeneral) SetPhysicalIOs

func (ctx *DevModelGeneral) SetPhysicalIOs(physicalIOs []*config.PhysicalIO)

SetPhysicalIOs sets physicalIOs of devModel

func (*DevModelGeneral) SetWiFiParams

func (ctx *DevModelGeneral) SetWiFiParams(_ string, _ string)

SetWiFiParams not implemented for Qemu

type DevModelParallels

type DevModelParallels struct {
	// contains filtered or unexported fields
}

DevModelParallels is dev model fields

func (*DevModelParallels) AdapterForSwitches

func (ctx *DevModelParallels) AdapterForSwitches() []string

AdapterForSwitches returns adapterForSwitches of devModel

func (*DevModelParallels) Adapters

func (ctx *DevModelParallels) Adapters() []*config.SystemAdapter

Adapters returns adapters of devModel

func (*DevModelParallels) Config

func (ctx *DevModelParallels) Config() map[string]interface{}

Config returns map with config overwrites

func (*DevModelParallels) DevModelType

func (ctx *DevModelParallels) DevModelType() string

DevModelType returns devModelType of devModel

func (*DevModelParallels) DiskFormat

func (ctx *DevModelParallels) DiskFormat() string

DiskFormat to use for build image

func (*DevModelParallels) DiskReadyMessage

func (ctx *DevModelParallels) DiskReadyMessage() string

DiskReadyMessage ready message

func (*DevModelParallels) GetPortConfig

func (ctx *DevModelParallels) GetPortConfig(_ string, _ string) string

GetPortConfig not implemented for parallels

func (*DevModelParallels) Networks

func (ctx *DevModelParallels) Networks() []*config.NetworkConfig

Networks returns networks of devModel

func (*DevModelParallels) PhysicalIOs

func (ctx *DevModelParallels) PhysicalIOs() []*config.PhysicalIO

PhysicalIOs returns physicalIOs of devModel

func (*DevModelParallels) SetPhysicalIOs

func (ctx *DevModelParallels) SetPhysicalIOs(physicalIOs []*config.PhysicalIO)

SetPhysicalIOs sets physicalIOs of devModel

func (*DevModelParallels) SetWiFiParams

func (ctx *DevModelParallels) SetWiFiParams(_ string, _ string)

SetWiFiParams not implemented for parallels

type DevModelQemu

type DevModelQemu struct {
	// contains filtered or unexported fields
}

DevModelQemu is dev model fields

func (*DevModelQemu) AdapterForSwitches

func (ctx *DevModelQemu) AdapterForSwitches() []string

AdapterForSwitches returns adapterForSwitches of devModel

func (*DevModelQemu) Adapters

func (ctx *DevModelQemu) Adapters() []*config.SystemAdapter

Adapters returns adapters of devModel

func (*DevModelQemu) Config

func (ctx *DevModelQemu) Config() map[string]interface{}

Config returns map with config overwrites

func (*DevModelQemu) DevModelType

func (ctx *DevModelQemu) DevModelType() string

DevModelType returns devModelType of devModel

func (*DevModelQemu) DiskFormat

func (ctx *DevModelQemu) DiskFormat() string

DiskFormat to use for build image

func (*DevModelQemu) DiskReadyMessage

func (ctx *DevModelQemu) DiskReadyMessage() string

DiskReadyMessage to show when image is ready

func (*DevModelQemu) GetPortConfig

func (ctx *DevModelQemu) GetPortConfig(_ string, _ string) string

GetPortConfig returns PortConfig overwrite

func (*DevModelQemu) Networks

func (ctx *DevModelQemu) Networks() []*config.NetworkConfig

Networks returns networks of devModel

func (*DevModelQemu) PhysicalIOs

func (ctx *DevModelQemu) PhysicalIOs() []*config.PhysicalIO

PhysicalIOs returns physicalIOs of devModel

func (*DevModelQemu) SetPhysicalIOs

func (ctx *DevModelQemu) SetPhysicalIOs(physicalIOs []*config.PhysicalIO)

SetPhysicalIOs sets physicalIOs of devModel

func (*DevModelQemu) SetWiFiParams

func (ctx *DevModelQemu) SetWiFiParams(_ string, _ string)

SetWiFiParams not implemented for Qemu

type DevModelRpi

type DevModelRpi struct {
	// contains filtered or unexported fields
}

DevModelRpi is dev model fields

func (*DevModelRpi) AdapterForSwitches

func (ctx *DevModelRpi) AdapterForSwitches() []string

AdapterForSwitches returns adapterForSwitches of devModel

func (*DevModelRpi) Adapters

func (ctx *DevModelRpi) Adapters() []*config.SystemAdapter

Adapters returns adapters of devModel

func (*DevModelRpi) Config

func (ctx *DevModelRpi) Config() map[string]interface{}

Config returns map with config overwrites

func (*DevModelRpi) DevModelType

func (ctx *DevModelRpi) DevModelType() string

DevModelType returns devModelType of devModel

func (*DevModelRpi) DiskFormat

func (ctx *DevModelRpi) DiskFormat() string

DiskFormat to use for build image

func (*DevModelRpi) DiskReadyMessage

func (ctx *DevModelRpi) DiskReadyMessage() string

DiskReadyMessage to show when image is ready

func (*DevModelRpi) GetPortConfig

func (ctx *DevModelRpi) GetPortConfig(ssid string, psk string) string

GetPortConfig returns PortConfig overwrite

func (*DevModelRpi) Networks

func (ctx *DevModelRpi) Networks() []*config.NetworkConfig

Networks returns networks of devModel

func (*DevModelRpi) PhysicalIOs

func (ctx *DevModelRpi) PhysicalIOs() []*config.PhysicalIO

PhysicalIOs returns physicalIOs of devModel

func (*DevModelRpi) SetPhysicalIOs

func (ctx *DevModelRpi) SetPhysicalIOs(physicalIOs []*config.PhysicalIO)

SetPhysicalIOs sets physicalIOs of devModel

func (*DevModelRpi) SetWiFiParams

func (ctx *DevModelRpi) SetWiFiParams(ssid string, psk string)

SetWiFiParams set ssid and psk for RPI

type DevModelVBox

type DevModelVBox struct {
	// contains filtered or unexported fields
}

DevModelVBox is dev model fields

func (*DevModelVBox) AdapterForSwitches

func (ctx *DevModelVBox) AdapterForSwitches() []string

AdapterForSwitches returns adapterForSwitches of DevModelVBox

func (*DevModelVBox) Adapters

func (ctx *DevModelVBox) Adapters() []*config.SystemAdapter

Adapters returns adapters of DevModelVBox

func (*DevModelVBox) Config

func (ctx *DevModelVBox) Config() map[string]interface{}

Config returns map with config overwrites

func (*DevModelVBox) DevModelType

func (ctx *DevModelVBox) DevModelType() string

DevModelType returns devModelType of DevModelVBox

func (*DevModelVBox) DiskFormat

func (ctx *DevModelVBox) DiskFormat() string

DiskFormat to use for build image

func (*DevModelVBox) DiskReadyMessage

func (ctx *DevModelVBox) DiskReadyMessage() string

DiskReadyMessage to show when image is ready

func (*DevModelVBox) GetPortConfig

func (ctx *DevModelVBox) GetPortConfig(_ string, _ string) string

GetPortConfig returns PortConfig overwrite

func (*DevModelVBox) Networks

func (ctx *DevModelVBox) Networks() []*config.NetworkConfig

Networks returns networks of DevModelVBox

func (*DevModelVBox) PhysicalIOs

func (ctx *DevModelVBox) PhysicalIOs() []*config.PhysicalIO

PhysicalIOs returns physicalIOs of DevModelVBox

func (*DevModelVBox) SetPhysicalIOs

func (ctx *DevModelVBox) SetPhysicalIOs(physicalIOs []*config.PhysicalIO)

SetPhysicalIOs sets physicalIOs of devModel

func (*DevModelVBox) SetWiFiParams

func (ctx *DevModelVBox) SetWiFiParams(_ string, _ string)

SetWiFiParams not implemented for VBox

type ModelFile

type ModelFile struct {
	IOMemberList []*PhysicalIO `json:"ioMemberList,omitempty"`
}

ModelFile for loading model from file

type PhysicalIO

type PhysicalIO struct {
	Ztype        evecommon.PhyIoType        `json:"ztype,omitempty"`
	Phylabel     string                     `json:"phylabel,omitempty"`
	Phyaddrs     map[string]string          `json:"phyaddrs,omitempty"`
	Logicallabel string                     `json:"logicallabel,omitempty"`
	Assigngrp    string                     `json:"assigngrp,omitempty"`
	Usage        evecommon.PhyIoMemberUsage `json:"usage,omitempty"`
	UsagePolicy  *config.PhyIOUsagePolicy   `json:"usagePolicy,omitempty"`
	Cbattr       map[string]string          `json:"cbattr,omitempty"`
}

PhysicalIO type for translation models into format of EVE`s config.PhysicalIO

Jump to

Keyboard shortcuts

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