logMongos

package module
v0.0.0-...-3641425 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	DB     string
	URI    string
	OPTS   *options.ClientOptions
	BUFFER []Insertion
}

Conn ...class object of mongo connection

func NewConn

func NewConn(shards string, db string) *Conn

func (Conn) CountInTimeRange

func (x Conn) CountInTimeRange(colName string, text string, timestamp time.Time) (int64, error)

func (Conn) CountInTimeRangeRetry

func (x Conn) CountInTimeRangeRetry(colName string, text string, timeStamp time.Time, attempts int) (int64, error)

func (Conn) CountJobsInPeriod

func (x Conn) CountJobsInPeriod(since string, hub string) (int64, error)

func (Conn) FindOne

func (x Conn) FindOne(colName string, lvl string, text string) (LogLine, error)

func (Conn) GetCollection

func (x Conn) GetCollection(coll string) ([]LogLine, error)

func (Conn) GetCollectionRetry

func (x Conn) GetCollectionRetry(coll string, attempts int) ([]LogLine, error)

func (Conn) GetCollections

func (x Conn) GetCollections() ([]string, error)

func (Conn) GetHubsCount

func (x Conn) GetHubsCount(col string, since string) ([]HubsGroupCount, error)

func (Conn) GetHubsCountRetry

func (x Conn) GetHubsCountRetry(colName string, since string, attempts int) ([]HubsGroupCount, error)

func (Conn) GetTotalJobs

func (x Conn) GetTotalJobs(hub string, db string) (int64, error)
func (x Conn) GetTotalLinks(hub string) (int64, error)

func (Conn) InsertPost

func (x Conn) InsertPost(coll string, line LogLine)

InsertPost ...(column, timestamp, level, message) into the DB

func (Conn) InsertPosts

func (x Conn) InsertPosts(coll string, lines []LogLine)

InsertPosts ...(column, timestamp, level, message) into the DB

type HubsGroupCount

type HubsGroupCount struct {
	Name  string `json:"Name"`
	Count int    `json:"Count"`
}

type Insertion

type Insertion struct {
	Collection string
	Lines      []LogLine
	Attempts   int16
}

type LogLine

type LogLine struct {
	Timestamp time.Time `json:"Timestamp"`
	Filename  string    `json:"Filename"`
	Function  string    `json:"Function"`
	Line      int       `json:"Line"`
	Level     string    `json:"Level"`
	Message   string    `json:"Message"`
}

Jump to

Keyboard shortcuts

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