util

package
v0.0.0-...-71879e5 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetENV

func GetENV(key string, defaultValue string) string

func Pointer

func Pointer[T any](value T) *T

Pointer

Types

type HTTPTestRequest

type HTTPTestRequest struct {
	// common
	Method string

	// server
	ServedURL   string
	HandleFuncs []gin.HandlerFunc

	// client
	RequestURLWithParams string
	Payload              map[string]interface{}
	Header               http.Header
}

HTTPTestRequest defines the request for testing.

type HTTPTestResponse

type HTTPTestResponse struct {
	StatusCode int
	Body       []byte
}

HTTPTestResponse defines the response for testing.

func HTTPTest

func HTTPTest(req HTTPTestRequest) (*HTTPTestResponse, error)

PostForTest sends a POST request to the given URL with the given body and the given header. Put the route handler functions to last handleFuncs

Jump to

Keyboard shortcuts

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