models

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 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 BarkLog

type BarkLog struct {
	Id                  int64          `db:"id" json:"id"`
	LogTime             time.Time      `db:"log_time" json:"logTime"`
	LogLevel            string         `db:"log_level" json:"logLevel"`
	ServiceName         string         `db:"service_name" json:"serviceName"`
	ServiceInstanceName string         `db:"service_instance_name" json:"serviceInstanceName"`
	Code                string         `db:"code" json:"code"`
	Message             string         `db:"msg" json:"msg"`
	MoreData            jsonObject.Typ `db:"more_data" json:"moreData"`
}

BarkLog is a struct representing a log in Bark

func (BarkLog) String

func (b BarkLog) String() string

func (BarkLog) ValidateForInsert

func (b BarkLog) ValidateForInsert() (BarkLog, error)

ValidateForInsert checks for missing values in the incoming BarkLog's fields. In case a missing value is encountered, a default value is assigned to it.

type BarkLogDao

type BarkLogDao struct{}

func NewBarkLogDao

func NewBarkLogDao() *BarkLogDao

func (*BarkLogDao) Insert

func (bld *BarkLogDao) Insert(l BarkLog) error

Insert inserts a Bark log in the database

func (*BarkLogDao) InsertBatch

func (bld *BarkLogDao) InsertBatch(l []BarkLog) error

InsertBatch sends a batch of logs to the DB.

func (*BarkLogDao) InsertServerStartedLog

func (bld *BarkLogDao) InsertServerStartedLog() error

InsertServerStartedLog inserts a log entry in the postgres DB stating that bark server has started successfully. This acts as a checkpoint that everything is working as expected in the DB connection department.

Jump to

Keyboard shortcuts

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