database

package
v0.0.0-...-e86e17f Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity

type Activity struct {
	ClassName string
	Title     string
	Timestamp time.Time
}

Activity represents a record of an active application

type DB

type DB struct {
	// contains filtered or unexported fields
}

DB is a struct that represents a connection to the database.

func NewDB

func NewDB(config DBConfig) (*DB, error)

NewDB creates a new connection to the database and returns a DB instance.

func (*DB) Close

func (db *DB) Close() error

Close closes the connection to the database.

func (*DB) WriteActivity

func (db *DB) WriteActivity(activity Activity) error

WriteActivity writes an activity record to the database.

type DBConfig

type DBConfig struct {
	User     string
	Password string
	Host     string
	Port     int
	DBName   string
}

DBConfig contains the configuration for connecting to the database.

Jump to

Keyboard shortcuts

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