mutil

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const EmptyJson = "{}"
View Source
const FormHeader = "application/x-www-form-urlencoded;charset=utf-8"
View Source
const GET = "GET"
View Source
const JsonHeader = "application/json;charset=utf-8"
View Source
const POST = "POST"

Variables

View Source
var DateLocation *time.Location
View Source
var DateUtil = dateUtil{
	DateTimeFormat:           "2006-01-02 15:04:05",
	DateTimeNumber:           "20060102150405",
	DateTimeMillNumberFormat: "060102150405",
	TimeFormat:               "15:04:05",
	TimeFormatNumber:         "150405",
	DateFormat:               "2006-01-02",
	DateFormatNumber:         "20060102",
	CurrentLocation:          "Asia/Shanghai",
}
View Source
var EXTENSION = map[string]string{}/* 325 elements not displayed */
View Source
var FileUpload = &upload{}
View Source
var HeaderNames = &headerName{
	Accept:                        "accept",
	AcceptCharset:                 "accept-charset",
	AcceptEncoding:                "accept-encoding",
	AcceptLanguage:                "accept-language",
	AcceptRanges:                  "accept-ranges",
	AcceptPatch:                   "accept-patch",
	AcceptControlAllowCredentials: "access-control-allow-credentials",
	AcceptControlAllowHeaders:     "access-control-allow-headers",
	AcceptControlAllowMethods:     "access-control-allow-methods",
	AcceptControlAllowOrigin:      "access-control-allow-origin",
	AcceptControlExposeHeaders:    "access-control-expose-headers",
	AcceptControlMaxAge:           "access-control-max-age",
	AcceptControlRequestHeaders:   "access-control-request-headers",
	AcceptControlRequestMethod:    "access-control-request-method",
	Age:                           "age",
	Allow:                         "allow",
	Authorization:                 "authorization",
	CacheControl:                  "cache-control",
	Connection:                    "connection",
	ContentEncoding:               "content-encoding",
	ContentLanguage:               "content-language",
	ContentLength:                 "content-length",
	ContentLocation:               "content-location",
	ContentTransferEncoding:       "content-transfer-encoding",
	ContentDisposition:            "content-disposition",
	ContentMd5:                    "content-md5",
	ContentRange:                  "content-range",
	ContentSecurityPolicy:         "content-security-policy",
	ContentType:                   "content-type",
	Cookie:                        "cookie",
	Date:                          "date",
	Dnt:                           "dnt",
	Etag:                          "etag",
	Expect:                        "expect",
	Expires:                       "expires",
	From:                          "from",
	Host:                          "host",
	IfMatch:                       "if-match",
	IfNoneMatch:                   "if-none-match",
	IfRange:                       "if-range",
	IfUnmodifiedSince:             "if-unmodified-since",
	KeepAlive:                     "keep-alive",
	LastModified:                  "last-modified",
	Location:                      "location",
	MaxForwards:                   "max-forwards",
	Origin:                        "origin",
	Pragma:                        "pragma",
	ProxyAuthenticate:             "proxy-authenticate",
	ProxyAuthorization:            "proxy-authorization",
	ProxyConnection:               "proxy-connection",
	Range:                         "range",
	Referer:                       "referer",
	RetryAfter:                    "retry-after",
	SecWebsocketKey1:              "sec-websocket-key1",
	SecWebsocketKey2:              "sec-websocket-key2",
	SecWebsocketLocation:          "sec-websocket-location",
	SecWebsocketOrigin:            "sec-websocket-origin",
	SecWebsocketProtocol:          "sec-websocket-protocol",
	SecWebsocketVersion:           "sec-websocket-version",
	SecWebsocketKey:               "sec-websocket-key",
	SecWebsocketAccept:            "sec-websocket-accept",
	SecWebsocketExtensions:        "sec-websocket-extensions",
	Server:                        "server",
	SetCookie:                     "set-cookie",
	SetCookie2:                    "set-cookie2",
	Te:                            "te",
	Trailer:                       "trailer",
	TrailerEncoding:               "transfer-encoding",
	Upgrade:                       "upgrade",
	UpgradeInsecureRequests:       "upgrade-insecure-requests",
	UserAgent:                     "user-agent",
	Vary:                          "vary",
	Via:                           "via",
	Warning:                       "warning",
	WebsocketLocation:             "websocket-location",
	WebsocketOrigin:               "websocket-origin",
	WebsocketProtocol:             "websocket-protocol",
	WwwAuthenticate:               "www-authenticate",
	XFrameOptions:                 "x-frame-options",
	XRequestedWith:                "x-requested-with",
}
View Source
var NONE = "application/octet-stream"
View Source
var RandomUtil = &randomUtil{
	LowerCaseAZ: []string{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"},
	UpCaseAZ:    []string{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"},
	Number:      []string{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"},
	All: []string{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U",
		"V", "W", "X", "Y", "Z"},
}
View Source
var Strings = mstrings{}

Functions

func Extension

func Extension(suffix string) string

func IPGet

func IPGet(xForwardedFor string, remoteAddr string) string

func IPInner

func IPInner(ipAddr string) bool

func JSONClone

func JSONClone(input any, output any) error

func JSONTOString

func JSONTOString(data any) (jsonStr string, err error)

func LocalIP added in v0.0.8

func LocalIP() (net.IP, error)

func ReadBuffer

func ReadBuffer(reader io.Reader) (*bytes.Buffer, error)

func SendWebHookDingDing added in v0.0.8

func SendWebHookDingDing(url string, message DingTextMessage)

Types

type DingTextMessage added in v0.0.8

type DingTextMessage struct {
	ServerName string
	Method     string
	Url        string
	Message    string
}

type HttpRequest

type HttpRequest struct {
	Url     string
	Data    map[string]any
	Body    string
	UrlData map[string]string
	Method  string
	Header  map[string]string
}

func (*HttpRequest) GetUrl

func (domain *HttpRequest) GetUrl() (*http.Response, *bytes.Buffer, error)

func (*HttpRequest) PostForm

func (domain *HttpRequest) PostForm() (*http.Response, *bytes.Buffer, error)

func (*HttpRequest) PostJson

func (domain *HttpRequest) PostJson() (*http.Response, *bytes.Buffer, error)

func (*HttpRequest) SetHeader

func (domain *HttpRequest) SetHeader(headerName string, headerValue string)

type Response

type Response struct {
}

Jump to

Keyboard shortcuts

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