base

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BaseContext, Close = context.WithCancel(context.Background())
View Source
var HttpClient *resty.Client
View Source
var QuitWG = sync.WaitGroup{}

Functions

func IsFileLatest

func IsFileLatest(path string, latestUpdateTime time.Time) (ok bool, err error)

func RemoveCache

func RemoveCache() error

func WithTimeout

func WithTimeout(timeout time.Duration, f func() error) error

run with timeout when the timeout duration isn't zero run without timeout when the timeout duration is zero

Types

type StrippedReader

type StrippedReader struct {
	Inner *bufio.Reader
	// contains filtered or unexported fields
}

func (*StrippedReader) Read

func (r *StrippedReader) Read(p []byte) (int, error)

type User

type User struct {
	User *user.User
	Uid  uint32
	Gid  uint32
}
var (
	BuildUser User
	RunUser   User
)

func (*User) Init

func (u *User) Init(username string) error

func (*User) OwnMod

func (u *User) OwnMod(path string, mode os.FileMode) error

func (*User) Run

func (u *User) Run(cmd *exec.Cmd) error

func (*User) RunWithTimeout

func (u *User) RunWithTimeout(cmd *exec.Cmd, timeout time.Duration) error

Jump to

Keyboard shortcuts

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