util

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomString32

func RandomString32() (string, error)

24 bytes (192 bits) of entropy, base64 encoded

Types

type ChanLogger

type ChanLogger chan string

func (ChanLogger) Printf

func (c ChanLogger) Printf(format string, v ...interface{}) error

type FileLogger

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

Logs into a file. Timestamps are in UTC.

func NewFileLogger

func NewFileLogger(filepath string) (*FileLogger, error)

func (*FileLogger) Close

func (l *FileLogger) Close() error

func (*FileLogger) Printf

func (l *FileLogger) Printf(format string, v ...interface{}) error

log.Printf drops the returned error, we don't. In case of a write error, we reopen the file and try again.

Jump to

Keyboard shortcuts

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