sqlite

package
v0.0.0-...-3588c51 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2018 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config string) (driver.Storager, error)

Types

type Config

type Config struct {
	DB *gorm.DB
}

func (*Config) AddData

func (c *Config) AddData(name, dtype, value, description string) error

func (*Config) AddDataToProfile

func (c *Config) AddDataToProfile(profile, data string)

func (*Config) AddHost

func (c *Config) AddHost(enable bool, name, fqdn, profile string, interfaces []string) error

func (*Config) AddIP

func (c *Config) AddIP(ip, netmask, gateway string) error

func (*Config) AddInterface

func (c *Config) AddInterface(index int, mac, ip, floatingIP string) error

func (*Config) AddProfile

func (c *Config) AddProfile(name string) error

func (*Config) CountData

func (c *Config) CountData() int

func (*Config) CountHost

func (c *Config) CountHost() int

func (*Config) CountIP

func (c *Config) CountIP() int

func (*Config) CountInterface

func (c *Config) CountInterface() int

func (*Config) CountProfile

func (c *Config) CountProfile() int

func (*Config) DisableHost

func (c *Config) DisableHost(name string) error

func (*Config) EnableHost

func (c *Config) EnableHost(name string) error

func (*Config) End

func (c *Config) End()

func (*Config) FloatingIPExists

func (c *Config) FloatingIPExists(srvid int, itype string, index int) bool

func (*Config) GetDNSIndex

func (c *Config) GetDNSIndex(srvid int) []string

func (*Config) GetDNSNameservers

func (c *Config) GetDNSNameservers(srvid int) []string

func (*Config) GetDNSOptions

func (c *Config) GetDNSOptions(srvid int) []string

func (*Config) GetDNSSearchDomains

func (c *Config) GetDNSSearchDomains(srvid int) []string

func (*Config) GetEnumeratedInterface

func (c *Config) GetEnumeratedInterface(srvid int, itype string, index int) []string

func (*Config) GetFQDN

func (c *Config) GetFQDN(srvid int) string

func (*Config) GetHostname

func (c *Config) GetHostname(srvid int) string

func (*Config) GetID

func (c *Config) GetID(srvid int) int

func (*Config) GetIDFromIP

func (c *Config) GetIDFromIP(ip string) int

func (*Config) GetInterfaceFloatingIPAddress

func (c *Config) GetInterfaceFloatingIPAddress(srvid int, itype string, index int) string

func (*Config) GetInterfaceFloatingIPGateway

func (c *Config) GetInterfaceFloatingIPGateway(srvid int, itype string, index int) string

func (*Config) GetInterfaceFloatingIPNetmask

func (c *Config) GetInterfaceFloatingIPNetmask(srvid int, itype string, index int) string

func (*Config) GetInterfaceIPv4Address

func (c *Config) GetInterfaceIPv4Address(srvid int, itype string, index int) string

func (*Config) GetInterfaceIPv4Gateway

func (c *Config) GetInterfaceIPv4Gateway(srvid int, itype string, index int) string

func (*Config) GetInterfaceIPv4Netmask

func (c *Config) GetInterfaceIPv4Netmask(srvid int, itype string, index int) string

func (*Config) GetInterfaceMACAddress

func (c *Config) GetInterfaceMACAddress(srvid int, itype string, index int) string

func (*Config) GetInterfaceType

func (c *Config) GetInterfaceType(srvid int, itype string, index int) string

func (*Config) GetInterfaces

func (c *Config) GetInterfaces(srvid int) []string

func (*Config) GetInterfacesType

func (c *Config) GetInterfacesType(srvid int, itype string) []int

func (*Config) GetKey

func (c *Config) GetKey(srvid int, key string) string

func (*Config) GetKeys

func (c *Config) GetKeys(srvid int) []string

func (*Config) GetPublicKeys

func (c *Config) GetPublicKeys(srvid int) []string

func (*Config) GetRegion

func (c *Config) GetRegion(srvid int) string

func (*Config) GetTags

func (c *Config) GetTags(srvid int) []string

func (*Config) GetUserData

func (c *Config) GetUserData(srvid int) string

func (*Config) GetVendorData

func (c *Config) GetVendorData(srvid int) string

func (*Config) ListData

func (c *Config) ListData(filter map[string]string) []types.Data

func (*Config) ListHost

func (c *Config) ListHost(filter map[string]string) []types.Host

func (*Config) ListIP

func (c *Config) ListIP(filter map[string]string) []types.IP

func (*Config) ListInterface

func (c *Config) ListInterface(filter map[string]string) []types.Interface

func (*Config) ListProfile

func (c *Config) ListProfile(filter map[string]string) map[string][]string

func (*Config) RemoveData

func (c *Config) RemoveData(name string) error

func (*Config) RemoveDataFromProfile

func (c *Config) RemoveDataFromProfile(profile, data string)

func (*Config) RemoveHost

func (c *Config) RemoveHost(name string) error

func (*Config) RemoveIP

func (c *Config) RemoveIP(ip string) error

func (*Config) RemoveInterface

func (c *Config) RemoveInterface(mac string) error

func (*Config) RemoveProfile

func (c *Config) RemoveProfile(name string) error

func (*Config) UpdateData

func (c *Config) UpdateData(name, value, description string) error

func (*Config) UpdateInterface

func (c *Config) UpdateInterface(mac, itype, value string) error

type Data

type Data struct {
	Model
	Name        string `gorm:"unique;"`
	Type        string
	Value       string
	Description string
}

type Host

type Host struct {
	Model
	IsEnabled  bool
	Name       string      `gorm:"unique;"`
	FQDN       string      `gorm:"unique;"`
	Interfaces []Interface `gorm:"many2many:host_interfaces;"`
	Profile    Profile
	ProfileID  uint
}

type IP

type IP struct {
	Model
	IPAddress string `gorm:"unique;"`
	Netmask   string
	Gateway   string
	Version   int
	Type      string
}

type Interface

type Interface struct {
	Model
	Index        int
	MACAddress   string `gorm:"unique;"`
	IP           IP
	IPID         uint
	FloatingIP   IP
	FloatingIPID uint
}

type Model

type Model struct {
	ID        uint      `gorm:"primary_key"`
	CreatedAt time.Time `gorm:"created_at"`
}

type Profile

type Profile struct {
	Model
	Name  string `gorm:"unique;"`
	Datas []Data `gorm:"many2many:profile_datas;"`
}

type ServerConfig

type ServerConfig struct {
	Model
	Key   string
	Value string
}

Jump to

Keyboard shortcuts

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