bolt

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const SchemaVersion = "1"

SchemaVersion is the current version of the bolt db

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

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

Storage is a storage.LeaseStorage implementation that persists IP leases in a bbolt database

func (*Storage) Create

func (s *Storage) Create(ctx context.Context, ip net.IP, clientID string, leased bool, expiration time.Time) error

Create implements lease.Storage

func (*Storage) Delete

func (s *Storage) Delete(ctx context.Context, ip net.IP, clientID string) error

Delete implements storage.LeaseStorage

func (*Storage) FindByID

func (s *Storage) FindByID(ctx context.Context, clientID string) (net.IP, bool, time.Time, error)

FindByID implements storage.LeaseStorage

func (*Storage) FindByIP

func (s *Storage) FindByIP(ctx context.Context, ip net.IP) (string, bool, time.Time, error)

FindByIP implements storage.LeaseStorage

func (*Storage) ListIDs

func (s *Storage) ListIDs(ctx context.Context) ([]string, error)

ListIDs returns a list of all IDs and implements storage.LeaseStorage

func (*Storage) ListIPs

func (s *Storage) ListIPs(ctx context.Context) ([]net.IP, error)

ListIPs returns a list of all IPs and implements storage.LeaseStorage

func (*Storage) Update

func (s *Storage) Update(ctx context.Context, ip net.IP, clientID string, leased bool, expiration time.Time) error

Update implements storage.LeaseStorage

Jump to

Keyboard shortcuts

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