users

package
v0.0.0-...-3b37907 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteRow

func DeleteRow(id int) error

DeleteRow deletes one row in the users table by ID this will only be used to delete bot user activity once detected

func SetNewRecord

func SetNewRecord(u User) error

SetNewRecord inserts one new record into the table

func UpdateFirstCommitByUsername

func UpdateFirstCommitByUsername(username string, ts time.Time) error

UpdateFirstCommitByUsername accepts a username and time object and updates the matching row's first_commit column to the timestamp

func UpdateLastCommitByUsername

func UpdateLastCommitByUsername(username string, ts time.Time) error

UpdateLastCommitByUsername accepts a username and time object and updates the matching row's last_commit column to the timestamp

Types

type User

type User struct {
	ID          int
	Username    string
	FirstCommit time.Time
	LastCommit  time.Time
	Notes       string
}

User represents all columns in one user entry in the users table

func GetBotUserRows

func GetBotUserRows() ([]User, error)

GetBotUserRows gets a slice of rows matching possible bot matchers

func GetRowsByUsername

func GetRowsByUsername(username string) ([]User, error)

GetRowsByUsername gets a slice of rows matching a username

Jump to

Keyboard shortcuts

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