eru_utils

package module
v0.0.0-...-6dc645d Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 18 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallHttp

func CallHttp(ctx context.Context, method string, url string, headers http.Header, formData map[string]string, reqCookies []*http.Cookie, params map[string]string, postBody interface{}) (res interface{}, respHeaders http.Header, respCookies []*http.Cookie, statusCode int, err error)

func CallParallelHttp

func CallParallelHttp(ctx context.Context, method string, url string, headers http.Header, formData map[string]string, reqCookies []*http.Cookie, params map[string]string, postBody interface{}, rc chan *http.Response) (err error)

func CloneInterface

func CloneInterface(ctx context.Context, i interface{}) (iClone interface{}, err error)

func CsvToMap

func CsvToMap(ctx context.Context, csvData [][]string, lowerCaseHeader bool) (jsonData []map[string]interface{}, err error)

func ExecuteDbFetch

func ExecuteDbFetch(ctx context.Context, db *sqlx.DB, query models.Queries) (output []map[string]interface{}, err error)

func ExecuteDbSave

func ExecuteDbSave(ctx context.Context, db *sqlx.DB, queries []*models.Queries) (output [][]map[string]interface{}, err error)

func ExecuteHttp

func ExecuteHttp(ctx context.Context, req *http.Request) (resp *http.Response, err error)

func ExecuteParallelHttp

func ExecuteParallelHttp(ctx context.Context, req *http.Request, rc chan *http.Response) (err error)

func GetArrayPosition

func GetArrayPosition(s []string, value string) int

func HTTPClientTransporter

func HTTPClientTransporter(rt http.RoundTripper) http.RoundTripper

func PrintRequestBody

func PrintRequestBody(ctx context.Context, request *http.Request, msg string)

func PrintResponseBody

func PrintResponseBody(ctx context.Context, response *http.Response, msg string)

func ReplaceUnderscoresWithDots

func ReplaceUnderscoresWithDots(str string) string

func SetStructValue

func SetStructValue(ctx context.Context, obj interface{}, propName string, propValue interface{})

func ValidateStruct

func ValidateStruct(ctx context.Context, s interface{}, parentKey string) error

Types

type DiffOutput

type DiffOutput struct {
	Path   string
	AddStr string
	DelStr string
}

type DiffReporter

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

func (*DiffReporter) Output

func (r *DiffReporter) Output() map[string]DiffOutput

func (*DiffReporter) PopStep

func (r *DiffReporter) PopStep()

func (*DiffReporter) PushStep

func (r *DiffReporter) PushStep(ps cmp.PathStep)

func (*DiffReporter) Report

func (r *DiffReporter) Report(rs cmp.Result)

func (*DiffReporter) String

func (r *DiffReporter) String() string

Jump to

Keyboard shortcuts

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