common

package
v0.0.0-...-b79a0d8 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Common (and subpackages) contains interfaces that make it easier to avoid import cycles, swap out functionality for testing, etc.

In these packages, imports must be strictly limited.

Index

Constants

This section is empty.

Variables

View Source
var ENil = errors.New("Nil impl")

Functions

This section is empty.

Types

type Credentialer

type Credentialer interface {
	//set endpoint to use
	SetEP(ep string)
	//get credentials for unit with given id
	GetCredentials(ident string) Credentials
}

type Credentials

type Credentials struct {
	OS, BIOS, IPMI string
}

set of credentials for a given unit

type FS

type FS interface {
	Pather
	Mounter
	Formatter
	Fstaber
	SetOwnerAndPerms(uid, gid string)
}

type FileTransferer

type FileTransferer interface {
	Get() error
	GetWithRetry() error
	GetIntermediate() string
	UseIntermediateDir(dir string)
	Finalize() (err error)
}

type Formatter

type Formatter interface {
	Format(label string) error
}

type Fstaber

type Fstaber interface {
	WriteFstab(uid, gid string, parts ...FS)
	FstabEntry(uid, gid string) (entry string)
	FstabMountpoint() string
}

type Mounter

type Mounter interface {
	Mount()
	IsMounted() bool
	SetMountpoint(path string)
	Umount()
}

type Pather

type Pather interface {
	Path() string
}

type PatherMock

type PatherMock string

func (*PatherMock) Path

func (p *PatherMock) Path() string

type PlatConfiger

type PlatConfiger interface {
	BiosConfigTool() string
	IpmiConfigTool() string
}

type PlatInfoer

type PlatInfoer interface {
	SerNumer
	PlatNamer
	DiagPorts() []int
	MACPrefixes() [][]byte
	IsPrototype() bool
	WANIndex() int
	PlatConfiger
}

type PlatMock

type PlatMock struct {
	Diag         []int
	MPs          [][]byte
	Proto        bool
	Wan          int
	Ser          string
	BConf, IConf string
	CodeName     string
}

func (*PlatMock) BiosConfigTool

func (pm *PlatMock) BiosConfigTool() string

func (*PlatMock) DeviceCodeName

func (pm *PlatMock) DeviceCodeName() string

func (*PlatMock) DiagPorts

func (pm *PlatMock) DiagPorts() []int

func (*PlatMock) IpmiConfigTool

func (pm *PlatMock) IpmiConfigTool() string

func (*PlatMock) IsPrototype

func (pm *PlatMock) IsPrototype() bool

func (*PlatMock) MACPrefixes

func (pm *PlatMock) MACPrefixes() [][]byte

func (*PlatMock) SerNum

func (pm *PlatMock) SerNum() string

func (*PlatMock) WANIndex

func (pm *PlatMock) WANIndex() int

type PlatNamer

type PlatNamer interface {
	DeviceCodeName() string
}

type SerNumer

type SerNumer interface {
	SerNum() string
}

type StashData

type StashData interface {
	//endpoint that may be used by Credentialer
	CredEP() string
	//list of files needed by Stasher
	StashFileList() []TransferableVerifiableFile
}

Data needed for Stasher, that comes from mfgdata retrieved from server.

type TransferableVerifiableFile

type TransferableVerifiableFile interface {
	FileTransferer
	Verifyer
	Basename() string
	Mode(m os.FileMode)
}

type Unit

type Unit struct {
	Pri, Rec Pather
	Platform PlatInfoer
}

type Verifyer

type Verifyer interface {
	Verify() error
}

Directories

Path Synopsis
Interface for a mechanism storing data for use by factory restore
Interface for a mechanism storing data for use by factory restore
Some sort of external mechanism recording details about units imaged.
Some sort of external mechanism recording details about units imaged.
Interfaces related to setting up or mocking remote logging.
Interfaces related to setting up or mocking remote logging.
Abstraction for strings that implementors will likely wish to change.
Abstraction for strings that implementors will likely wish to change.

Jump to

Keyboard shortcuts

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