urun

package
v0.0.0-...-76c535a Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdExec

func CmdExec(cmdname string, cmdargs ...string) (string, string, error)

func CmdExecIn

func CmdExecIn(dir string, cmdname string, cmdargs ...string) (cmdout string, cmderr string, err error)

func CmdExecStdin

func CmdExecStdin(stdin string, dir string, cmdname string, cmdargs ...string) (stdout string, stderr string, err error)

func CmdTryStart

func CmdTryStart(cmdname string, cmdargs ...string) (err error)

func CmdsTryStart

func CmdsTryStart(cmds map[string]*CmdTry)

func SetupJsonIpcPipes

func SetupJsonIpcPipes(bufferCapacity int, withContentLen bool, needJsonOut bool) (stdin *bufio.Scanner, rawOut *bufio.Writer, jsonOut *json.Encoder)

func Using

func Using(l sync.Locker, do func())

func WaitOn

func WaitOn(funcs ...func())

func WaitOn_

func WaitOn_(funcs ...func())

Types

type CmdTry

type CmdTry struct {
	Args []string
	Ran  *bool
}

type MutexIf

type MutexIf struct {
	sync.Mutex
}

A `sync.Mutex` wrapper for convenient conditional `defer`d un/locking.

Example: `defer mut.UnlockIf(mut.LockIf(mycondition))`

func (*MutexIf) Lock

func (me *MutexIf) Lock() bool

func (*MutexIf) LockIf

func (me *MutexIf) LockIf(lock bool) bool

Calls `me.Lock` if `lock` is `true`, then returns `lock`.

func (*MutexIf) UnlockIf

func (me *MutexIf) UnlockIf(unlock bool)

Calls `me.Unlock` if `unlock` is `true`.

Jump to

Keyboard shortcuts

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