misc

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureDirExist added in v0.1.13

func EnsureDirExist(dirPath string)

func GetIP

func GetIP() string

func OnPanic added in v0.1.15

func OnPanic(fn func(msg string))

func Retry

func Retry(retryCount int) *retryer

func Schedule

func Schedule(ctx context.Context, period time.Duration, fn func())

func ScheduleWithInitialDelay

func ScheduleWithInitialDelay(ctx context.Context, period, initialDelay time.Duration, fn func())

func UUID

func UUID() uuid.UUID

func UUIDString

func UUIDString() string

Types

type ErrorCounter

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

일정 시간 (duration) 동안 일정 건수 (threshold) 이상의 err 발생 여부 카운팅

func NewErrorCounter

func NewErrorCounter(duration time.Duration, threshold int) *ErrorCounter

func (*ErrorCounter) Err

func (c *ErrorCounter) Err() error

func (*ErrorCounter) IsOverThreshold

func (c *ErrorCounter) IsOverThreshold() bool

func (*ErrorCounter) Put

func (c *ErrorCounter) Put(err error)

type ExpirableOnce

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

func (*ExpirableOnce) Do

func (o *ExpirableOnce) Do(f func())

func (*ExpirableOnce) Expire

func (o *ExpirableOnce) Expire()

Jump to

Keyboard shortcuts

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