mdb

package
v0.0.0-...-63c3a42 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package mdb implements a simple in-memory Machine DataBase.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsMetadata

type AwsMetadata struct {
	AccountId   string
	AccountName string
	InstanceId  string
	Region      string
	Tags        tags.Tags
}

type Machine

type Machine struct {
	Hostname       string
	IpAddress      string       `json:",omitempty"`
	RequiredImage  string       `json:",omitempty"`
	PlannedImage   string       `json:",omitempty"`
	DisableUpdates bool         `json:",omitempty"`
	OwnerGroup     string       `json:",omitempty"`
	Tags           tags.Tags    `json:",omitempty"`
	AwsMetadata    *AwsMetadata `json:",omitempty"`
}

Machine describes a single machine with a unique Hostname and optional metadata about the machine.

func (Machine) Compare

func (left Machine) Compare(right Machine) bool

func (*Machine) UpdateFrom

func (dest *Machine) UpdateFrom(source Machine)

UpdateFrom updates dest with data from source.

type Mdb

type Mdb struct {
	Machines []Machine
}

Mdb describes a list of Machines. It implements sort.Interface.

func (*Mdb) DebugWrite

func (mdb *Mdb) DebugWrite(w io.Writer) error

DebugWrite writes the JSON representation to w.

func (*Mdb) Len

func (mdb *Mdb) Len() int

Len returns the number of machines.

func (*Mdb) Less

func (mdb *Mdb) Less(left, right int) bool

Less compares the hostnames of left and right.

func (*Mdb) Swap

func (mdb *Mdb) Swap(left, right int)

Swap swaps two entries in mdb.

Directories

Path Synopsis
Package mdbd implements a simple MDB watcher.
Package mdbd implements a simple MDB watcher.

Jump to

Keyboard shortcuts

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