misc

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIP

func GetIP() string

func LogPanic

func LogPanic(logger errorable)

func Retry

func Retry(retryCount int) *retryer

func Schedule

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

func ScheduleWithInitialDelay added in v0.0.10

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 added in v0.1.1

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

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

func NewErrorCounter added in v0.1.1

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

func (*ErrorCounter) Err added in v0.1.1

func (c *ErrorCounter) Err() error

func (*ErrorCounter) IsOverThreshold added in v0.1.1

func (c *ErrorCounter) IsOverThreshold() bool

func (*ErrorCounter) Put added in v0.1.1

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