utils

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Copyright (C) 2021-2023, Kubefirst

This program is licensed under MIT. See the LICENSE file for more details.

Index

Constants

This section is empty.

Variables

View Source
var BackupResolver = &net.Resolver{
	PreferGo: true,
	Dial: func(ctx context.Context, network, address string) (net.Conn, error) {
		d := net.Dialer{
			Timeout: time.Millisecond * time.Duration(10000),
		}
		return d.DialContext(ctx, network, "8.8.8.8:53")
	},
}

Functions

func CreateK1Directory

func CreateK1Directory(clusterName string)

CreateK1Directory

func FindStringInSlice

func FindStringInSlice(s []string, str string) bool

FindStringInSlice takes []string and returns true if the supplied string is in the slice.

func ReadFileContentType

func ReadFileContentType(filePath string) (string, error)

ReadFileContentType reads a file on the OS and returns its file type

func ReadFileContents

func ReadFileContents(filePath string) (string, error)

ReadFileContents reads a file on the OS and returns its contents as a string

func RemoveFromSlice

func RemoveFromSlice[T comparable](slice []T, i int) []T

RemoveFromSlice accepts T as a comparable slice and removed the index at i - the returned value is the slice without the indexed entry

func ScheduledGitopsCatalogUpdate

func ScheduledGitopsCatalogUpdate()

ScheduledGitopsCatalogUpdate

func ValidateAuthenticationFields

func ValidateAuthenticationFields(s map[string]string) error

ValidateAuthenticationFields checks a map[string]string returned from looking up an authentication Secret for missing fields

Types

This section is empty.

Jump to

Keyboard shortcuts

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