sync

package
v0.0.0-...-46a5f05 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInsertAcct  = errors.New("account.add fail")
	ErrUpdateUsage = errors.New("user.update fail")
)

Functions

func Force

func Force(storage Storage, hostname string, verbose bool, logger *log.Logger)

Force writing stats now

func Loop

func Loop(storage Storage, hostname string, verbose bool, logger *log.Logger)

func SessionAcct

func SessionAcct(
	storage Storage,
	user string,
	date string,
	octetIn uint32,
	octetOut uint32,
	packetIn uint32,
	packetOut uint32,
	hostname string,
) error

func UpdateRemaining

func UpdateRemaining(storage Storage, user string, remain uint32) error

Types

type Storage

type Storage interface {
	InsertAcct(name string, date string, rx int, tx int, rxPackets int, txPackets int, hostname string) error
	UpdateUsage(name string, remain int) error
	SelectRemain(name string) (remain int64, err error)
}

Jump to

Keyboard shortcuts

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