utils

package
v0.0.0-...-ada06ba Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(slice []string, s string) bool

Contains checks slice contains `s` string

func ConvertJson2Map

func ConvertJson2Map(js []byte) (map[string]string, error)

ConvertJson2Map converts []byte to map[string]string

func GetEnv

func GetEnv(envKey, defaultValue string) string

GetEnv retrieves ENV variable, fallback if not set

func GetHomeDir

func GetHomeDir() string

GetHomeDir retrieves Home on Linux

func IsDifferent

func IsDifferent(x interface{}, y interface{}) error

IsDifferent compares x and y interfaces with deep equal

func WriteToFile

func WriteToFile(data []byte, file string) error

WriteToFile write the []byte to the given file

Types

type NopHandler

type NopHandler struct{}

NopHandler is an empty handler to help net/http -> Gin conversions

func (NopHandler) ServeHTTP

func (h NopHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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