biz

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PprofStrFmt = "%s -no_browser=true -http=0.0.0.0:%d %s"
	Trace       = "go tool trace"
	TraceStrFmt = "%s -http=0.0.0.0:%d %s"
)
View Source
const (
	Redirect        = "redirect"
	ReadFile        = "readFile"
	RouteDefault    = RouteDefaultPre + "/%s/"
	RouteDefaultPre = "/dat"
	RouteTrace      = RouteTracePre + "/%s/"
	RouteTracePre   = "/eat"
)

Variables

View Source
var (
	Pprof            = "go tool pprof" // pprof
	LifeTime   int64 = 60 * 30         // 30 min
	TimerCheck       = 60
	RunEnv     string
)

Functions

func GetAbsDir

func GetAbsDir(string2 string) string

func GetPType

func GetPType(dir string) (route string, opt string)

func GetRelDir

func GetRelDir(string2 string) string

func IsFileExist

func IsFileExist(path string) bool

func IsLocal

func IsLocal() bool

func SetStorageDir

func SetStorageDir(dir string) (abs string, err error)

Types

type Proxy

type Proxy struct {
	Port     int
	PortLock sync.Mutex
	CmdOut   bytes.Buffer
	CmdErr   bytes.Buffer

	Cmd *exec.Cmd
	// contains filtered or unexported fields
}

func NewProxy

func NewProxy(dir string) *Proxy

func (*Proxy) Close

func (p *Proxy) Close()

func (*Proxy) GetCanUsePort

func (p *Proxy) GetCanUsePort() (res int, err error)

func (*Proxy) UpdateUseTime

func (p *Proxy) UpdateUseTime()

type ProxyUseCase

type ProxyUseCase struct {
	// contains filtered or unexported fields
}
var Puc *ProxyUseCase

func NewProxyUseCase

func NewProxyUseCase() *ProxyUseCase

func (*ProxyUseCase) CloseAll

func (puc *ProxyUseCase) CloseAll()

func (*ProxyUseCase) GetPortByDir

func (puc *ProxyUseCase) GetPortByDir(string2 string) (port int, err error)

func (*ProxyUseCase) GetProxy

func (puc *ProxyUseCase) GetProxy(dir string) *Proxy

func (*ProxyUseCase) Remove

func (puc *ProxyUseCase) Remove(dir string)

func (*ProxyUseCase) Timer

func (puc *ProxyUseCase) Timer()

Jump to

Keyboard shortcuts

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