utils

package
v0.0.0-...-b3eb65c Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accessor

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

Accessor contain mongodb client and collections

func NewAccessor

func NewAccessor(uri, database, collection string) (*Accessor, error)

NewAccessor makes new connection to mongoDB using target URI and etc

func (*Accessor) Disconnect

func (acc *Accessor) Disconnect()

Disconnect close the connection form mongDB

func (*Accessor) GetByTime

func (acc *Accessor) GetByTime(t *time.Time) ([]Record, error)

GetByTime gets records for the specified time

func (*Accessor) GetByTimeMessage

func (acc *Accessor) GetByTimeMessage(t *time.Time, message string) ([]Record, error)

GetByTimeMessage gets records having specified time and message

func (*Accessor) GetEarliestTime

func (acc *Accessor) GetEarliestTime() (*time.Time, error)

GetEarliestTime gets the timestamp of the earliest record in the DB

func (*Accessor) GetLastTime

func (acc *Accessor) GetLastTime() (*time.Time, error)

GetLastTime gets the timestamp of the last record in the DB

type GL

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

GL containing any instances of OpenGL

func NewGL

func NewGL(imageName string) *GL

NewGL makes new utility instance of OpenGL

func (*GL) Box3

func (g *GL) Box3(x, y, z, w float64)

Box3 draw box at 2d coordinate space

func (*GL) Line3

func (g *GL) Line3(x1, y1, z1, x2, y2, z2 float64)

Line3 draw a line at 3d coordinate space

func (*GL) Loop

func (g *GL) Loop() bool

Loop swap and clear buffer, and poll events. return false is program should quit

func (*GL) Point3

func (g *GL) Point3(x, y, z float64)

Point3 draw point at 3d coordinate space

func (*GL) Quit

func (g *GL) Quit()

Quit OpenGL

func (*GL) SetImageDigit

func (g *GL) SetImageDigit(digit int)

SetImageDigit sets digit for saving image

func (*GL) SetRGB

func (g *GL) SetRGB(red, green, blue float32)

SetRGB set fill color

func (*GL) Setup

func (g *GL) Setup()

Setup OpenGL and create a new window

type Record

type Record struct {
	File    string   `bson:"file"`
	Level   string   `bson:"level"`
	Line    int      `bson:"line"`
	Message string   `bson:"message"`
	NID     string   `bson:"nid"`
	Param   bson.Raw `bson:"param"`
	Time    string   `bson:"time"`
	TimeNtv time.Time
}

Record corresponds to one record in the log.

Jump to

Keyboard shortcuts

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