util

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: MIT Imports: 20 Imported by: 2

Documentation

Index

Constants

View Source
const (
	SyncerWaitModeCancel = 1
	SyncerWaitModeIdle   = 2
	SyncerWaitModeAny    = 3
)
View Source
const (
	TickWorkerModeQuit     = 1
	TickWorkerModeNextTick = 2
	TickWorkerModeContinue = 3
)
View Source
const (
	FilesOfDay = 0
	DirsOfDay  = 1
)

Variables

This section is empty.

Functions

func ContextRet added in v0.1.6

func ContextRet(ctx context.Context) gilix.RET

func CreateSyncerGroup

func CreateSyncerGroup(ctx context.Context, syncers ...**Syncer)

func TickWorker

func TickWorker(ctx context.Context, d time.Duration, fworker func() TickWorkerMode, fdone func(ctxRet gilix.RET))

func WaitReleaseSyncerGroup

func WaitReleaseSyncerGroup(act SyncerWaitMode, syncers ...*Syncer)

Types

type Proct added in v0.1.3

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

func NewProct added in v0.1.3

func NewProct(ctx context.Context) *Proct

func (*Proct) AddCmd added in v0.1.3

func (p *Proct) AddCmd(n string, f ProctCb, path string, args ...string)

func (*Proct) Wait added in v0.1.3

func (p *Proct) Wait()

type ProctCb added in v0.1.3

type ProctCb func(*ProctCmd)

type ProctCmd added in v0.1.3

type ProctCmd struct {
	N string
	I int
	C *exec.Cmd
	E error
	// contains filtered or unexported fields
}

func (*ProctCmd) WithPid added in v0.1.9

func (cmd *ProctCmd) WithPid() *ProctCmd

type Syncer

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

func CreateSyncer

func CreateSyncer(ctx context.Context) *Syncer

func CreateSyncerWithSig

func CreateSyncerWithSig(ctx context.Context) *Syncer

func (*Syncer) Async

func (syncer *Syncer) Async(fSync func(), fBreak func())

func (*Syncer) Ctx added in v0.1.3

func (syncer *Syncer) Ctx() context.Context

func (*Syncer) DeriveSyncer

func (syncer *Syncer) DeriveSyncer() *Syncer

func (*Syncer) Sync

func (syncer *Syncer) Sync(fSync func(), fBreak func())

func (*Syncer) WaitRelease

func (syncer *Syncer) WaitRelease(act SyncerWaitMode)

type SyncerWaitMode added in v0.1.4

type SyncerWaitMode int

type Sysrw

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

func CreateSysrw

func CreateSysrw(cnn net.Conn, rcap int) *Sysrw

func (*Sysrw) Read

func (sys *Sysrw) Read() (string, []byte, error)

func (*Sysrw) Write

func (sys *Sysrw) Write(fun string, data []byte) error

type Task

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

func CreateTask

func CreateTask(w Worker) *Task

func CreateTaskStart

func CreateTaskStart(w Worker) *Task

func (*Task) Put

func (task *Task) Put(data interface{}, ctx interface{})

func (*Task) Start

func (task *Task) Start()

func (*Task) Stop

func (task *Task) Stop()

type TickWorkerMode added in v0.1.6

type TickWorkerMode int

type Worker

type Worker func(data interface{}, ctx interface{})

type Zapt

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

func ZaptByCfg added in v0.1.11

func ZaptByCfg(category int, mod string, file string) *Zapt

func (*Zapt) DPanicf

func (zapt *Zapt) DPanicf(template string, args ...interface{})

func (*Zapt) Debugf

func (zapt *Zapt) Debugf(template string, args ...interface{})

func (*Zapt) Errorf

func (zapt *Zapt) Errorf(template string, args ...interface{})

func (*Zapt) Fatalf

func (zapt *Zapt) Fatalf(template string, args ...interface{})

func (*Zapt) Infof

func (zapt *Zapt) Infof(template string, args ...interface{})

func (*Zapt) Panicf

func (zapt *Zapt) Panicf(template string, args ...interface{})

func (*Zapt) Warnf

func (zapt *Zapt) Warnf(template string, args ...interface{})

type ZaptDayMode

type ZaptDayMode int

Jump to

Keyboard shortcuts

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