models

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IPCheck

func IPCheck(thisip string, ips []string) bool

IPCheck 检查 ip 是否在特定的 ip 地址范围内

func InSliceStr

func InSliceStr(str string, slice []string) bool

func InSliceStrFuzzy

func InSliceStrFuzzy(str string, slice []string) bool

Types

type DataReq

type DataReq struct {
	Meta   DataReqMeta       `json:"meta"`
	Header map[string]string `json:"header"`
	Body   string            `json:"body"`
}

type DataReqMeta

type DataReqMeta struct {
	Method string `json:"method"`
	Path   string `json:"path"`
	Proto  string `json:"proto"`
	Host   string `json:"host"`
}

type DataResp

type DataResp struct {
	Meta   DataRespMeta      `json:"meta"`
	Header map[string]string `json:"header"`
	Body   string            `json:"body"`
}

type DataRespMeta

type DataRespMeta struct {
	Proto  string `json:"proto"`
	Status string `json:"status"`
}

type Example

type Example struct {
	Curl string `json:"curl"`
}

type Resp

type Resp struct {
	Request  DataReq     `json:"request"`
	Response DataResp    `json:"response"`
	RawJson  interface{} `json:"rawjson"`
	Example  Example     `json:"example"`
}

func HandleRequest

func HandleRequest(method, apiAddr, userAgent, reqBody string, timeout int, inputReqHeader map[string]string) (res Resp, err error)

Jump to

Keyboard shortcuts

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