wzlib_utils

package
v0.0.0-...-2af49ae Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: MIT Imports: 15 Imported by: 12

Documentation

Index

Constants

View Source
const (
	EX_OK          = 0  // successful termination
	EX_GENERIC     = 1  // generic error
	EX_USAGE       = 64 // command line usage error
	EX_NOUSER      = 67 // addressee unknown
	EX_UNAVAILABLE = 69 // service unavailable
	EX_SOFTWARE    = 70 // internal software error
	EX_CANTCREAT   = 73 // can't create (user) output file
	EX_TEMPFAIL    = 75 // temp failure; user is invited to retry
	EX_NOPERM      = 77 // permission denied
)

Variables

This section is empty.

Functions

func Ba65Str

func Ba65Str(data [65]byte) string

Ba65Str -- Byte Array of 65 to String extracts a C string from null-terminated array

func FileContentType

func FileContentType(out *os.File) (string, error)

FileContentType detects the content type via http. If unable to detect a proper one, "application/octet-stream" is returned.

func FileContentTypeByPath

func FileContentTypeByPath(pth string) (string, error)

FileContentTypeByPath is a convenience alias to FileContentType to handle paths in strings.

func FileExists

func FileExists(filename string) bool

FileExists checks if file... well, exists.

func RemovePrefix

func RemovePrefix(pth string, pref string) string

RemovePrefix path from a path with necessary cleaning

Types

type WzContainer

type WzContainer struct {
	wzlib_logger.WzLogger
	// contains filtered or unexported fields
}

WzContainer struct

func NewWzContainer

func NewWzContainer(conf *WzContainerParam) *WzContainer

NewWzContainer class

func (*WzContainer) Container

func (c *WzContainer) Container() (string, string, error)

Container runner

func (*WzContainer) ParsePkArgs

func (c *WzContainer) ParsePkArgs(pa string) *WzContainerParam

ParsePkArgs parses packed ":" separated args TODO: probably move to base64 instead

func (*WzContainer) Run

func (c *WzContainer) Run() (string, string, error)

Run a command in its own container

type WzContainerParam

type WzContainerParam struct {
	Root    string
	Debug   bool
	Command string
	Args    []string
}

WzContainerParam object

type WzMachineIDUtil

type WzMachineIDUtil struct {
	wzlib_logger.WzLogger
	// contains filtered or unexported fields
}

WzMachineIDUtil object to keep/read/create machine-id

func (*WzMachineIDUtil) GetMachineId

func (wmid *WzMachineIDUtil) GetMachineId() string

GetMachineId always returns machine-id If machine-id is not present, it will be copied from an existing one or generated, if no dbus found.

func (WzMachineIDUtil) SetupMachineIdUtil

func (WzMachineIDUtil) SetupMachineIdUtil(filePath string)

SetupMachineIdUtil setting up the Utility

type WzMachineIDUtilConsumer

type WzMachineIDUtilConsumer struct{}

func (WzMachineIDUtilConsumer) GetMachineIdUtil

func (wzid WzMachineIDUtilConsumer) GetMachineIdUtil() *WzMachineIDUtil

GetMAchineIdUtil returns machine ID instance

Jump to

Keyboard shortcuts

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