dvnet

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogFatal   = 0
	LogError   = 1
	LogWarning = 2
	LogInfo    = 3
	LogDetail  = 4
	LogDebug   = 5
	LogTrace   = 6
)
View Source
const (
	KindTcpForward   = 1
	KindDbConnection = 2
)

Variables

View Source
var AveragePersistentOptions = map[string]interface{}{
	"repeats": 0,
	"pause":   5,
}
View Source
var KeepAliveNetPool = float64(keepAliveDefault)
View Source
var Log = LogError
View Source
var NetPool = make(map[string][]*NetPoolItem)

Functions

func CloseNetConn

func CloseNetConn(conn *net.Conn)

func CloseNetConnPoolForId

func CloseNetConnPoolForId(id string)

func CloseNetPoolItem

func CloseNetPoolItem(item *NetPoolItem)

func CloseNetPoolItemAtIndex

func CloseNetPoolItemAtIndex(id string, index int)

func CreateHeadersForLog added in v1.0.2

func CreateHeadersForLog(headers http.Header) string

func CreateRequestInfoForLog added in v1.0.2

func CreateRequestInfoForLog(method string, url string, body string, headers http.Header) string

func CreateStringArrayForLog added in v1.0.2

func CreateStringArrayForLog(v []string) string

func Forward

func Forward(host string, targetHost string)

func ForwardClose

func ForwardClose(id string)

func GetAveragePersistentOptions

func GetAveragePersistentOptions() map[string]interface{}

func GetForwardId

func GetForwardId(host string, targetHost string) (string, string, string)

func GetIntegerOption

func GetIntegerOption(options map[string]interface{}, name string, defValue int) int

func InitBySettings

func InitBySettings(parameters map[string]string, functionPool map[string]interface{})

func LoadStruct

func LoadStruct(method string, url string, body string, headers map[string]string, v interface{}, options map[string]interface{}) error

func LoadStructFormUrlEncoded

func LoadStructFormUrlEncoded(method string, url string, body interface{}, headers map[string]string, v interface{}, options map[string]interface{}) error

func NewJsonRequest

func NewJsonRequest(method string, url string, body string, headers map[string]string, options map[string]interface{}) ([]byte, error, http.Header, int)

func NewRequest

func NewRequest(method string, url string, body string, headers map[string]string, options map[string]interface{}) ([]byte, error, http.Header, int)

func NewRequestRepeatPause added in v1.0.2

func NewRequestRepeatPause(method string, url string, body string, headers map[string]string, options map[string]interface{}, repeats int, pause int) ([]byte, error, http.Header, int)

func StopAllForwarding

func StopAllForwarding()

func StopForwardingByHostTarget

func StopForwardingByHostTarget(host string, target string)

func UpdatePropertiesThruNetRequest

func UpdatePropertiesThruNetRequest(request string) error

func UrlEncodedPart

func UrlEncodedPart(data interface{}) string

func ValidateHostTargetForPortForwarding

func ValidateHostTargetForPortForwarding(host string, target string) bool

Types

type NetPoolItem

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

func PlaceToNetPool

func PlaceToNetPool(id string, client *net.Conn, target *net.Conn, kind int) *NetPoolItem

Jump to

Keyboard shortcuts

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