daoutils

package
v0.0.0-...-6093075 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPanicAndErr

func CheckPanicAndErr(r interface{}) error

func CheckPanicOrLog

func CheckPanicOrLog(r interface{}, log PanicLogger) bool

func CheckPanicOrStderr

func CheckPanicOrStderr(r interface{}) bool

func CloseCloser

func CloseCloser(closer io.Closer)

func FirstNonEmpty

func FirstNonEmpty(strs ...string) string

func FormatTime

func FormatTime(duration, unit time.Duration, decimalDigits int) string

func NewUUIDV4

func NewUUIDV4() uuid.UUID

func PanicIfErr

func PanicIfErr(err error)

func RandInt

func RandInt() int

func RandInt64

func RandInt64(max int64) int64

func RandomAlphanumeric

func RandomAlphanumeric(length int) string

func RandomNumeric

func RandomNumeric(length int) string

func RandomString

func RandomString(length int, chars string) string

Types

type PanicLogger

type PanicLogger interface {
	Errorf(c context.Context, format string, args ...interface{})
}

type StringBuilder

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

func NewStringBuilder

func NewStringBuilder() *StringBuilder

func (*StringBuilder) Append

func (sb *StringBuilder) Append(a ...interface{}) *StringBuilder

func (*StringBuilder) Appendf

func (sb *StringBuilder) Appendf(format string, a ...interface{}) *StringBuilder

func (*StringBuilder) Appendln

func (sb *StringBuilder) Appendln(a ...interface{}) *StringBuilder

func (StringBuilder) Bytes

func (sb StringBuilder) Bytes() []byte

func (StringBuilder) String

func (sb StringBuilder) String() string

func (StringBuilder) StringTrimmed

func (sb StringBuilder) StringTrimmed() string

Jump to

Keyboard shortcuts

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