topology

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 16 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Watch

func Watch(topologyRepository, localRepositoryDir, topologyDir string,
	checkInterval time.Duration,
	logger log.DebugLogger) (<-chan *Topology, error)

func WatchWithParams added in v0.3.2

func WatchWithParams(params WatchParams) (<-chan *Topology, error)

Types

type Directory

type Directory struct {
	Name        string
	Directories []*Directory        `json:",omitempty"`
	Machines    []*fm_proto.Machine `json:",omitempty"`
	Subnets     []*Subnet           `json:",omitempty"`
	Tags        tags.Tags           `json:",omitempty"`
	// contains filtered or unexported fields
}

func (*Directory) GetPath

func (directory *Directory) GetPath() string

func (*Directory) Walk

func (directory *Directory) Walk(fn func(*Directory) error) error

type Params added in v0.3.2

type Params struct {
	Logger       log.DebugLogger
	TopologyDir  string // Directory containing topology data.
	VariablesDir string // Directory containing variables.
}

type Subnet

type Subnet struct {
	hyper_proto.Subnet
	FirstAutoIP net.IP   `json:",omitempty"`
	LastAutoIP  net.IP   `json:",omitempty"`
	ReservedIPs []net.IP `json:",omitempty"`
	// contains filtered or unexported fields
}

func (*Subnet) CheckIfIpIsReserved

func (s *Subnet) CheckIfIpIsReserved(ipAddr string) bool

func (*Subnet) Shrink

func (subnet *Subnet) Shrink()

type Topology

type Topology struct {
	Root      *Directory
	Variables map[string]string
	// contains filtered or unexported fields
}

func Load

func Load(topologyDir string) (*Topology, error)

func LoadWithParams added in v0.3.2

func LoadWithParams(params Params) (*Topology, error)

func (*Topology) CheckIfIpIsHost added in v0.3.3

func (t *Topology) CheckIfIpIsHost(ipAddr string) bool

func (*Topology) CheckIfIpIsReserved

func (t *Topology) CheckIfIpIsReserved(ipAddr string) bool

func (*Topology) CheckIfMachineHasSubnet

func (t *Topology) CheckIfMachineHasSubnet(name, subnetId string) (
	bool, error)

func (*Topology) FindDirectory

func (t *Topology) FindDirectory(dirname string) (*Directory, error)

func (*Topology) GetLocationOfMachine

func (t *Topology) GetLocationOfMachine(name string) (string, error)

func (*Topology) GetNumMachines

func (t *Topology) GetNumMachines() uint

func (*Topology) GetSubnetsForMachine

func (t *Topology) GetSubnetsForMachine(name string) ([]*Subnet, error)

func (*Topology) ListMachines

func (t *Topology) ListMachines(dirname string) ([]*fm_proto.Machine, error)

func (*Topology) Walk

func (t *Topology) Walk(fn func(*Directory) error) error

type WatchParams added in v0.3.2

type WatchParams struct {
	Params
	CheckInterval      time.Duration
	LocalRepositoryDir string // Local directory.
	MetricsDirectory   string // Metrics namespace directory.
	TopologyRepository string // Remote Git repository.
}

Jump to

Keyboard shortcuts

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