utils

package
v0.0.2-0...-22ffb4e Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2020 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const EncKeySize = 32

Variables

This section is empty.

Functions

func AddSchemes

func AddSchemes(opt *client.Options, gv schema.GroupVersion, types ...runtime.Object)

func ApiServiceName

func ApiServiceName() string

func CheckAndCreateObject

func CheckAndCreateObject(obj interface{}, parent metav1.Object, c client.Client, scheme *runtime.Scheme, deleteFirst bool) error

func Client

func Client(options client.Options) (client.Client, error)

func DecryptPassword

func DecryptPassword(s string) (string, error)

func DirExists

func DirExists(path string) bool

func EncryptPassword

func EncryptPassword(str string) (string, error)

func FileExists

func FileExists(path string) bool

func GetTupLogger

func GetTupLogger(subresource interface{}, resNamespace, resName string) logr.Logger

func IsEncrypted

func IsEncrypted(s string) bool

func Namespace

func Namespace() (string, error)

func RandString

func RandString(n int) string

func RespondError

func RespondError(w http.ResponseWriter, code int, msg string) error

func RespondJSON

func RespondJSON(w http.ResponseWriter, data interface{}) error

Types

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
}

type TupLogger

type TupLogger struct {
	// contains filtered or unexported fields
}

func NewTupLogger

func NewTupLogger(subresource interface{}, resNamespace, resName string) *TupLogger

func (*TupLogger) Error

func (r *TupLogger) Error(err error, msg string, keysAndValues ...interface{})

func (*TupLogger) Info

func (r *TupLogger) Info(msg string, keysAndValues ...interface{})

Jump to

Keyboard shortcuts

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