gateway

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommonUtilRequest

func CommonUtilRequest(info *RequestInfo) (int, []byte, error)

CommonUtilRequest common get http/https request

func GetLocalIP

func GetLocalIP() (string, error)

GetLocalIP returns the non loop back local IP of the host

func HealthAndReadinessProvider

func HealthAndReadinessProvider(address string, cert, key []byte)

HealthAndReadinessProvider get and create the health and readiness provider

func ReplaceIP

func ReplaceIP(org, newIP, defaultPort string) string

ReplaceIP address of org

Types

type FakeResponseWriter

type FakeResponseWriter struct{}

FakeResponseWriter for the unit test

func (FakeResponseWriter) Header

func (f FakeResponseWriter) Header() http.Header

Header fake header method

func (FakeResponseWriter) Write

func (f FakeResponseWriter) Write(_ []byte) (int, error)

Write fake method

func (FakeResponseWriter) WriteHeader

func (f FakeResponseWriter) WriteHeader(_ int)

WriteHeader fake method

type RequestInfo

type RequestInfo struct {
	Method       string
	Path         string
	Body         interface{}
	IsFile       bool
	HeaderAdder  map[string]string
	HeaderSetter map[string]string
	CaCrt        string
	ClientCrt    string
	ClientKey    string
	Skip         bool
}

RequestInfo of the http or https request

Jump to

Keyboard shortcuts

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