utils

package
v0.0.0-...-1afc026 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvParser

func EnvParser(b []byte) ([]byte, error)

EnvParser .

func ExitCoder

func ExitCoder(f func(*cli.Context) error) func(*cli.Context) error

ExitCoder wraps a cli Action function into a function with ExitCoder interface

func GenerateFileOptions

func GenerateFileOptions(c *cli.Context) (map[string][]byte, map[string]*corepb.FileMode, map[string]*corepb.FileOwner)

GenerateFileOptions returns file options

func GetHostname

func GetHostname() string

GetHostname .

func GetNetworks

func GetNetworks(network string) map[string]string

GetNetworks returns a networkmode -> ip map

func GetSpecFromRemote

func GetSpecFromRemote(uri string) ([]byte, error)

GetSpecFromRemote gets specs from a remote position

func NewCoreRPCClient

func NewCoreRPCClient(c *cli.Context) (corepb.CoreRPCClient, error)

NewCoreRPCClient returns an RPC client to use it actually wraps the GetRPCClient method

func ParseExtraResources

func ParseExtraResources(c *cli.Context) (map[string]any, error)

ParseExtraResources .

func ParseRAMInHuman

func ParseRAMInHuman(ram string) (int64, error)

ParseRAMInHuman returns int value in bytes of a human readable string e.g. 100KB -> 102400

func ReadAllFiles

func ReadAllFiles(files []string) map[string]*types.LinuxFile

ReadAllFiles open each pair in files and returns a map with key as dstfile, value as linux file files: list of srcfile:dstfile:mode:uid:gid

func SplitEquality

func SplitEquality(elements []string) map[string]string

SplitEquality transfers a list of aaa=bbb, xxx=yyy into {aaa:bbb, xxx:yyy}

func SplitFiles

func SplitFiles(files []string) map[string]string

SplitFiles transfers a list of src:dst to {src: dst}

Types

This section is empty.

Jump to

Keyboard shortcuts

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