common

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NewestOffset = -1
	OldestOffset = -2
)

Variables

View Source
var (
	// TODO: remove
	OutWriter io.Writer = os.Stdout
	ErrWriter io.Writer = os.Stderr
)

Functions

func ExitWithErr

func ExitWithErr(format string, a ...interface{})

func GetOffsetFromFlag

func GetOffsetFromFlag(offsetFlag string) int64

func InTTY

func InTTY() bool

nolint

func IsJSON

func IsJSON(data []byte) bool

func ParseTime

func ParseTime(str string) time.Time

func PrintJson

func PrintJson(model any)

TODO: перенести все на этот метод

Types

type PrettyPrintFlags

type PrettyPrintFlags struct {
	NoHeader bool

	MinWidth       int
	MinWidthNested int
	Width          int
	Padding        int
	PadChar        byte
	Flags          uint
}

func NewPrettyPrintFlags

func NewPrettyPrintFlags() PrettyPrintFlags

Jump to

Keyboard shortcuts

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