store

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2018 License: BSD-3-Clause Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltStore

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

func NewBoltStore

func NewBoltStore(path string) (*BoltStore, error)

func (*BoltStore) Close

func (s *BoltStore) Close() error

func (*BoltStore) DeleteDevice

func (s *BoltStore) DeleteDevice(d *models.Device) error

func (*BoltStore) Flush

func (s *BoltStore) Flush()

func (*BoltStore) ForEachDevice

func (s *BoltStore) ForEachDevice(foreach func(*models.Device)) error

func (*BoltStore) ForEachLease

func (s *BoltStore) ForEachLease(foreach func(*models.Lease)) error

func (*BoltStore) GetDevice

func (s *BoltStore) GetDevice(mac net.HardwareAddr) (*models.Device, error)

func (*BoltStore) GetLease

func (s *BoltStore) GetLease(ip net.IP) (*models.Lease, error)

func (*BoltStore) PutDevice

func (s *BoltStore) PutDevice(d *models.Device) error

func (*BoltStore) PutLease

func (s *BoltStore) PutLease(l *models.Lease) error

type MemoryStore

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

func NewMemoryStore

func NewMemoryStore() (*MemoryStore, error)

func (*MemoryStore) Close

func (s *MemoryStore) Close() error

func (*MemoryStore) DeleteDevice

func (s *MemoryStore) DeleteDevice(d *models.Device) error

func (*MemoryStore) ForEachDevice

func (s *MemoryStore) ForEachDevice(foreach func(*models.Device)) error

func (*MemoryStore) ForEachLease

func (s *MemoryStore) ForEachLease(foreach func(*models.Lease)) error

func (*MemoryStore) GetDevice

func (s *MemoryStore) GetDevice(mac net.HardwareAddr) (*models.Device, error)

func (*MemoryStore) GetLease

func (s *MemoryStore) GetLease(ip net.IP) (*models.Lease, error)

func (*MemoryStore) PutDevice

func (s *MemoryStore) PutDevice(d *models.Device) error

func (*MemoryStore) PutLease

func (s *MemoryStore) PutLease(l *models.Lease) error

type MySQLStore

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

func NewMySQLStore

func NewMySQLStore(cfg *mysql.Config, leaseTable, deviceTable string) (*MySQLStore, error)

func (*MySQLStore) Close

func (s *MySQLStore) Close() error

func (*MySQLStore) DeleteDevice

func (s *MySQLStore) DeleteDevice(d *models.Device) error

func (*MySQLStore) ForEachDevice

func (s *MySQLStore) ForEachDevice(foreach func(*models.Device)) error

func (*MySQLStore) ForEachLease

func (s *MySQLStore) ForEachLease(foreach func(*models.Lease)) error

func (*MySQLStore) GetDevice

func (s *MySQLStore) GetDevice(mac net.HardwareAddr) (*models.Device, error)

func (*MySQLStore) GetLease

func (s *MySQLStore) GetLease(ip net.IP) (*models.Lease, error)

func (*MySQLStore) PutDevice

func (s *MySQLStore) PutDevice(d *models.Device) error

func (*MySQLStore) PutLease

func (s *MySQLStore) PutLease(l *models.Lease) error

type PGStore

type PGStore struct {
	*MySQLStore
	// contains filtered or unexported fields
}

func NewPGStore

func NewPGStore(cfg *mysql.Config, leaseTable, deviceTable, blacklistTable string) (*PGStore, error)

func (*PGStore) DeleteDevice

func (s *PGStore) DeleteDevice(d *models.Device) error

func (*PGStore) ForEachDevice

func (s *PGStore) ForEachDevice(foreach func(*models.Device)) error

func (*PGStore) ForEachLease

func (s *PGStore) ForEachLease(foreach func(*models.Lease)) error

func (*PGStore) GetDevice

func (s *PGStore) GetDevice(mac net.HardwareAddr) (*models.Device, error)

func (*PGStore) GetLease

func (s *PGStore) GetLease(ip net.IP) (*models.Lease, error)

func (*PGStore) PutDevice

func (s *PGStore) PutDevice(d *models.Device) error

func (*PGStore) PutLease

func (s *PGStore) PutLease(l *models.Lease) error

type Store

type Store interface {
	Close() error

	GetLease(ip net.IP) (*models.Lease, error)
	PutLease(l *models.Lease) error
	ForEachLease(foreach func(*models.Lease)) error

	GetDevice(mac net.HardwareAddr) (*models.Device, error)
	PutDevice(d *models.Device) error
	DeleteDevice(d *models.Device) error
	ForEachDevice(foreach func(*models.Device)) error
}

Jump to

Keyboard shortcuts

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