pbutils

package
v0.0.0-...-6bcf8dd Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrObjectNil     = errors.New("object is nil.")
	ErrFetchTimedOut = errors.New("fetch object timeout.")
)

Functions

func DayEnd

func DayEnd(t time.Time) (time.Time, error)

func DayStart

func DayStart(t time.Time) (time.Time, error)

func FormatDatetime

func FormatDatetime(sec int64) string

func HTTPGet

func HTTPGet(URL string, timeout int) (err error)

func ParseDatetime

func ParseDatetime(d string) (int64, error)

func ParseDatetimeMinute

func ParseDatetimeMinute(d string) (int64, error)

Types

type FileLock

type FileLock struct {
	sync.Mutex
	// contains filtered or unexported fields
}

file lock

func NewFLock

func NewFLock(path string) (*FileLock, error)

func (*FileLock) TryLock

func (l *FileLock) TryLock() error

func (*FileLock) TryLockWin

func (l *FileLock) TryLockWin() error

windows

func (*FileLock) Unlock

func (l *FileLock) Unlock() error

func (*FileLock) UnlockWin

func (l *FileLock) UnlockWin() error

func (*FileLock) WriteContent

func (l *FileLock) WriteContent(s string) error

type GenericPool

type GenericPool interface {
	Get() (obj interface{}, err error)
	Put(obj interface{}) error
	Clear()
	Close()
	Len() int
}

func NewGenericPool

func NewGenericPool(config poolConfig) (GenericPool, error)

type PortLock

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

locked by port

func NewPortLock

func NewPortLock(port int) *PortLock

func (*PortLock) TryLock

func (p *PortLock) TryLock() (bool, error)

func (*PortLock) UnLock

func (p *PortLock) UnLock() error

Directories

Path Synopsis
queue
mpsc
Package mpsc provides an efficient implementation of a multi-producer, single-consumer lock-free queue.
Package mpsc provides an efficient implementation of a multi-producer, single-consumer lock-free queue.

Jump to

Keyboard shortcuts

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