database

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AlreadySuch = errors.New("entity already exists by that name")
View Source
var DB *sql.DB
View Source
var DBInitialized bool
View Source
var NoSuch = errors.New("nothing found by that name")

Functions

func CloseDatabase

func CloseDatabase() (err error)

func DeleteAllGenericHardware

func DeleteAllGenericHardware(tx *sql.Tx) (err error)

func DeleteAllGenericHardwareContext added in v2.2.0

func DeleteAllGenericHardwareContext(ctx context.Context) error

func DeleteAllNetworks

func DeleteAllNetworks(tx *sql.Tx) (err error)

func DeleteAllNetworksContext added in v2.2.0

func DeleteAllNetworksContext(ctx context.Context) error

func DeleteGenericHardware

func DeleteGenericHardware(tx *sql.Tx, hardware sls_common.GenericHardware) (err error)

func DeleteGenericHardwareByXname added in v2.2.0

func DeleteGenericHardwareByXname(tx *sql.Tx, xname string) error

func DeleteGenericHardwareByXnameContext added in v2.2.0

func DeleteGenericHardwareByXnameContext(ctx context.Context, xname string) error

func DeleteGenericHardwareContext added in v2.2.0

func DeleteGenericHardwareContext(ctx context.Context, hardware sls_common.GenericHardware) error

func DeleteNetwork

func DeleteNetwork(tx *sql.Tx, networkName string) (err error)

func DeleteNetworkContext added in v2.2.0

func DeleteNetworkContext(ctx context.Context, networkName string) error

func GetAllGenericHardware

func GetAllGenericHardware(tx *sql.Tx) (hardware []sls_common.GenericHardware, err error)

func GetAllGenericHardwareContext added in v2.2.0

func GetAllGenericHardwareContext(ctx context.Context) (hardware []sls_common.GenericHardware, err error)

func GetAllNetworks

func GetAllNetworks(tx *sql.Tx) (networks []sls_common.Network, err error)

func GetAllNetworksContext added in v2.2.0

func GetAllNetworksContext(ctx context.Context) ([]sls_common.Network, error)

func GetCurrentVersion

func GetCurrentVersion(ctx context.Context) (version int, err error)

func GetGenericHardwareForExtraProperties

func GetGenericHardwareForExtraProperties(ctx context.Context, properties map[string]interface{}) (hardware []sls_common.GenericHardware,
	err error)

func GetGenericHardwareFromXname

func GetGenericHardwareFromXname(tx *sql.Tx, xname string) (hardware sls_common.GenericHardware, err error)

func GetGenericHardwareFromXnameContext added in v2.2.0

func GetGenericHardwareFromXnameContext(ctx context.Context, xname string) (hardware sls_common.GenericHardware, err error)

func GetLastModified

func GetLastModified(ctx context.Context) (lastModified string, err error)

func GetNetworkForName

func GetNetworkForName(tx *sql.Tx, name string) (network sls_common.Network, err error)

func GetNetworkForNameContext added in v2.2.0

func GetNetworkForNameContext(ctx context.Context, name string) (sls_common.Network, error)

func GetNetworksContainingIP

func GetNetworksContainingIP(tx *sql.Tx, addr string) (networks []sls_common.Network, err error)

func GetNetworksContainingIPContext added in v2.2.0

func GetNetworksContainingIPContext(ctx context.Context, addr string) ([]sls_common.Network, error)

func IncrementVersion

func IncrementVersion(trans *sql.Tx, updatedEntity string) (id int64, err error)

func InsertGenericHardware

func InsertGenericHardware(tx *sql.Tx, hardware sls_common.GenericHardware) (err error)

func InsertGenericHardwareContext added in v2.2.0

func InsertGenericHardwareContext(ctx context.Context, hardware sls_common.GenericHardware) error

func InsertNetwork

func InsertNetwork(tx *sql.Tx, network sls_common.Network) (err error)

func InsertNetworkContext added in v2.2.0

func InsertNetworkContext(ctx context.Context, network sls_common.Network) error

func NewDatabase

func NewDatabase() (err error)

func ReplaceAllGenericHardware

func ReplaceAllGenericHardware(tx *sql.Tx, hardware []sls_common.GenericHardware) (err error)

func ReplaceAllGenericHardwareContext added in v2.2.0

func ReplaceAllGenericHardwareContext(ctx context.Context, hardware []sls_common.GenericHardware) error

func ReplaceAllNetworks

func ReplaceAllNetworks(tx *sql.Tx, networks []sls_common.Network) (err error)

func ReplaceAllNetworksContext added in v2.2.0

func ReplaceAllNetworksContext(ctx context.Context, networks []sls_common.Network) error

func SearchGenericHardware

func SearchGenericHardware(tx *sql.Tx, conditions map[string]string, properties map[string]interface{}) (
	hardware []sls_common.GenericHardware, err error)

func SearchGenericHardwareContext added in v2.2.0

func SearchGenericHardwareContext(ctx context.Context, conditions map[string]string, properties map[string]interface{}) (
	hardware []sls_common.GenericHardware, err error)

func SearchNetworks

func SearchNetworks(tx *sql.Tx, conditions map[string]string, properties map[string]interface{}) (networks []sls_common.Network, err error)

func SearchNetworksContext added in v2.2.0

func SearchNetworksContext(ctx context.Context, conditions map[string]string, properties map[string]interface{}) ([]sls_common.Network, error)

func SetGenericHardware added in v2.2.0

func SetGenericHardware(tx *sql.Tx, obj sls_common.GenericHardware) (err error, created bool)

func SetGenericHardwareContext added in v2.2.0

func SetGenericHardwareContext(ctx context.Context, obj sls_common.GenericHardware) (err error, created bool)

func SetNetworkContext added in v2.2.0

func SetNetworkContext(ctx context.Context, network sls_common.Network) error

func ToParameterArray

func ToParameterArray(index int, values []string) (next int, ivalues []interface{}, str string)

func UpdateGenericHardware

func UpdateGenericHardware(tx *sql.Tx, hardware sls_common.GenericHardware) (err error)

func UpdateGenericHardwareContext added in v2.2.0

func UpdateGenericHardwareContext(ctx context.Context, hardware sls_common.GenericHardware) error

func UpdateNetwork

func UpdateNetwork(tx *sql.Tx, network sls_common.Network) (err error)

func UpdateNetworkContext added in v2.2.0

func UpdateNetworkContext(ctx context.Context, network sls_common.Network) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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