app

package
v0.7.29 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: MIT Imports: 20 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Arch

func Arch() string

func Args added in v0.1.25

func Args() (args []string)

func Dir

func Dir() string

func Executable

func Executable() string

func Go

func Go(fn func())

func GoGroup added in v0.1.56

func GoGroup(n int, fn func())

func GoGroupWithLog added in v0.2.84

func GoGroupWithLog(n int, log *ulog.Log, fn func())

func LoadConf

func LoadConf[Conf any](filename string) Conf

func Name

func Name() string

func OS

func OS() string

func ParseCmdLine

func ParseCmdLine(version string) (confFile string, ok bool)

func Pid

func Pid() int

func Pwd added in v0.6.28

func Pwd() string

func Run

func Run[UserConf any](version string, fn func(UserConf))

func RunJust added in v0.1.24

func RunJust(version string, opts ulog.Options, fn func())

func RunPre added in v0.7.28

func RunPre[UserConf any](version string, pre func() bool, fn func(UserConf))

func WaitFor added in v0.7.8

func WaitFor(log *ulog.Log, fn func() bool, timeout time.Duration) time.Duration

func WaitInterrupt added in v0.1.51

func WaitInterrupt()

func Waited added in v0.2.73

func Waited(ts time.Time) time.Duration

Types

type Conf

type Conf struct {
	LogLevel     string
	LogDir       string
	LogFile      string
	LogConsole   bool
	LogGoID      bool
	LogTimezone  string
	LogFileSize  string
	LogFileTime  string
	LogDaysCount int
	LogTotalSize string
}

func (*Conf) Log

func (o *Conf) Log() ulog.Options

type GoSwarm added in v0.2.4

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

func NewGoSwarm added in v0.2.4

func NewGoSwarm() *GoSwarm

func (*GoSwarm) Add added in v0.2.4

func (o *GoSwarm) Add(fn func()) *GoSwarm

func (*GoSwarm) Wait added in v0.2.4

func (o *GoSwarm) Wait()

func (*GoSwarm) WithLog added in v0.2.4

func (o *GoSwarm) WithLog(log *ulog.Log) *GoSwarm

type GoSwarmLimit added in v0.2.84

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

func NewGoSwarmLimit added in v0.2.84

func NewGoSwarmLimit() *GoSwarmLimit

func (*GoSwarmLimit) Add added in v0.2.84

func (o *GoSwarmLimit) Add(fn func()) *GoSwarmLimit

func (*GoSwarmLimit) Execute added in v0.2.84

func (o *GoSwarmLimit) Execute(limit int)

func (*GoSwarmLimit) WithLog added in v0.2.84

func (o *GoSwarmLimit) WithLog(log *ulog.Log) *GoSwarmLimit

type Job added in v0.2.2

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

func NewJob added in v0.2.2

func NewJob() *Job

func (*Job) Cancel added in v0.2.2

func (o *Job) Cancel()

func (*Job) Do added in v0.2.2

func (o *Job) Do() bool

func (*Job) Loop added in v0.7.0

func (o *Job) Loop(fn func())

func (*Job) OnFinish added in v0.2.2

func (o *Job) OnFinish(fn func()) *Job

func (*Job) OnInit added in v0.2.2

func (o *Job) OnInit(fn func() error) *Job

func (*Job) OnNotRun added in v0.2.86

func (o *Job) OnNotRun(fn func()) *Job

func (*Job) OnStart added in v0.2.2

func (o *Job) OnStart(fn func()) *Job

func (*Job) Run added in v0.2.2

func (o *Job) Run(fn func())

func (*Job) Running added in v0.6.10

func (o *Job) Running() bool

func (*Job) Sleep added in v0.2.2

func (o *Job) Sleep(timeout time.Duration)

func (*Job) Stop added in v0.2.2

func (o *Job) Stop()

func (*Job) Tick added in v0.7.0

func (o *Job) Tick(fn func(), interval time.Duration)

func (*Job) Wait added in v0.2.2

func (o *Job) Wait()

func (*Job) WithLog added in v0.2.2

func (o *Job) WithLog(log *ulog.Log) *Job

func (*Job) WithLogLevel added in v0.2.2

func (o *Job) WithLogLevel(level ulog.Level) *Job

type Tick added in v0.7.0

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

func NewTick added in v0.7.0

func NewTick(fn func(), interval time.Duration) *Tick

func (*Tick) Do added in v0.7.0

func (o *Tick) Do()

func (*Tick) LastDuration added in v0.7.0

func (o *Tick) LastDuration() time.Duration

func (*Tick) LastTime added in v0.7.0

func (o *Tick) LastTime() time.Time

func (*Tick) Reset added in v0.7.0

func (o *Tick) Reset()

func (*Tick) WithEnable added in v0.7.0

func (o *Tick) WithEnable(v bool) *Tick

type Wait added in v0.2.73

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

func NewWait added in v0.7.8

func NewWait() *Wait

func (*Wait) Await added in v0.7.8

func (o *Wait) Await(ok func() bool, on func())

func (*Wait) Time added in v0.7.8

func (o *Wait) Time() time.Duration

func (*Wait) Wait added in v0.7.8

func (o *Wait) Wait(ok func() bool) *Wait

func (*Wait) Waited added in v0.7.8

func (o *Wait) Waited() bool

func (*Wait) WithDo added in v0.7.8

func (o *Wait) WithDo(do func() bool) *Wait

func (*Wait) WithLog added in v0.7.8

func (o *Wait) WithLog(log *ulog.Log) *Wait

func (*Wait) WithTimeout added in v0.7.8

func (o *Wait) WithTimeout(timeout time.Duration) *Wait

Jump to

Keyboard shortcuts

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