Documentation ¶
Index ¶
- Constants
- func Migrate() error
- func NullString(s string) sql.NullString
- type AddNetworkParams
- type AddNodeParams
- type AddTrunkNetworkParams
- type AssignInstanceToNodeParams
- type AssignVolumeToNodeParams
- type AttachVolumeToInstanceParams
- type CreateInstanceParams
- type CreateNICParams
- type CreateVolumeParams
- type DBTX
- type DeleteNICParams
- type Instance
- type InstanceNic
- type Network
- type Node
- type Queries
- func (q *Queries) AddNetwork(ctx context.Context, arg AddNetworkParams) error
- func (q *Queries) AddNode(ctx context.Context, arg AddNodeParams) (Node, error)
- func (q *Queries) AddTrunkNetwork(ctx context.Context, arg AddTrunkNetworkParams) error
- func (q *Queries) AssignInstanceToNode(ctx context.Context, arg AssignInstanceToNodeParams) error
- func (q *Queries) AssignVolumeToNode(ctx context.Context, arg AssignVolumeToNodeParams) error
- func (q *Queries) AttachVolumeToInstance(ctx context.Context, arg AttachVolumeToInstanceParams) (int64, error)
- func (q *Queries) CreateInstance(ctx context.Context, arg CreateInstanceParams) (Instance, error)
- func (q *Queries) CreateNIC(ctx context.Context, arg CreateNICParams) error
- func (q *Queries) CreateVolume(ctx context.Context, arg CreateVolumeParams) error
- func (q *Queries) DeleteInstance(ctx context.Context, id string) error
- func (q *Queries) DeleteNIC(ctx context.Context, arg DeleteNICParams) error
- func (q *Queries) DeleteNICsByInstance(ctx context.Context, instance string) error
- func (q *Queries) DeleteNode(ctx context.Context, id string) (int64, error)
- func (q *Queries) DeleteSpecialCases(ctx context.Context, instance string) error
- func (q *Queries) DeleteVolume(ctx context.Context, id string) error
- func (q *Queries) DetachVolume(ctx context.Context, id string) (int64, error)
- func (q *Queries) GetAvailableNodes(ctx context.Context) ([]string, error)
- func (q *Queries) GetImageForVolume(ctx context.Context, id string) (sql.NullString, error)
- func (q *Queries) GetInstance(ctx context.Context, id string) (Instance, error)
- func (q *Queries) GetInstanceAttachedVolumes(ctx context.Context, attachedInstance sql.NullString) ([]Volume, error)
- func (q *Queries) GetInstancesForNode(ctx context.Context, node sql.NullString) ([]Instance, error)
- func (q *Queries) GetNICsByInstance(ctx context.Context, instance string) ([]InstanceNic, error)
- func (q *Queries) GetNetworkByID(ctx context.Context, id string) (Network, error)
- func (q *Queries) GetNetworkForVlan(ctx context.Context, vlan int64) (string, error)
- func (q *Queries) GetNodeByHostname(ctx context.Context, hostname string) (Node, error)
- func (q *Queries) GetNodeForInstance(ctx context.Context, id string) (Node, error)
- func (q *Queries) GetNodes(ctx context.Context) ([]Node, error)
- func (q *Queries) GetSpecialCases(ctx context.Context, instance string) ([]string, error)
- func (q *Queries) GetTrunkVlans(ctx context.Context, nic string) ([]int64, error)
- func (q *Queries) GetVlanForNetwork(ctx context.Context, id string) (int64, error)
- func (q *Queries) GetVolumeByID(ctx context.Context, id string) (Volume, error)
- func (q *Queries) GetVolumesForNode(ctx context.Context, node sql.NullString) ([]Volume, error)
- func (q *Queries) ListInstances(ctx context.Context, tenant string) ([]Instance, error)
- func (q *Queries) ListVolumes(ctx context.Context, tenant string) ([]Volume, error)
- func (q *Queries) RemoveAllNicsOnNetwork(ctx context.Context, network string) ([]string, error)
- func (q *Queries) RemoveTrunkNetwork(ctx context.Context, arg RemoveTrunkNetworkParams) error
- func (q *Queries) SetInstanceState(ctx context.Context, arg SetInstanceStateParams) error
- func (q *Queries) SetNodeAvailability(ctx context.Context, arg SetNodeAvailabilityParams) (int64, error)
- func (q *Queries) SetNodeForInstance(ctx context.Context, arg SetNodeForInstanceParams) (int64, error)
- func (q *Queries) SetNodeHostname(ctx context.Context, arg SetNodeHostnameParams) (int64, error)
- func (q *Queries) SetSpecialCase(ctx context.Context, arg SetSpecialCaseParams) error
- func (q *Queries) SetVolumeState(ctx context.Context, arg SetVolumeStateParams) error
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type RemoveTrunkNetworkParams
- type SetInstanceStateParams
- type SetNodeAvailabilityParams
- type SetNodeForInstanceParams
- type SetNodeHostnameParams
- type SetSpecialCaseParams
- type SetVolumeStateParams
- type SpecialCase
- type TrunkNetwork
- type Volume
Constants ¶
View Source
const ( NetworkIDWAN = "wan" NetworkIDBootstrap = "entanglement-bootstrap-network" )
Variables ¶
This section is empty.
Functions ¶
func NullString ¶
func NullString(s string) sql.NullString
Types ¶
type AddNetworkParams ¶
type AddNodeParams ¶
type AddTrunkNetworkParams ¶
type AssignInstanceToNodeParams ¶
type AssignInstanceToNodeParams struct { Node sql.NullString ID string }
type AssignVolumeToNodeParams ¶
type AssignVolumeToNodeParams struct { Node sql.NullString ID string }
type AttachVolumeToInstanceParams ¶
type AttachVolumeToInstanceParams struct { AttachedInstance sql.NullString ID string }
type CreateInstanceParams ¶
type CreateNICParams ¶
type CreateVolumeParams ¶
type CreateVolumeParams struct { ID string Tenant string SourceImage sql.NullString SourceImageQcow2 sql.NullString Size int64 }
type DeleteNICParams ¶
type Instance ¶
type Instance struct { ID string Tenant string Name string Memory int64 Cpu int64 Node sql.NullString State int64 UserData []byte RootVolume string BiosData sql.NullString }
type InstanceNic ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func Get ¶
Get the database and closable DB object example usage:
queries, dbConn, err := db.Get() if err != nil { return err } defer dbConn.Close()
func (*Queries) AddNetwork ¶
func (q *Queries) AddNetwork(ctx context.Context, arg AddNetworkParams) error
func (*Queries) AddTrunkNetwork ¶
func (q *Queries) AddTrunkNetwork(ctx context.Context, arg AddTrunkNetworkParams) error
func (*Queries) AssignInstanceToNode ¶
func (q *Queries) AssignInstanceToNode(ctx context.Context, arg AssignInstanceToNodeParams) error
func (*Queries) AssignVolumeToNode ¶
func (q *Queries) AssignVolumeToNode(ctx context.Context, arg AssignVolumeToNodeParams) error
func (*Queries) AttachVolumeToInstance ¶
func (*Queries) CreateInstance ¶
Copyright 2021 Entanglement Garden Developers SPDX-License-Identifier: AGPL-3.0-only
func (*Queries) CreateNIC ¶
func (q *Queries) CreateNIC(ctx context.Context, arg CreateNICParams) error
Copyright 2021 Entanglement Garden Developers SPDX-License-Identifier: AGPL-3.0-only
func (*Queries) CreateVolume ¶
func (q *Queries) CreateVolume(ctx context.Context, arg CreateVolumeParams) error
Copyright 2021 Entanglement Garden Developers SPDX-License-Identifier: AGPL-3.0-only
func (*Queries) DeleteInstance ¶
func (*Queries) DeleteNIC ¶
func (q *Queries) DeleteNIC(ctx context.Context, arg DeleteNICParams) error
func (*Queries) DeleteNICsByInstance ¶
func (*Queries) DeleteNode ¶
func (*Queries) DeleteSpecialCases ¶
func (*Queries) DetachVolume ¶
func (*Queries) GetAvailableNodes ¶
func (*Queries) GetImageForVolume ¶
func (*Queries) GetInstance ¶
func (*Queries) GetInstanceAttachedVolumes ¶
func (*Queries) GetInstancesForNode ¶
func (*Queries) GetNICsByInstance ¶
func (*Queries) GetNetworkByID ¶
func (*Queries) GetNetworkForVlan ¶
func (*Queries) GetNodeByHostname ¶
func (*Queries) GetNodeForInstance ¶
func (*Queries) GetNodes ¶
Copyright 2021 Entanglement Garden Developers SPDX-License-Identifier: AGPL-3.0-only
func (*Queries) GetSpecialCases ¶
func (*Queries) GetTrunkVlans ¶
func (*Queries) GetVlanForNetwork ¶
func (*Queries) GetVolumeByID ¶
func (*Queries) GetVolumesForNode ¶
func (*Queries) ListInstances ¶
func (*Queries) ListVolumes ¶
func (*Queries) RemoveAllNicsOnNetwork ¶
func (*Queries) RemoveTrunkNetwork ¶
func (q *Queries) RemoveTrunkNetwork(ctx context.Context, arg RemoveTrunkNetworkParams) error
func (*Queries) SetInstanceState ¶
func (q *Queries) SetInstanceState(ctx context.Context, arg SetInstanceStateParams) error
func (*Queries) SetNodeAvailability ¶
func (*Queries) SetNodeForInstance ¶
func (*Queries) SetNodeHostname ¶
func (*Queries) SetSpecialCase ¶
func (q *Queries) SetSpecialCase(ctx context.Context, arg SetSpecialCaseParams) error
func (*Queries) SetVolumeState ¶
func (q *Queries) SetVolumeState(ctx context.Context, arg SetVolumeStateParams) error
type SetInstanceStateParams ¶
type SetNodeForInstanceParams ¶
type SetNodeForInstanceParams struct { Node sql.NullString ID string }
type SetNodeHostnameParams ¶
type SetSpecialCaseParams ¶
type SetVolumeStateParams ¶
type SpecialCase ¶
type TrunkNetwork ¶
type Volume ¶
type Volume struct { ID string Tenant string Node sql.NullString Size int64 State int64 SourceImage sql.NullString SourceImageQcow2 sql.NullString AttachedInstance sql.NullString }
Click to show internal directories.
Click to hide internal directories.