util

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: Apache-2.0 Imports: 12 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareFiles

func CompareFiles(fileone string, filetwo string) (bool, error)

CompareFiles will compare two files, byte by byte to see if they are equal

Args:

 fileone - first file to compare
 filetwo - second file to compare

Returns:
   bool and error

func CreateTempFile

func CreateTempFile(dirname string, filename string) (*os.File, error)

CreateTempFile will create temporary file

Args:

 dirname - dir name
 filename - file name

Returns:
   filename as string or error

func DetectContainerPortProtocol

func DetectContainerPortProtocol(protocol string) (v1.Protocol, error)

DetectContainerPortProtocol is a helper for users use only TCP or UDP string instead of require them to manage k8s.io/api/core/v1. This will convert TCP or UDP to v1.ProtocolTCP or v1.ProtocolUDP

Args:

protocol - TCP or UDP as string

Returns:

v1.ProtocolUDP, v1.ProtocolTCP or error

func DiffCommand

func DiffCommand(fileone string, filetwo string) ([]byte, error)

DiffCommand will diff two files

Args:

 fileone
 filtwo

Returns:
   bytes from the file or error

func DownloadFile

func DownloadFile(url string) (string, error)

DownloadFile will download a file specified as temporary file

Args:

 url - url to be download

Returns:
   path as string or error

func GenerateRandomString

func GenerateRandomString(numberOfChars int, modeString string) (string, error)

GenerateRandomString will generate a random string

Args:

	number of chars to be generated
	modeString lower or all

  Returns:
	random string

Types

This section is empty.

Jump to

Keyboard shortcuts

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