utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToBytes

func ConvertToBytes(inputStr string) (uint64, error)

func Exists

func Exists(path string) bool

func FormatURL

func FormatURL(url string, entries ...string) string

func GetEnv

func GetEnv(envName string, defaultValue string) string

func GetPath

func GetPath(paths []string) string

func HttpExecuteUserAuth

func HttpExecuteUserAuth(httpClient *http.Client, requestType string, requestURL string, user string, password string, rawPayload interface{}) (*http.Response, error)

func MarshalAndRecord

func MarshalAndRecord(object interface{}, dir string, fileName string) error

func MkDir

func MkDir(path string) error

func ReadAndUnmarshal

func ReadAndUnmarshal(object interface{}, dir string, fileName string) error

func ReadFile

func ReadFile(path string) (content []byte, err error)

func StringInSlice

func StringInSlice(a string, list []string) bool

func Unmarshal

func Unmarshal(r *http.Request, object interface{}) error

func UnmarshalDataFromRequest

func UnmarshalDataFromRequest(r *http.Request, object interface{}) error

func UnmarshalResponse

func UnmarshalResponse(r *http.Response, object interface{}) error

func WriteFile

func WriteFile(path string, content []byte) error

func WriteResponse

func WriteResponse(w http.ResponseWriter, code int, object interface{})

Types

This section is empty.

Jump to

Keyboard shortcuts

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