utils

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPidFileNotFound = errors.New("pid file not found")
	ErrPidFileStale    = errors.New("pid file exists but points to a not existing process")
	ErrPidFileExists   = errors.New("pid file already exists and points to a valid process")
)

Functions

func ToError

func ToError(val interface{}) error

Types

type LogWriter

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

func NewLogWriter

func NewLogWriter(logger *log.Logger) *LogWriter

func (*LogWriter) Close

func (w *LogWriter) Close() error

func (LogWriter) Lines

func (w LogWriter) Lines() []string

func (*LogWriter) Write

func (w *LogWriter) Write(p []byte) (n int, err error)

type PidFile

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

func NewPidFile

func NewPidFile(path string) *PidFile

func (*PidFile) Acquire

func (p *PidFile) Acquire() error

func (*PidFile) MustRelease

func (p *PidFile) MustRelease()

func (*PidFile) Release

func (p *PidFile) Release() error

type ScheduleExpression

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

func NewSchedule

func NewSchedule(expression string) (*ScheduleExpression, error)

func (ScheduleExpression) Next

func (s ScheduleExpression) Next(t time.Time) time.Time

func (ScheduleExpression) String

func (s ScheduleExpression) String() string

func (*ScheduleExpression) UnmarshalText

func (s *ScheduleExpression) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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