model

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	MarkedQueryMap    map[string]interface{}
	QueryKeysId       string
	QueryMapId        string
	MarkedPostDataMap map[string]interface{}
	PostDataId        string
	MarkedPath        string
	FragmentID        string
	PathId            string
	UniqueId          string
}

type Options

type Options struct {
	Headers  map[string]interface{}
	PostData string
}

type Request

type Request struct {
	URL             *URL
	Method          string
	Headers         map[string]interface{}
	PostData        string
	Filter          Filter
	Source          string
	RedirectionFlag bool
	Proxy           string
}

func GetRequest

func GetRequest(method string, URL *URL, options ...Options) Request

* 获取Request对象 可选设置headers和postData

func (*Request) FormatPrint

func (req *Request) FormatPrint()

* 完整格式化输出

func (*Request) NoHeaderId

func (req *Request) NoHeaderId() string

* 不加入Header的请求ID

func (*Request) PostDataMap

func (req *Request) PostDataMap() map[string]interface{}

* 返回POST请求数据解析后的map结构

支持 application/x-www-form-urlencoded 、application/json

如果解析失败,则返回 key: postDataStr 的map结构

func (*Request) QueryMap

func (req *Request) QueryMap() map[string][]string

* 返回GET请求参数解析后的map结构

func (*Request) SimpleFormat

func (req *Request) SimpleFormat() string

func (*Request) SimplePrint

func (req *Request) SimplePrint()

* 简要输出

func (*Request) UniqueId

func (req *Request) UniqueId() string

type URL

type URL struct {
	url.URL
}

func GetUrl

func GetUrl(_url string, parentUrls ...URL) (*URL, error)

func (*URL) FileExt

func (u *URL) FileExt() string

* 文件扩展名

func (*URL) FileName

func (u *URL) FileName() string

* 文件扩展名

func (*URL) NavigationUrl

func (u *URL) NavigationUrl() string

func (*URL) NoFragmentUrl

func (u *URL) NoFragmentUrl() string

* 返回不带Fragment的URL

func (*URL) NoQueryUrl

func (u *URL) NoQueryUrl() string

* 返回去掉请求参数的URL

func (*URL) NoSchemeFragmentUrl

func (u *URL) NoSchemeFragmentUrl() string

func (*URL) ParentPath

func (u *URL) ParentPath() string

* 回去上一级path, 如果当前就是root path,则返回空字符串

func (*URL) QueryMap

func (u *URL) QueryMap() map[string]interface{}

func (*URL) RootDomain

func (u *URL) RootDomain() string

* 返回根域名

如 a.b.c.360.cn 返回 360.cn

Jump to

Keyboard shortcuts

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