storage

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

This section is empty.

Functions

This section is empty.

Types

type MySQL

type MySQL struct {
	DB *sql.DB
}

func NewMySQL

func NewMySQL(dsn string) (*MySQL, error)

func (*MySQL) ArchiveSession

func (s *MySQL) ArchiveSession(name string, sessID string, nasIP string) error

func (*MySQL) CountSessions

func (s *MySQL) CountSessions(name string) (count int, err error)

func (*MySQL) CreateSession

func (s *MySQL) CreateSession(
	name string,
	sessID string,
	nasIP string,
	assignedIP string,
	clientIP string,
) error

func (*MySQL) FinishSession

func (s *MySQL) FinishSession(name string, sessID string, nasIP string) error

func (*MySQL) GetLimits

func (s *MySQL) GetLimits(user string) (limits model.UserLimits, err error)

func (*MySQL) GetUser

func (s *MySQL) GetUser(name string) (user model.User, err error)

func (*MySQL) InsertAcct

func (s *MySQL) InsertAcct(name string, date string, rx int, tx int, rxPackets int, txPackets int, hostname string) error

func (*MySQL) IsSessionExists

func (s *MySQL) IsSessionExists(name string, sessID string, nasIP string) (exists bool, err error)

func (*MySQL) SelectRemain

func (s *MySQL) SelectRemain(name string) (remain int64, err error)

func (*MySQL) Strict

func (s *MySQL) Strict() (err error)

func (*MySQL) UpdateSession

func (s *MySQL) UpdateSession(
	name string,
	sessID string,
	nasIP string,
	rx int,
	tx int,
	rxPackets int,
	txPackets int,
	duration int,
) error

func (*MySQL) UpdateUsage

func (s *MySQL) UpdateUsage(name string, remain int) error

Jump to

Keyboard shortcuts

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