utils

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TempRoot string

Functions

func ExampleMutex

func ExampleMutex()

func LogDefer

func LogDefer(f func() error)

func LogError

func LogError(err error)

func LogFatal

func LogFatal(err error)

func RemoveTempRoot

func RemoveTempRoot() error

func TempClean

func TempClean(path string)

func TempDir

func TempDir() (string, error)

func TempFile

func TempFile() (*os.File, error)

Types

type Git

type Git interface {
	Fetch(dir string, repo string, branch string) (string, error)
}

func NewGit

func NewGit(repos map[string]*api.GitRepository) Git

type GitMock

type GitMock struct {
	mock.Mock
}

func NewGitMock

func NewGitMock() *GitMock

func (*GitMock) Fetch

func (m *GitMock) Fetch(dir string, repo string, branch string) (string, error)

type Mutex

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

A Mutex is a mutual exclusion lock which uses a channel as lock.

This Mutex can be used in select statement, whereas sync.Mutex cannot.

func NewMutex

func NewMutex() *Mutex

func (*Mutex) Lock

func (m *Mutex) Lock() chan interface{}

func (*Mutex) UnLock

func (m *Mutex) UnLock()

Jump to

Keyboard shortcuts

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