clients

package
v0.0.0-...-11e78ec Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clients

type Clients struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewClients

func NewClients() *Clients

func (*Clients) Expire

func (cx *Clients) Expire(now time.Time, ip uip.Uip, duid d.Duid) error

func (*Clients) Inject

func (cx *Clients) Inject(now time.Time, ip uip.Uip, duid d.Duid, leasedUntil time.Time) error

func (*Clients) InjectPermanent

func (cx *Clients) InjectPermanent(now time.Time, ip uip.Uip, duid d.Duid) error

func (*Clients) Lookup

func (cx *Clients) Lookup(now time.Time, ip uip.Uip, duid d.Duid) (*client, *client)

Lookup returns the entries matching given IP and/or duid. Permanent clients will never expire and are always returned while other entries will only appear until their lease expired.

func (*Clients) SetLease

func (cx *Clients) SetLease(now time.Time, ip uip.Uip, duid d.Duid, leasedUntil time.Time) error

Jump to

Keyboard shortcuts

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