sqlite

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ALLOCATED = 0
	AVAILABLE = 1

	ReferenceLength = 16
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DBStore

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

func (*DBStore) AddLabel added in v0.1.5

func (store *DBStore) AddLabel(label, ipRange string) bool

func (*DBStore) AllocateIP

func (store *DBStore) AllocateIP(ipamLabel, reference string) string

func (*DBStore) CleanUpLabel added in v0.1.5

func (store *DBStore) CleanUpLabel(label string)

CleanUpLabel performs DELETE CASCADE of associated rows in all tables TODO: Should be replaced by standard DB cascade deletion

func (*DBStore) CreateARecord

func (store *DBStore) CreateARecord(hostname, ipAddr string) bool

func (*DBStore) CreateTables

func (store *DBStore) CreateTables() bool

func (*DBStore) DeleteARecord

func (store *DBStore) DeleteARecord(hostname, ipAddr string) bool

func (*DBStore) DisplayIPRecords

func (store *DBStore) DisplayIPRecords()

func (*DBStore) GetIPAddressFromARecord added in v0.1.5

func (store *DBStore) GetIPAddressFromARecord(ipamLabel, hostname string) string

func (*DBStore) GetIPAddressFromReference added in v0.1.5

func (store *DBStore) GetIPAddressFromReference(ipamLabel, reference string) string

func (*DBStore) GetLabelMap added in v0.1.5

func (store *DBStore) GetLabelMap() map[string]string

func (*DBStore) InsertIPs added in v0.1.5

func (store *DBStore) InsertIPs(ips []string, ipamLabel string)

func (*DBStore) ReleaseIP

func (store *DBStore) ReleaseIP(ip string)

func (*DBStore) RemoveLabel added in v0.1.5

func (store *DBStore) RemoveLabel(label string) bool

type StoreProvider added in v0.1.5

type StoreProvider interface {
	CreateTables() bool
	InsertIPs(ips []string, ipamLabel string)
	DisplayIPRecords()

	AllocateIP(ipamLabel, reference string) string
	ReleaseIP(ip string)
	GetIPAddressFromARecord(ipamLabel, hostname string) string
	GetIPAddressFromReference(ipamLabel, reference string) string

	CreateARecord(hostname, ipAddr string) bool
	DeleteARecord(hostname, ipAddr string) bool

	GetLabelMap() map[string]string
	AddLabel(label, ipRange string) bool
	RemoveLabel(label string) bool
	CleanUpLabel(label string)
}

func NewStore

func NewStore() StoreProvider

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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