utils

package
v0.0.0-...-8851296 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLogger

func CreateLogger(name string) *log.Logger

CreateLogger creates a new Logger

func ExtractParamsFromURL

func ExtractParamsFromURL(r *http.Request, varName string) string

func ExtractVarsFromRequest

func ExtractVarsFromRequest(r *http.Request, varName string) string

func FormatURL

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

func GetFromHeader

func GetFromHeader(r *http.Request, header string) string

func GetTimestamp

func GetTimestamp(logger *log.Logger, timestampFile string) (string, error)

func HttpExecute

func HttpExecute(logger *log.Logger, httpClient *http.Client, requestType string, requestURL string, rawPayload interface{}) (*http.Response, error)

func HttpExecuteWithHeader

func HttpExecuteWithHeader(logger *log.Logger, httpClient *http.Client, requestType string, requestURL string, headers map[string]string) (*http.Response, error)

func LoadConfig

func LoadConfig(logger *log.Logger) (resources.Config, error)

func PeristsTimestamp

func PeristsTimestamp(logger *log.Logger, timestamp string, file string) error

func PrepareDataContractTypesForFeeding

func PrepareDataContractTypesForFeeding(logger *log.Logger, data []ccResources.DataContractType) ([]resources.Data, error)

func ReadAndUnmarshalFile

func ReadAndUnmarshalFile(logger *log.Logger, file string, object interface{}) error

func ReadFile

func ReadFile(logger *log.Logger, file string) ([]byte, error)

func Unmarshal

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

func UnmarshalDataFromRequest

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

func UnmarshalResponse

func UnmarshalResponse(ctx context.Context, logger *log.Logger, r *http.Response, object interface{}) 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