Documentation
¶
Index ¶
- Constants
- Variables
- func BasicAuthHeader(username, password string) string
- func ComputeWebSocketAcceptKey(challengeKey string) string
- func MatchError(err, other error) bool
- type ContentEncoding
- type ContentType
- type Cookie
- type CookieJar
- func (jar *CookieJar) Cookies(url *Url) iter.Seq[Cookie]
- func (jar *CookieJar) GetCookie(url *Url, name string) *Cookie
- func (jar *CookieJar) SetCookie(url *Url, cookie Cookie)
- func (jar *CookieJar) SetCookies(url *Url, cookies []Cookie)
- func (jar *CookieJar) SetCookiesIter(url *Url, cookies iter.Seq[Cookie])
- type CookieSameSite
- type Form
- type GigletError
- type GigletOp
- type Header
- func (header *Header) All() iter.Seq2[string, string]
- func (header *Header) Bytes() []byte
- func (header *Header) CookieHeaderBytes() []byte
- func (header *Header) Cookies() iter.Seq[Cookie]
- func (header *Header) Del(name string)
- func (header *Header) DelCookie(name string)
- func (header *Header) Get(name string) string
- func (header *Header) GetCookie(name string) *Cookie
- func (header *Header) Has(name string) bool
- func (header *Header) HasCookie(name string) bool
- func (header *Header) Set(name, value string)
- func (header *Header) SetCookie(cookie Cookie)
- func (header *Header) SetCookieHeaderBytes() []byte
- func (header *Header) SetCookieValue(name, value string)
- type HttpMethod
- type Query
- type ReadOnlyHeader
- func (header *ReadOnlyHeader) All() iter.Seq2[string, string]
- func (header *ReadOnlyHeader) ContentLength() int64
- func (header *ReadOnlyHeader) ContentType() ContentType
- func (header *ReadOnlyHeader) Cookies() iter.Seq[Cookie]
- func (header *ReadOnlyHeader) Get(name string) string
- func (header *ReadOnlyHeader) GetCookie(name string) *Cookie
- func (header *ReadOnlyHeader) GetMediaParams(name string) string
- func (header *ReadOnlyHeader) TryGet(name string) (string, bool)
- type StatusCode
- type Url
- type WebSocketClose
- type WebSocketFrame
Constants ¶
View Source
const TimeFormat = "Mon, 02 Jan 2006 15:04:05 GMT"
Variables ¶
View Source
var ErrorInvalidUrlFormat = &GigletError{ Op: GigletOp("url"), Err: errors.New("invalid format"), }
Functions ¶
func BasicAuthHeader ¶
func MatchError ¶
Types ¶
type ContentEncoding ¶
type ContentEncoding string
const ( UnknownContentEncoding ContentEncoding = "" GzipContentEncoding ContentEncoding = "gzip" )
type ContentType ¶
type ContentType string
const ( ContentTypeUndefined ContentType = "" ContentTypeRaw ContentType = "application/octet-stream" ContentTypePlain ContentType = "text/plain" ContentTypeRichtext ContentType = "application/rtf" ContentTypeMarkdown ContentType = "text/markdown" ContentTypeHTML ContentType = "text/html" ContentTypeCSV ContentType = "text/csv" ContentTypeCSS ContentType = "text/css" ContentTypePDF ContentType = "application/pdf" ContentTypeJavaScript ContentType = "text/javascript" ContentTypeFontTTF ContentType = "font/ttf" ContentTypeAVI ContentType = "video/x-msvideo" ContentTypeWAV ContentType = "audio/wav" ContentTypeMP3 ContentType = "audio/mpeg" ContentTypeMP4 ContentType = "video/mp4" ContentTypeMPEG ContentType = "video/mpeg" ContentTypeMPV ContentType = "video/MPV" ContentTypeMKV ContentType = "application/x-matroska" ContentTypeAVIF ContentType = "image/avif" ContentTypeBMP ContentType = "image/bmp" ContentTypeGIF ContentType = "image/gif" ContentTypeJPEG ContentType = "image/jpeg" ContentTypePNG ContentType = "image/png" ContentTypeWEBP ContentType = "image/webp" ContentTypeSVG ContentType = "image/svg+xml" ContentTypeJson ContentType = "application/json" ContentTypeXml ContentType = "application/xml" ContentTypeMsgpack ContentType = "application/msgpack" ContentTypeProtobuf ContentType = "application/x-protobuf" ContentTypeForm ContentType = "application/x-www-form-urlencoded" ContentTypeMultipart ContentType = "multipart/form-data" )
func (ContentType) IsForm ¶
func (contentType ContentType) IsForm() bool
type Cookie ¶
type CookieJar ¶
type CookieJar struct {
// contains filtered or unexported fields
}
func (*CookieJar) SetCookies ¶
type CookieSameSite ¶
type CookieSameSite string
const ( CookieSameSiteLaxMode CookieSameSite = "Lax" CookieSameSiteStrictMode CookieSameSite = "Strict" CookieSameSiteNoneMode CookieSameSite = "None" )
type GigletError ¶
func (*GigletError) Error ¶
func (e *GigletError) Error() string
func (*GigletError) String ¶
func (e *GigletError) String() string
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
func (*Header) CookieHeaderBytes ¶
func (*Header) SetCookieHeaderBytes ¶
func (*Header) SetCookieValue ¶
type HttpMethod ¶
type HttpMethod string
const ( HttpMethodGet HttpMethod = "GET" HttpMethodPost HttpMethod = "POST" HttpMethodPut HttpMethod = "PUT" HttpMethodDelete HttpMethod = "DELETE" HttpMethodOptions HttpMethod = "OPTIONS" HttpMethodHead HttpMethod = "HEAD" HttpMethodPatch HttpMethod = "PATCH" HttpMethodTrace HttpMethod = "TRACE" HttpMethodConnect HttpMethod = "CONNECT" HttpMethodPreface HttpMethod = "PRI" )
func (HttpMethod) CanHaveResponseBody ¶
func (method HttpMethod) CanHaveResponseBody() bool
func (HttpMethod) IsPostable ¶
func (method HttpMethod) IsPostable() bool
func (HttpMethod) IsValid ¶
func (method HttpMethod) IsValid() bool
type Query ¶
func ParseQuery ¶
type ReadOnlyHeader ¶
type ReadOnlyHeader struct {
// contains filtered or unexported fields
}
func NewReadOnlyHeader ¶
func NewReadOnlyHeader(headers map[string]string, cookies map[string]*Cookie) *ReadOnlyHeader
Creates read-only headers struct from mapped valid cased (Title-Case) headers map
func (*ReadOnlyHeader) ContentLength ¶
func (header *ReadOnlyHeader) ContentLength() int64
func (*ReadOnlyHeader) ContentType ¶
func (header *ReadOnlyHeader) ContentType() ContentType
func (*ReadOnlyHeader) Get ¶
func (header *ReadOnlyHeader) Get(name string) string
func (*ReadOnlyHeader) GetCookie ¶
func (header *ReadOnlyHeader) GetCookie(name string) *Cookie
func (*ReadOnlyHeader) GetMediaParams ¶
func (header *ReadOnlyHeader) GetMediaParams(name string) string
type StatusCode ¶
type StatusCode uint16
const ( StatusCodeUndefined StatusCode = 0 StatusCodeContinue StatusCode = 100 StatusCodeSwitchingProtocols StatusCode = 101 StatusCodeProcessing StatusCode = 102 StatusCodeEarlyHints StatusCode = 103 StatusCodeOK StatusCode = 200 StatusCodeCreated StatusCode = 201 StatusCodeAccepted StatusCode = 202 StatusCodeNonAuthoritativeInfo StatusCode = 203 StatusCodeNoContent StatusCode = 204 StatusCodeResetContent StatusCode = 205 StatusCodePartialContent StatusCode = 206 StatusCodeMultiStatus StatusCode = 207 StatusCodeAlreadyReported StatusCode = 208 StatusCodeIMUsed StatusCode = 226 StatusCodeMultipleChoices StatusCode = 300 StatusCodeMovedPermanently StatusCode = 301 StatusCodeFound StatusCode = 302 StatusCodeSeeOther StatusCode = 303 StatusCodeNotModified StatusCode = 304 StatusCodeUseProxy StatusCode = 305 StatusCodeTemporaryRedirect StatusCode = 307 StatusCodePermanentRedirect StatusCode = 308 StatusCodeBadRequest StatusCode = 400 StatusCodePaymentRequired StatusCode = 402 StatusCodeForbidden StatusCode = 403 StatusCodeNotFound StatusCode = 404 StatusCodeMethodNotAllowed StatusCode = 405 StatusCodeNotAcceptable StatusCode = 406 StatusCodeProxyAuthRequired StatusCode = 407 StatusCodeRequestTimeout StatusCode = 408 StatusCodeConflict StatusCode = 409 StatusCodeGone StatusCode = 410 StatusCodeLengthRequired StatusCode = 411 StatusCodePreconditionFailed StatusCode = 412 StatusCodeRequestEntityTooLarge StatusCode = 413 StatusCodeRequestURITooLong StatusCode = 414 StatusCodeUnsupportedMediaType StatusCode = 415 StatusCodeRequestedRangeNotSatisfiable StatusCode = 416 StatusCodeExpectationFailed StatusCode = 417 StatusCodeTeapot StatusCode = 418 StatusCodeMisdirectedRequest StatusCode = 421 StatusCodeUnprocessableEntity StatusCode = 422 StatusCodeLocked StatusCode = 423 StatusCodeFailedDependency StatusCode = 424 StatusCodeTooEarly StatusCode = 425 StatusCodeUpgradeRequired StatusCode = 426 StatusCodePreconditionRequired StatusCode = 428 StatusCodeTooManyRequests StatusCode = 429 StatusCodeRequestHeaderFieldsTooLarge StatusCode = 431 StatusCodeInternalServerError StatusCode = 500 StatusCodeNotImplemented StatusCode = 501 StatusCodeBadGateway StatusCode = 502 StatusCodeGatewayTimeout StatusCode = 504 StatusCodeHTTPVersionNotSupported StatusCode = 505 StatusCodeVariantAlsoNegotiates StatusCode = 506 StatusCodeInsufficientStorage StatusCode = 507 StatusCodeLoopDetected StatusCode = 508 StatusCodeNotExtended StatusCode = 510 StatusCodeNetworkAuthenticationRequired StatusCode = 511 )
func (StatusCode) Detail ¶
func (code StatusCode) Detail() []byte
func (StatusCode) HaveBody ¶
func (status StatusCode) HaveBody() bool
func (StatusCode) IsRedirect ¶
func (status StatusCode) IsRedirect() bool
func (StatusCode) IsValid ¶
func (status StatusCode) IsValid() bool
type Url ¶
type Url struct {
Scheme, Username, Password,
Host, Path, Hash string
Port uint16
// contains filtered or unexported fields
}
func MustParseUrl ¶
func MustParseUrlQuery ¶
func (*Url) QueryParams ¶
func (*Url) SecondLevelHost ¶
func (*Url) SetQueryParams ¶
type WebSocketClose ¶
type WebSocketClose uint16
const ( WebSocketCloseNormal WebSocketClose = 1000 WebSocketCloseGoingAway WebSocketClose = 1001 WebSocketCloseProtocolError WebSocketClose = 1002 WebSocketCloseUnsupportedData WebSocketClose = 1003 WebSocketCloseNoStatusReceived WebSocketClose = 1005 WebSocketCloseAbnormal WebSocketClose = 1006 WebSocketCloseInvalidPayloadData WebSocketClose = 1007 WebSocketClosePolicyViolation WebSocketClose = 1008 WebSocketCloseMessageTooBig WebSocketClose = 1009 WebSocketCloseMandatoryExtension WebSocketClose = 1010 WebSocketCloseInternalServerError WebSocketClose = 1011 WebSocketCloseServiceRestart WebSocketClose = 1012 WebSocketCloseTryAgainLater WebSocketClose = 1013 WebSocketCloseTLSHandshake WebSocketClose = 1015 )
func (WebSocketClose) Detail ¶
func (code WebSocketClose) Detail() []byte
type WebSocketFrame ¶
type WebSocketFrame uint16
const ( WebSocketUnknownFrame WebSocketFrame = 0 WebSocketTextFrame WebSocketFrame = 1 WebSocketBinaryFrame WebSocketFrame = 2 WebSocketCloseFrame WebSocketFrame = 8 WebSocketPingFrame WebSocketFrame = 9 WebSocketPongFrame WebSocketFrame = 10 )
func (WebSocketFrame) IsContent ¶
func (frame WebSocketFrame) IsContent() bool
func (WebSocketFrame) IsService ¶
func (frame WebSocketFrame) IsService() bool
Click to show internal directories.
Click to hide internal directories.