build

package
Version: v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ImagenetVNI uint32 = 3
	StornetVNI         = 4
)

Variables

This section is empty.

Functions

func PrintMaterials

func PrintMaterials(
	tw *tabwriter.Writer,
	lom LOM,
	parentQuantity int,
	depth int,
)

func Run

func Run(fa *xir.Facility)

Types

type AllocMod

type AllocMod struct {
	Value xir.AllocMode
}

func (*AllocMod) Modify

func (m *AllocMod) Modify(x interface{})

type AllocModeMod

type AllocModeMod struct {
	Modes []xir.AllocMode
}

func AllocModes

func AllocModes(modes ...xir.AllocMode) AllocModeMod

func (AllocModeMod) Modify

func (a AllocModeMod) Modify(x interface{})

type BreakoutConnectorMod

type BreakoutConnectorMod struct {
	Single xir.ConnectorKind
	Multi  xir.ConnectorKind
}

func (*BreakoutConnectorMod) Modify

func (m *BreakoutConnectorMod) Modify(x interface{})

type Builder

type Builder struct {
	Id            string
	FQDN          string
	InfraUnderlay Underlay
	XpUnderlay    Underlay
	Resources     []*xir.Resource
	Cables        []*xir.Cable
}

func NewBuilder

func NewBuilder(id, fqdn string, infra, xp Underlay) (*Builder, error)

func (*Builder) Breakout

func (tb *Builder) Breakout(
	single *xir.Port, multi []*xir.Port, mods ...Modifier) *xir.Cable

func (*Builder) Connect

func (tb *Builder) Connect(a, b *xir.Port, mods ...Modifier) *xir.Cable

func (*Builder) Facility

func (b *Builder) Facility() *xir.Facility

func (*Builder) Gateway

func (b *Builder) Gateway(id string, mods ...Modifier) *xir.Resource

func (*Builder) Gateways

func (b *Builder) Gateways(
	count int, idprefix string, mods ...Modifier) []*xir.Resource

func (*Builder) InfraLeaf

func (b *Builder) InfraLeaf(id string, mods ...Modifier) *xir.Resource

func (*Builder) InfraLeaves

func (b *Builder) InfraLeaves(
	count int, idprefix string, mods ...Modifier) []*xir.Resource

func (*Builder) InfraSpine

func (b *Builder) InfraSpine(id string, mods ...Modifier) *xir.Resource

func (*Builder) InfraSpines

func (b *Builder) InfraSpines(
	count int, idprefix string, mods ...Modifier) []*xir.Resource

func (*Builder) InfraStem

func (b *Builder) InfraStem(id string, mods ...Modifier) *xir.Resource

func (*Builder) InfraStems

func (b *Builder) InfraStems(
	count int, idprefix string, mods ...Modifier) []*xir.Resource

func (*Builder) Infraserver

func (b *Builder) Infraserver(id string, mods ...Modifier) *xir.Resource

func (*Builder) Infraservers

func (b *Builder) Infraservers(
	count int, idprefix string, mods ...Modifier) []*xir.Resource

func (*Builder) MgmtLeaf

func (b *Builder) MgmtLeaf(id string, mods ...Modifier) *xir.Resource

func (*Builder) MgmtLeaves

func (b *Builder) MgmtLeaves(
	count int, idprefix string, mods ...Modifier) []*xir.Resource

func (*Builder) MgmtSpine

func (b *Builder) MgmtSpine(id string, mods ...Modifier) *xir.Resource

func (*Builder) MgmtSpines

func (b *Builder) MgmtSpines(
	count int, idprefix string, mods ...Modifier) []*xir.Resource

func (*Builder) NetworkEmulator

func (b *Builder) NetworkEmulator(id string, mods ...Modifier) *xir.Resource

func (*Builder) NetworkEmulators

func (b *Builder) NetworkEmulators(
	count int, idprefix string, mods ...Modifier) []*xir.Resource

func (*Builder) Node

func (b *Builder) Node(id string, mods ...Modifier) *xir.Resource

func (*Builder) Nodes

func (b *Builder) Nodes(
	count int, idprefix string, mods ...Modifier) []*xir.Resource

func (*Builder) PhysicsSimulator

func (b *Builder) PhysicsSimulator(id string, mods ...Modifier) *xir.Resource

func (*Builder) PhysicsSimulators

func (b *Builder) PhysicsSimulators(
	count int, idprefix string, mods ...Modifier) []*xir.Resource

func (*Builder) StorageServer

func (b *Builder) StorageServer(id string, mods ...Modifier) *xir.Resource

func (*Builder) StorageServers

func (b *Builder) StorageServers(
	count int, idprefix string, mods ...Modifier) []*xir.Resource

func (*Builder) Trunk

func (tb *Builder) Trunk(as, bs []*xir.Port, mods ...Modifier) []*xir.Cable

func (*Builder) XpLeaf

func (b *Builder) XpLeaf(id string, mods ...Modifier) *xir.Resource

func (*Builder) XpLeaves

func (b *Builder) XpLeaves(
	count int, idprefix string, mods ...Modifier) []*xir.Resource

func (*Builder) XpSpine

func (b *Builder) XpSpine(id string, mods ...Modifier) *xir.Resource

func (*Builder) XpSpines

func (b *Builder) XpSpines(
	count int, idprefix string, mods ...Modifier) []*xir.Resource

func (*Builder) XpStem

func (b *Builder) XpStem(id string, mods ...Modifier) *xir.Resource

func (*Builder) XpStems

func (b *Builder) XpStems(
	count int, idprefix string, mods ...Modifier) []*xir.Resource

type CableKindMod

type CableKindMod struct {
	Value xir.CableKind
}

func (*CableKindMod) Modify

func (m *CableKindMod) Modify(x interface{})

type CapacityMod

type CapacityMod struct {
	Value uint64
}

func GB

func GB(value uint64) *CapacityMod

func TB

func TB(value uint64) *CapacityMod

func (*CapacityMod) Modify

func (m *CapacityMod) Modify(x interface{})

type ConnectorMod

type ConnectorMod struct {
	Value xir.ConnectorKind
}

func (*ConnectorMod) Modify

func (m *ConnectorMod) Modify(x interface{})

type CoresMod

type CoresMod struct {
	Value uint32
}

func (*CoresMod) Modify

func (m *CoresMod) Modify(x interface{})

type DefaultImageMod

type DefaultImageMod struct {
	Image string
}

func DefaultImage

func DefaultImage(img string) DefaultImageMod

func (DefaultImageMod) Modify

func (i DefaultImageMod) Modify(x interface{})

type DimmConstructor

type DimmConstructor func() *xir.Dimm

func (DimmConstructor) Modify

func (ctor DimmConstructor) Modify(x interface{})

type DimmTypeMod

type DimmTypeMod struct {
	Value xir.MemoryType
}

func (*DimmTypeMod) Modify

func (m *DimmTypeMod) Modify(x interface{})

type DimmsConstructor

type DimmsConstructor func() []*xir.Dimm

func (DimmsConstructor) Modify

func (ctor DimmsConstructor) Modify(x interface{})

type DiskConstructor

type DiskConstructor func() *xir.Disk

func (DiskConstructor) Modify

func (ctor DiskConstructor) Modify(x interface{})

type DiskInterfaceMod

type DiskInterfaceMod struct {
	Value xir.DiskInterface
}

func (*DiskInterfaceMod) Modify

func (m *DiskInterfaceMod) Modify(x interface{})

type DiskRoleMod

type DiskRoleMod struct {
	Value xir.DiskRole
}

func (*DiskRoleMod) Modify

func (m *DiskRoleMod) Modify(x interface{})

type DisksConstructor

type DisksConstructor func() []*xir.Disk

func (DisksConstructor) Modify

func (ctor DisksConstructor) Modify(x interface{})

type FirmwareMod

type FirmwareMod struct {
	Value xir.Firmware_Kind
}

func (*FirmwareMod) Modify

func (m *FirmwareMod) Modify(x interface{})

type GraphologyEdge

type GraphologyEdge struct {
	Nodes [2]string `json:"nodes"`
	Color string    `json:"color,omitempty"`
	Size  int       `json:"size,omitempty"`
}

type GraphologyNode

type GraphologyNode struct {
	Label string  `json:"label"`
	X     float32 `json:"x,omitempty"`
	Y     float32 `json:"y,omitempty"`
	Color string  `json:"color,omitempty"`
	Size  int     `size:"size,omitempty"`
}

type GraphologySpec

type GraphologySpec struct {
	Nodes []GraphologyNode `json:"nodes"`
	Edges []GraphologyEdge `json:"edges"`
}

type IPCounter

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

func NewIPCounter

func NewIPCounter(addr string) (*IPCounter, error)

func (*IPCounter) Get

func (c *IPCounter) Get() net.IP

func (*IPCounter) Inc

func (c *IPCounter) Inc()

func (*IPCounter) String

func (c *IPCounter) String() string

type LOM

type LOM []*Material

func (*LOM) AddDevice

func (b *LOM) AddDevice(sku string, p xir.Product)

func (*LOM) AddUnit

func (b *LOM) AddUnit(e xir.Product) *Material

func (LOM) Print

func (b LOM) Print()

type LinkRoleMod

type LinkRoleMod struct {
	Value   xir.LinkRole
	Indices []uint
}

func (*LinkRoleMod) Modify

func (m *LinkRoleMod) Modify(nic interface{})

type Material

type Material struct {
	Unit     xir.Product
	Quantity int
	LOM      LOM
}

func (*Material) ConfigItems

func (m *Material) ConfigItems() int

type Modifier

type Modifier interface {
	Modify(x interface{})
}

func AOC

func AOC() Modifier

func BareMetal

func BareMetal() Modifier

func Bios

func Bios() Modifier

func Combo

func Combo(count uint, mods ...Modifier) Modifier

func Cores

func Cores(count uint32) Modifier

func DAC

func DAC() Modifier

func DDR3

func DDR3() Modifier

func DDR4

func DDR4() Modifier

func Dimms

func Dimms(count uint, mods ...Modifier) Modifier

func Disks

func Disks(count uint, mods ...Modifier) Modifier

func Eno

func Eno(count uint, mods ...Modifier) Modifier

func Enp

func Enp(count uint, start uint32, mods ...Modifier) Modifier

func Ens

func Ens(count uint, mods ...Modifier) Modifier

func EtcdDisk

func EtcdDisk() Modifier

func Eth

func Eth(count uint, mods ...Modifier) Modifier

func Gbps

func Gbps(value uint64) Modifier

func Gw

func Gw(indices ...uint) Modifier

func HDDs

func HDDs(count uint, mods ...Modifier) Modifier

func Hypervisor

func Hypervisor() Modifier

func Infranet

func Infranet(indices ...uint) Modifier

func Ipmi

func Ipmi(count uint, mods ...Modifier) Modifier

func Mbps

func Mbps(value uint64) Modifier

func Mgmt

func Mgmt(indices ...uint) Modifier

func MinioDisk

func MinioDisk() Modifier

func Procs

func Procs(count uint, mods ...Modifier) Modifier

func QSFP28

func QSFP28() Modifier

func QSFP28_2xQSFP28

func QSFP28_2xQSFP28() Modifier

func QSFP28_4xSFP28

func QSFP28_4xSFP28() Modifier

func QSFPP

func QSFPP() Modifier

func QSFPP_4xSFPP

func QSFPP_4xSFPP() Modifier

func RJ45

func RJ45() Modifier

func RallyDisk

func RallyDisk() Modifier

func SFPP

func SFPP() Modifier

func SSDs

func SSDs(count uint, mods ...Modifier) Modifier

func Sata3

func Sata3() Modifier

func Swp

func Swp(count uint, mods ...Modifier) Modifier

func SysDisk

func SysDisk() Modifier

func Uefi

func Uefi() Modifier

func Virtio

func Virtio() Modifier

func Xpnet

func Xpnet(indices ...uint) Modifier

type NICConstructor

type NICConstructor func() *xir.NIC

func (NICConstructor) Modify

func (ctor NICConstructor) Modify(x interface{})

type ProcConstructor

type ProcConstructor func() *xir.Proc

func (ProcConstructor) Modify

func (ctor ProcConstructor) Modify(x interface{})

type ProcsConstructor

type ProcsConstructor func() []*xir.Proc

func (ProcsConstructor) Modify

func (ctor ProcsConstructor) Modify(x interface{})

type ProductInfo

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

func Product

func Product(args ...string) ProductInfo

func (ProductInfo) Modify

func (p ProductInfo) Modify(x interface{})

type ProductManufacturer

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

func Manufacturer

func Manufacturer(x string) ProductManufacturer

func (ProductManufacturer) Modify

func (p ProductManufacturer) Modify(x interface{})

type ProductModel

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

func Model

func Model(x string) ProductModel

func (ProductModel) Modify

func (p ProductModel) Modify(x interface{})

type ProductSKU

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

func SKU

func SKU(x string) ProductSKU

func (ProductSKU) Modify

func (p ProductSKU) Modify(x interface{})

type RavenPowerControlMod

type RavenPowerControlMod struct {
	Host string
}

func Raven

func Raven(host string) RavenPowerControlMod

func (RavenPowerControlMod) Modify

func (rpcm RavenPowerControlMod) Modify(x interface{})

type RoleAddMod

type RoleAddMod struct {
	Roles []xir.Role
}

func RoleAdd

func RoleAdd(roles ...xir.Role) RoleAddMod

func (RoleAddMod) Modify

func (a RoleAddMod) Modify(x interface{})

type RoleMod

type RoleMod struct {
	Roles []xir.Role
}

func Roles

func Roles(roles ...xir.Role) RoleMod

func (RoleMod) Modify

func (a RoleMod) Modify(x interface{})

type RootdevMod

type RootdevMod struct {
	Rootdev string
}

func Rootdev

func Rootdev(dev string) RootdevMod

func (RootdevMod) Modify

func (m RootdevMod) Modify(x interface{})

type ServiceEndpointMod

type ServiceEndpointMod struct {
	Vni     uint32
	Address string
}

func ServiceEndpoint

func ServiceEndpoint(vni uint32, address string) ServiceEndpointMod

func (ServiceEndpointMod) Modify

func (a ServiceEndpointMod) Modify(x interface{})

type TBLOM

type TBLOM struct {
	Nodes    LOM
	Switches LOM
	Cables   LOM
}

func (TBLOM) Print

func (tbl TBLOM) Print()

type Underlay

type Underlay struct {
	Subnet   string
	AsnBegin uint32
	Vrf      string
	// contains filtered or unexported fields
}

func (*Underlay) IncBGP

func (u *Underlay) IncBGP()

func (*Underlay) Init

func (u *Underlay) Init() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL