shared

package
v0.0.0-...-0355654 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToString

func ToString(v LogLevel) string

ToString to string

Types

type AltLogger

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

AltLogger alt logger

func NewAltLogger

func NewAltLogger() *AltLogger

NewAltLogger alt logger

func NewAltLoggerTest

func NewAltLoggerTest() *AltLogger

NewAltLoggerTest log on stdout

func (*AltLogger) Debug

func (s *AltLogger) Debug(args ...interface{})

Debug log

func (*AltLogger) Debugf

func (s *AltLogger) Debugf(format string, args ...interface{})

Debugf log

func (*AltLogger) Error

func (s *AltLogger) Error(args ...interface{})

Error error

func (*AltLogger) Errorf

func (s *AltLogger) Errorf(format string, args ...interface{})

Errorf errorf

func (*AltLogger) Fatal

func (s *AltLogger) Fatal(args ...interface{})

Fatal fatal

func (*AltLogger) Fatalf

func (s *AltLogger) Fatalf(format string, args ...interface{})

Fatalf fatalf

func (*AltLogger) Info

func (s *AltLogger) Info(args ...interface{})

Info log

func (*AltLogger) Infof

func (s *AltLogger) Infof(format string, args ...interface{})

Infof logf

func (*AltLogger) Loop

func (s *AltLogger) Loop()

Loop loop goroutine

func (*AltLogger) ReadLogs

func (s *AltLogger) ReadLogs(level LogLevel, max int) []JSONLog

ReadLogs read logs

func (*AltLogger) SetCapacity

func (s *AltLogger) SetCapacity(v int64)

SetCapacity set capacity

func (*AltLogger) SetTimeout

func (s *AltLogger) SetTimeout(v int64)

SetTimeout set timeout

func (*AltLogger) Size

func (s *AltLogger) Size() int

Size size

func (*AltLogger) ToJSON

func (s *AltLogger) ToJSON() ([]byte, error)

ToJSON to json

func (*AltLogger) Trace

func (s *AltLogger) Trace(args ...interface{})

Trace log

func (*AltLogger) Tracef

func (s *AltLogger) Tracef(format string, args ...interface{})

Tracef log

func (*AltLogger) Warn

func (s *AltLogger) Warn(args ...interface{})

Warn log

func (*AltLogger) Warnf

func (s *AltLogger) Warnf(format string, args ...interface{})

Warnf logf

type Group

type Group struct {
	UID  string `json:"uid"`
	Name string `json:"name"`
}

Group group

type JSONLog

type JSONLog struct {
	// Date
	Date int64 `json:"date"`
	// Level level
	Level string `json:"level"`
	// Message log
	Message string `json:"message"`
}

JSONLog log

type Log

type Log struct {
	// Level level
	Level LogLevel
	// Message log
	Message string
}

Log log

type LogLevel

type LogLevel int8

LogLevel level

const (
	// TRACE trace
	TRACE LogLevel = 1
	// DEBUG log level
	DEBUG LogLevel = 2
	// INFO log level
	INFO LogLevel = 3
	// WARN log level
	WARN LogLevel = 4
	// ERROR log level
	ERROR LogLevel = 5
	// FATAL log level
	FATAL LogLevel = 6
)

func ToLogLevel

func ToLogLevel(v int) LogLevel

ToLogLevel int -> LogLevel

type Result

type Result struct {
	Firstname string `json:"first"`
	Lastname  string `json:"last"`
	Club      string `json:"club"`
	Lap       int    `json:"lap"`
	Bib       int    `json:"bib"`    // couloir
	Lane      int    `json:"lane"`   // dossard
	Result    string `json:"result"` // time in s
	Status    int    `json:"status"` // status 0: unranked 1: normal 2: DNS 3: DNF 4:DQ
	Rank      int    `json:"rank"`
}

Result (Bib xor Lane is used)

type Trial

type Trial struct {
	UID         string    `json:"uid"`
	Name        string    `json:"name"`
	Round       int64     `json:"round"`
	Group       Group     `json:"group"`
	Date        time.Time `json:"date"`   // real date
	DateE       time.Time `json:"dateE"`  // expected date
	Length      int64     `json:"length"` // length
	Wind        string    `json:"wind"`
	Temperature string    `json:"temperature"`
	Status      int64     `json:"status"`
	Modtime     time.Time
	Results     *[]Result `json:"results,omitempty"`
}

Trial trial

Jump to

Keyboard shortcuts

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