utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(src string, dst string, filter func(os.FileInfo) bool) error

func CopyFile

func CopyFile(src, dst string) error

func ExecCmds

func ExecCmds(ctx context.Context, callback func(*StdLine), cmds ...*exec.Cmd) error

func ParseCommandContext

func ParseCommandContext(context context.Context, command string) []*exec.Cmd

Types

type Environment

type Environment interface {
	IsTest() bool
	IsDev() bool
	IsDebugRace() bool
	DevServerURL() string
	GetExecutableFolder() string
}

func DetectEnvironment

func DetectEnvironment() Environment

type MutexBuilder

type MutexBuilder func() RWLocker

type RWLocker

type RWLocker interface {
	Lock()
	Unlock()
	RLock()
	RUnlock()
}

func GetMutex

func GetMutex(environment Environment) RWLocker

type StdLine

type StdLine struct {
	Type StdType
	Line string
}

type StdType

type StdType string
const StdTypeErr StdType = "stderr"
const StdTypeOut StdType = "stdout"

type ThreadSafeSlice

type ThreadSafeSlice struct {
	sync.Mutex
	Elements []interface{}
}

func (*ThreadSafeSlice) Find

func (slice *ThreadSafeSlice) Find(elem interface{}) interface{}

func (*ThreadSafeSlice) Push

func (slice *ThreadSafeSlice) Push(elem interface{})

func (*ThreadSafeSlice) Remove

func (slice *ThreadSafeSlice) Remove(elem interface{})

func (*ThreadSafeSlice) ToSlice

func (slice *ThreadSafeSlice) ToSlice() []interface{}

Jump to

Keyboard shortcuts

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