eden

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFileIntoEServer

func AddFileIntoEServer(server *EServer, filePath, prefix string) (*api.FileInfo, error)

AddFileIntoEServer puts file into eserver prefix will be added to the file if defined

func CleanContext

func CleanContext(eveDist, certsDist, imagesDist, evePID, eveUUID, vmName string, configSaved string, remote bool) (err error)

CleanContext cleanup only context data

func CleanEden

func CleanEden(eveDist, adamDist, certsDist, imagesDist, eserverDist, redisDist, registryDist, configDir, evePID string, configSaved string, remote bool, devModel string, vmName string) (err error)

CleanEden teardown Eden and cleanup

func CloneFromGit

func CloneFromGit(dist string, gitRepo string, tag string) (err error)

CloneFromGit function clone from git into dist

func DeleteEVEParallels

func DeleteEVEParallels(vmName string) (err error)

DeleteEVEParallels function removes EVE from parallels

func DeleteEVEVBox

func DeleteEVEVBox(vmName string) (err error)

DeleteEVEVBox function removes EVE from VirtualBox

func GenerateEVEConfig

func GenerateEVEConfig(eveConfig string, domain string, ip string, port int, apiV1 bool, softserial string) (err error)

GenerateEVEConfig function copy certs to EVE config folder if ip is empty will not fill hosts file

func GenerateEveCerts

func GenerateEveCerts(certsDir, domain, ip, eveIP, uuid, devModel, ssid, password string, apiV1 bool) (err error)

GenerateEveCerts function generates certs for EVE

func MakeEveInRepo

func MakeEveInRepo(distEve string, configPath string, arch string, hv string, imageFormat string, rootFSOnly bool) (image, additional string, err error)

MakeEveInRepo build live image of EVE

func PutEveCerts

func PutEveCerts(certsDir, devModel, ssid, password string) (err error)

PutEveCerts function put certs for zedcontrol

func ReadFileInSquashFS

func ReadFileInSquashFS(squashFSPath, filePath string) (content []byte, err error)

ReadFileInSquashFS returns the content of a single file (filePath) inside squashfs (squashFSPath)

func SetLinkStateQemu

func SetLinkStateQemu(qemuMonitorPort int, ifName string, up bool) error

SetLinkStateQemu changes the link state of the given interface. If interface name is undefined, the function changes the link state of every uplink interface.

func SetLinkStateVbox

func SetLinkStateVbox(vmName, ifName string, up bool) error

SetLinkStateVbox changes the link state of the given interface. If interface name is undefined, the function changes the link state of every uplink interface.

func StartAdam

func StartAdam(adamPort int, adamPath string, adamForce bool, adamTag string, adamRemoteRedisURL string, apiV1 bool, opts ...string) (err error)

StartAdam function run adam in docker with mounted adamPath/run:/adam/run if adamForce is set, it recreates container

func StartEServer

func StartEServer(serverPort int, imageDist string, eserverForce bool, eserverTag string) (err error)

StartEServer function run eserver in docker if eserverForce is set, it recreates container

func StartEVEParallels

func StartEVEParallels(vmName, eveImageFile string, parallelsCpus int, parallelsMem int, hostFwd map[string]string) (err error)

StartEVEParallels function run EVE in parallels

func StartEVEQemu

func StartEVEQemu(qemuARCH, qemuOS, eveImageFile, qemuSMBIOSSerial string, eveTelnetPort, qemuMonitorPort int, qemuHostFwd map[string]string,
	qemuAccel bool, qemuConfigFile, logFile, pidFile string, tapInterface string, foregroud bool) (err error)

StartEVEQemu function run EVE in qemu

func StartEVEVBox

func StartEVEVBox(vmName, eveImageFile string, cpus int, mem int, hostFwd map[string]string) (err error)

StartEVEVBox function runs EVE in VirtualBox

func StartRedis

func StartRedis(redisPort int, redisPath string, redisForce bool, redisTag string) (err error)

StartRedis function run redis in docker with mounted redisPath:/data if redisForce is set, it recreates container

func StartRegistry

func StartRegistry(port int, tag, registryPath string, opts ...string) (err error)

StartRegistry function run registry in docker

func StatusAdam

func StatusAdam() (status string, err error)

StatusAdam function return status of adam

func StatusEServer

func StatusEServer() (status string, err error)

StatusEServer function return eserver of adam

func StatusEVEParallels

func StatusEVEParallels(vmName string) (status string, err error)

StatusEVEParallels function get status of EVE

func StatusEVEQemu

func StatusEVEQemu(pidFile string) (status string, err error)

StatusEVEQemu function get status of EVE

func StatusEVEVBox

func StatusEVEVBox(vmName string) (status string, err error)

StatusEVEVBox function get status of EVE

func StatusRedis

func StatusRedis() (status string, err error)

StatusRedis function return status of redis

func StatusRegistry

func StatusRegistry() (status string, err error)

StatusRegistry function return status of registry

func StopAdam

func StopAdam(adamRm bool) (err error)

StopAdam function stop adam container

func StopEServer

func StopEServer(eserverRm bool) (err error)

StopEServer function stop eserver container

func StopEVEParallels

func StopEVEParallels(vmName string) (err error)

StopEVEParallels function stop EVE and delete parallels VM

func StopEVEQemu

func StopEVEQemu(pidFile string) (err error)

StopEVEQemu function stop EVE

func StopEVEVBox

func StopEVEVBox(vmName string) (err error)

StopEVEVBox function stop EVE in VirtualBox

func StopEden

func StopEden(adamRm, redisRm, registryRm, eserverRm, eveRemote bool, evePidFile string, devModel string, vmName string)

StopEden teardown Eden

func StopRedis

func StopRedis(redisRm bool) (err error)

StopRedis function stop redis container

func StopRegistry

func StopRegistry(rm bool) (err error)

StopRegistry function stop registry container

Types

type EServer

type EServer struct {
	EServerIP   string
	EServerPort string
}

EServer for connection to eserver

func (*EServer) EServerAddFile

func (server *EServer) EServerAddFile(filepath, prefix string) (fileInfo *api.FileInfo)

EServerAddFile send file with image into eserver

func (*EServer) EServerAddFileURL

func (server *EServer) EServerAddFileURL(url string) (name string)

EServerAddFileURL send url to download image into eserver

func (*EServer) EServerCheckStatus

func (server *EServer) EServerCheckStatus(name string) (fileInfo *api.FileInfo)

EServerCheckStatus checks status of image in eserver

type EVEInfo

type EVEInfo struct {
	EVERelease []byte //EVERelease is /etc/eve-release from rootfs
	Syslog     []byte //Syslog is /rsyslog/syslog.txt from persist volume
}

EVEInfo contains info from SD card

func GetInfoFromSDCard

func GetInfoFromSDCard(devicePath string) (eveInfo *EVEInfo, err error)

GetInfoFromSDCard obtain info from SD card with EVE devicePath is /dev/sdX or /dev/diskX

type LinkState

type LinkState struct {
	InterfaceName string
	IsUP          bool
}

LinkState of an EVE uplink interface.

func GetLinkStateQemu

func GetLinkStateQemu(qemuMonitorPort int, ifName string) (linkStates []LinkState, err error)

GetLinkStateQemu returns the link state of the interface. If interface name is undefined, link state of all interfaces is returned.

func GetLinkStateVbox

func GetLinkStateVbox(vmName, ifName string) (linkStates []LinkState, err error)

GetLinkStateVbox returns the link state of the interface. If interface name is undefined, link state of all interfaces is returned.

Jump to

Keyboard shortcuts

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