utils

package
v0.0.0-...-8fdf43c Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LogFilePath string
	DBFilePath  string
	InstanceID  string
	SecretKey   string
	Port        string
	DevMode     bool
}

config is the configuration struct

func GetConf

func GetConf(path string) *Config

type DataModel

type DataModel struct {
	DB *sqlx.DB
}

func (*DataModel) AddNotification

func (d *DataModel) AddNotification(pubID, source, title, message string, interests []string, metadata map[string]interface{}) (sql.Result, error)

func (*DataModel) GetHistory

func (d *DataModel) GetHistory(date time.Time) ([]NotificationRow, error)

func (*DataModel) GetRecentNotifications

func (d *DataModel) GetRecentNotifications(limit int) ([]NotificationRow, error)

func (*DataModel) Init

func (d *DataModel) Init(location string)

type Logger

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

func (*Logger) Debug

func (l *Logger) Debug(message string)

func (*Logger) Error

func (l *Logger) Error(err error)

func (*Logger) ErrorWithField

func (l *Logger) ErrorWithField(message, field, value string)

func (*Logger) Info

func (l *Logger) Info(message string)

func (*Logger) Init

func (l *Logger) Init(json bool)

type NotificationRow

type NotificationRow struct {
	PubID     string `db:"pub_id" json:"pub_id"`
	Date      string `db:"date" json:"date"`
	Source    string `db:"source" json:"source"`
	Interests string `db:"interests" json:"interests"`
	Title     string `db:"title" json:"title"`
	Message   string `db:"message" json:"message"`
	Metadata  string `db:"metadata" json:"metadata"`
}

type UserRow

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

Jump to

Keyboard shortcuts

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