Documentation ¶
Index ¶
- Variables
- func Aes256Decode(target []byte, passphrase string) ([]byte, error)
- func Aes256DecodeString(target []byte, passphrase string) (string, error)
- func Aes256Encode(target []byte, passphrase string) ([]byte, error)
- func Aes256EncodeString(target string, passphrase string) ([]byte, error)
- func CompressData(data []byte) ([]byte, error)
- func ConvertFileToBase64(file string) (string, error)
- func GetLoggingWriter(logFile string) (io.Writer, error)
- func GetRandomString(n int) (string, error)
- func GetTools(osType params.OSType, osArch params.OSArch, ...) (params.RunnerApplicationDownload, error)
- func IsAlphanumeric(s string) bool
- func IsValidEmail(email string) bool
- func NewID() string
- func NewLoggingMiddleware(writer io.Writer) func(http.Handler) http.Handler
- func OSToOSType(os string) (params.OSType, error)
- func PaswsordToBcrypt(password string) (string, error)
- func ResolveToGithubArch(arch string) (string, error)
- func ResolveToGithubOSType(osType string) (string, error)
- func ResolveToGithubTag(os params.OSType) (string, error)
- func SanitizeLogEntry(entry string) string
- func Seal(data []byte, passphrase []byte) ([]byte, error)
- func UTF16EncodedByteArrayFromString(s string) ([]byte, error)
- func UTF16FromString(s string) ([]uint16, error)
- func UTF16ToString(s []uint16) string
- func Uint16ToByteArray(u []uint16) []byte
- func Unseal(data []byte, passphrase []byte) ([]byte, error)
- type Envelope
Constants ¶
This section is empty.
Variables ¶
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 CompressData ¶
func ConvertFileToBase64 ¶
func GetLoggingWriter ¶
GetLoggingWriter returns a new io.Writer suitable for logging.
func GetRandomString ¶
GetRandomString returns a secure random string
func GetTools ¶
func GetTools(osType params.OSType, osArch params.OSArch, tools []params.RunnerApplicationDownload) (params.RunnerApplicationDownload, error)
func IsAlphanumeric ¶
func IsValidEmail ¶
IsValidEmail returs a bool indicating if an email is valid
func NewLoggingMiddleware ¶
func PaswsordToBcrypt ¶
PaswsordToBcrypt returns a bcrypt hash of the specified password using the default cost
func ResolveToGithubArch ¶
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 ¶
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 ¶
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 Seal ¶
Seal will encrypt the given data using a derived key from the given passphrase. This function is meant to be used with small datasets like passwords, keys and secrets of any type, before they are saved to disk.