util

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0 Imports: 34 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OSToOSTypeMap map[string]params.OSType = map[string]params.OSType{
		"almalinux":  params.Linux,
		"alma":       params.Linux,
		"alpine":     params.Linux,
		"archlinux":  params.Linux,
		"arch":       params.Linux,
		"centos":     params.Linux,
		"ubuntu":     params.Linux,
		"rhel":       params.Linux,
		"suse":       params.Linux,
		"opensuse":   params.Linux,
		"fedora":     params.Linux,
		"debian":     params.Linux,
		"flatcar":    params.Linux,
		"gentoo":     params.Linux,
		"rockylinux": params.Linux,
		"rocky":      params.Linux,
		"windows":    params.Windows,
	}
)

Functions

func Aes256DecodeString

func Aes256DecodeString(target []byte, passphrase string) (string, error)

func Aes256EncodeString

func Aes256EncodeString(target string, passphrase string) ([]byte, error)

func CompressData

func CompressData(data []byte) ([]byte, error)

func ConvertFileToBase64

func ConvertFileToBase64(file string) (string, error)

func GetCloudConfig

func GetCloudConfig(bootstrapParams params.BootstrapInstance, tools github.RunnerApplicationDownload, runnerName string) (string, error)

func GetLoggingWriter

func GetLoggingWriter(cfg *config.Config) (io.Writer, error)

GetLoggingWriter returns a new io.Writer suitable for logging.

func GetRandomString

func GetRandomString(n int) (string, error)

GetRandomString returns a secure random string

func IsAlphanumeric

func IsAlphanumeric(s string) bool

func IsValidEmail

func IsValidEmail(email string) bool

IsValidEmail returs a bool indicating if an email is valid

func NewID

func NewID() string

func NewLoggingMiddleware

func NewLoggingMiddleware(writer io.Writer) func(http.Handler) http.Handler

func OSToOSType

func OSToOSType(os string) (params.OSType, error)

func PaswsordToBcrypt

func PaswsordToBcrypt(password string) (string, error)

PaswsordToBcrypt returns a bcrypt hash of the specified password using the default cost

func ResolveToGithubArch

func ResolveToGithubArch(arch string) (string, error)

ResolveToGithubArch returns the cpu architecture as it is defined in the GitHub tools download list. We use it to find the proper tools for the OS/Arch combo we're deploying.

func ResolveToGithubOSType

func ResolveToGithubOSType(osType string) (string, error)

ResolveToGithubArch returns the OS type as it is defined in the GitHub tools download list. We use it to find the proper tools for the OS/Arch combo we're deploying.

func ResolveToGithubTag

func ResolveToGithubTag(os params.OSType) (string, error)

ResolveToGithubTag returns the default OS tag that self hosted runners automatically (and forcefully) adds to every runner that gets deployed. We need to keep track of those tags internally as well.

func SanitizeLogEntry

func SanitizeLogEntry(entry string) string

func UTF16EncodedByteArrayFromString

func UTF16EncodedByteArrayFromString(s string) ([]byte, error)

func UTF16FromString

func UTF16FromString(s string) ([]uint16, error)

func UTF16ToString

func UTF16ToString(s []uint16) string

func Uint16ToByteArray

func Uint16ToByteArray(u []uint16) []byte

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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