mysql

package
v0.0.0-...-f1b23c0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MySQL

type MySQL struct {
	Conn *sqlx.DB
}

A MySQL is backend of datastore by MySQL Server

func New

func New(c *config.MySQLConfig) (*MySQL, error)

New create MySQL datastore

func (*MySQL) AttachInterface

func (m *MySQL) AttachInterface(ctx context.Context, attachment ganymede.InterfaceAttachment) (*ganymede.InterfaceAttachment, error)

AttachInterface is

func (*MySQL) CreateAddress

func (m *MySQL) CreateAddress(ctx context.Context, address ipam.Address) (*ipam.Address, error)

CreateAddress create a address

func (*MySQL) CreateBridge

func (m *MySQL) CreateBridge(ctx context.Context, bridge ganymede.Bridge) (*ganymede.Bridge, error)

CreateBridge is

func (*MySQL) CreateLease

func (m *MySQL) CreateLease(ctx context.Context, lease ipam.Lease) (*ipam.Lease, error)

CreateLease create a lease

func (*MySQL) CreateSubnet

func (m *MySQL) CreateSubnet(ctx context.Context, subnet ipam.Subnet) (*ipam.Subnet, error)

CreateSubnet create a subnet

func (*MySQL) DeleteAddress

func (m *MySQL) DeleteAddress(ctx context.Context, uuid uuid.UUID) error

DeleteAddress deletes address

func (*MySQL) DeleteBridge

func (m *MySQL) DeleteBridge(ctx context.Context, bridgeID uuid.UUID) error

DeleteBridge is

func (*MySQL) DeleteCPUPinningGroup

func (m *MySQL) DeleteCPUPinningGroup(ctx context.Context, cpuPinningGroupID uuid.UUID) error

DeleteCPUPinningGroup delete cpu pinning group record

func (*MySQL) DeleteImage

func (m *MySQL) DeleteImage(imageID uuid.UUID) error

DeleteImage delete image record

func (*MySQL) DeleteLease

func (m *MySQL) DeleteLease(ctx context.Context, leaseID uuid.UUID) error

DeleteLease deletes a lease

func (*MySQL) DeletePinnedCore

func (m *MySQL) DeletePinnedCore(ctx context.Context, pinnedID uuid.UUID) error

DeletePinnedCore delete record

func (*MySQL) DeleteSubnet

func (m *MySQL) DeleteSubnet(ctx context.Context, uuid uuid.UUID) error

DeleteSubnet deletes a subnet

func (*MySQL) DeleteVirtualMachine

func (m *MySQL) DeleteVirtualMachine(vmID uuid.UUID) error

DeleteVirtualMachine delete virtual machine record

func (*MySQL) DeleteVolume

func (m *MySQL) DeleteVolume(ctx context.Context, volumeID string) error

DeleteVolume delete volume record

func (*MySQL) DetachInterface

func (m *MySQL) DetachInterface(ctx context.Context, attachmentID uuid.UUID) error

DetachInterface is

func (*MySQL) GetAddressByID

func (m *MySQL) GetAddressByID(ctx context.Context, uuid uuid.UUID) (*ipam.Address, error)

GetAddressByID retrieves address according to the id given

func (*MySQL) GetAttachment

func (m *MySQL) GetAttachment(ctx context.Context, attachmentID uuid.UUID) (*ganymede.InterfaceAttachment, error)

GetAttachment is

func (*MySQL) GetAvailableCorePair

func (m *MySQL) GetAvailableCorePair(ctx context.Context, hypervisorID int) ([]ganymede.NUMANode, error)

GetAvailableCorePair retrieve not pinned CorePairs

func (*MySQL) GetBridge

func (m *MySQL) GetBridge(ctx context.Context, bridgeID uuid.UUID) (*ganymede.Bridge, error)

GetBridge is

func (*MySQL) GetCPUCorePair

func (m *MySQL) GetCPUCorePair(ctx context.Context, corePairID uuid.UUID) (*ganymede.CorePair, error)

GetCPUCorePair retrieve CPU CorePair

func (*MySQL) GetCPUPinningGroup

func (m *MySQL) GetCPUPinningGroup(ctx context.Context, cpuPinningGroupID uuid.UUID) (*ganymede.CPUPinningGroup, error)

GetCPUPinningGroup retrieve cpu pinning group

func (*MySQL) GetCPUPinningGroupByName

func (m *MySQL) GetCPUPinningGroupByName(ctx context.Context, name string) (*ganymede.CPUPinningGroup, error)

GetCPUPinningGroupByName retrieve cpu pinning group by name

func (*MySQL) GetDHCPLeaseByMACAddress

func (m *MySQL) GetDHCPLeaseByMACAddress(ctx context.Context, mac types.HardwareAddr) (*ipam.DHCPLease, error)

GetDHCPLeaseByMACAddress retrieves DHCPLease according to the mac given

func (*MySQL) GetHostnameByAddress

func (m *MySQL) GetHostnameByAddress(address types.IP) (string, error)

GetHostnameByAddress is

func (*MySQL) GetHypervisor

func (m *MySQL) GetHypervisor(ctx context.Context, hypervisorID int) (*ganymede.HyperVisor, error)

GetHypervisor retrieve hypervisor

func (*MySQL) GetHypervisorByHostname

func (m *MySQL) GetHypervisorByHostname(ctx context.Context, hostname string) (*ganymede.HyperVisor, error)

GetHypervisorByHostname retrieve hypervisor by hostname

func (*MySQL) GetIQN

func (m *MySQL) GetIQN(ctx context.Context, hostname string) (string, error)

GetIQN get IQN from MySQL

func (*MySQL) GetImage

func (m *MySQL) GetImage(imageID uuid.UUID) (*europa.BaseImage, error)

GetImage retrieves image object

func (*MySQL) GetLeaseByID

func (m *MySQL) GetLeaseByID(ctx context.Context, leaseID uuid.UUID) (*ipam.Lease, error)

GetLeaseByID retrieves lease according to the mac given

func (*MySQL) GetPinnedCoreByPinningGroup

func (m *MySQL) GetPinnedCoreByPinningGroup(ctx context.Context, cpuPinningGroupID uuid.UUID) ([]ganymede.CPUCorePinned, error)

GetPinnedCoreByPinningGroup retrieve CPU CorePair

func (*MySQL) GetSubnetByID

func (m *MySQL) GetSubnetByID(ctx context.Context, uuid uuid.UUID) (*ipam.Subnet, error)

GetSubnetByID retrieves address according to the id given

func (*MySQL) GetSubnetByVLAN

func (m *MySQL) GetSubnetByVLAN(ctx context.Context, vlanID uint32) (*ipam.Subnet, error)

GetSubnetByVLAN is

func (*MySQL) GetVirtualMachine

func (m *MySQL) GetVirtualMachine(vmID uuid.UUID) (*ganymede.VirtualMachine, error)

GetVirtualMachine return virtual machine record

func (*MySQL) GetVolume

func (m *MySQL) GetVolume(ctx context.Context, volumeID string) (*europa.Volume, error)

GetVolume return volume from datastore

func (*MySQL) ListAddressBySubnetID

func (m *MySQL) ListAddressBySubnetID(ctx context.Context, subnetID uuid.UUID) ([]ipam.Address, error)

ListAddressBySubnetID retrieves all address according to the subnetID given.

func (*MySQL) ListAttachment

func (m *MySQL) ListAttachment(ctx context.Context) ([]ganymede.InterfaceAttachment, error)

ListAttachment is

func (*MySQL) ListBridge

func (m *MySQL) ListBridge(ctx context.Context) ([]ganymede.Bridge, error)

ListBridge is

func (*MySQL) ListImage

func (m *MySQL) ListImage() ([]europa.BaseImage, error)

ListImage retrieves all images

func (*MySQL) ListLease

func (m *MySQL) ListLease(ctx context.Context) ([]ipam.Lease, error)

ListLease retrieves all leases

func (*MySQL) ListSubnet

func (m *MySQL) ListSubnet(ctx context.Context) ([]ipam.Subnet, error)

ListSubnet retrieves all subnets

func (*MySQL) ListVirtualMachine

func (m *MySQL) ListVirtualMachine() ([]ganymede.VirtualMachine, error)

ListVirtualMachine retrieve all virtual machine record

func (*MySQL) ListVolume

func (m *MySQL) ListVolume(ctx context.Context, volumeIDs []string) ([]europa.Volume, error)

ListVolume retrieves multi volumes from MySQL IN query

func (*MySQL) PutCPUPinningGroup

func (m *MySQL) PutCPUPinningGroup(ctx context.Context, cpuPinningGroup ganymede.CPUPinningGroup) error

PutCPUPinningGroup put cpu pinning group

func (*MySQL) PutHypervisor

func (m *MySQL) PutHypervisor(ctx context.Context, iqn, hostname string) (int, error)

PutHypervisor register hypervisor return hypervisor ID by MySQL AUTO INCREMENT.

func (*MySQL) PutHypervisorNUMANode

func (m *MySQL) PutHypervisorNUMANode(ctx context.Context, nodes []ganymede.NUMANode, hypervisorID int) error

PutHypervisorNUMANode register cpu cores by hypervisor

func (*MySQL) PutImage

func (m *MySQL) PutImage(image europa.BaseImage) error

PutImage write image record need to fix if call more than once

func (*MySQL) PutPinnedCore

func (m *MySQL) PutPinnedCore(ctx context.Context, pinned ganymede.CPUCorePinned) error

PutPinnedCore put pinned record

func (*MySQL) PutVirtualMachine

func (m *MySQL) PutVirtualMachine(vm ganymede.VirtualMachine) error

PutVirtualMachine write virtual machine record

func (*MySQL) PutVolume

func (m *MySQL) PutVolume(ctx context.Context, volume europa.Volume) error

PutVolume write volume record.

Jump to

Keyboard shortcuts

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