helpers

package
v0.0.0-...-0b10f05 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: GPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HasEnv    = hasEnv
	HasCGroup = hasCGroup
	InDocker  = inDocker
	HasSocket = hasSocket
)
View Source
var DownloadFile = downloadFile
View Source
var LookUPIP func(host string) ([]net.IP, error) = net.LookupIP

Functions

func CheckPath

func CheckPath(path string) bool

func CheckPathPart

func CheckPathPart(part string) (ok bool, isVarData []string)

func DurationToString

func DurationToString(in time.Duration) string

func GetIP

func GetIP(r *http.Request) string

func GrabIPFromURL

func GrabIPFromURL(in string) string

func IntSliceToStringSlice

func IntSliceToStringSlice(in []int) []string

func InterfaceSliceToIntSlice

func InterfaceSliceToIntSlice(in []interface{}) ([]int, error)

func InterfaceSliceToStringSlice

func InterfaceSliceToStringSlice(in []interface{}) []string

func MapStringInterfaceToMapStringString

func MapStringInterfaceToMapStringString(in map[string]interface{}) map[string]string

func RandStr

func RandStr(length int) string

func ResetDockerFunctions

func ResetDockerFunctions()

func StringSliceToIntSlice

func StringSliceToIntSlice(in []string) []int

func StringToDuration

func StringToDuration(in string) (time.Duration, error)

func StringToIntSlice

func StringToIntSlice(in string) ([]int, error)

func StringToStringMap

func StringToStringMap(in []byte) (map[string]interface{}, error)

func StringToStringSlice

func StringToStringSlice(in string) []string

Types

type Locker

type Locker struct {
	Label string
	// contains filtered or unexported fields
}

func (*Locker) Check

func (m *Locker) Check() bool

func (*Locker) Down

func (m *Locker) Down()

func (*Locker) Up

func (m *Locker) Up()

func (*Locker) Wait

func (m *Locker) Wait(timeout time.Duration) bool

type ServiceKeyCheckInterface

type ServiceKeyCheckInterface interface {
	CheckKey(key string) bool
	CheckIP(ipAddress string) bool
}

func GRPCAccessChecker

func GRPCAccessChecker(ctx context.Context, getByBaseID func(baseID string) ServiceKeyCheckInterface, systemLabel string) (ServiceKeyCheckInterface, string)

type UpdateProgress

type UpdateProgress struct {
	Step  int
	Total int
	Info  string
}

type WriteCounter

type WriteCounter struct {
	FileSize       uint64
	Total          uint64
	ReportProgress func(wc *WriteCounter)
}

func (*WriteCounter) Write

func (wc *WriteCounter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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