db

package
v0.0.0-...-20ad85d Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(createDB bool, host, database, user, passwd string) error

Init accepts authentication parameters for a mysql db and creates a client This function may also be configured to create tables in the db on behalf of the application for setup purposes.

func ResetAllRecords

func ResetAllRecords() error

ResetAllRecords this function would be called to reset the mysqlpunch table First deletes all rows in the table and then resets the auto_increment counter for the id column

func SetNewRecord

func SetNewRecord(r Row) error

SetNewRecord inserts one new record into the table

Types

type Row

type Row struct {
	Text string
	Time time.Time
}

Row represents a row in the mysqlpunch table

Jump to

Keyboard shortcuts

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