internal

package
v2.14.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package internal unimportable

Package internal unimportable

Index

Constants

View Source
const UserAgent = "vksdk/" + vksdk.Version + " (+https://github.com/Derad6709/vksdk)"

UserAgent module.

Variables

This section is empty.

Functions

func CharsetReader

func CharsetReader(charset string, input io.Reader) (io.Reader, error)

CharsetReader if non-nil, defines a function to generate charset-conversion readers, converting from the provided non-UTF-8 charset into UTF-8. If CharsetReader is nil or returns an error, parsing stops with an error. One of the the CharsetReader's result values must be non-nil.

func ContextClient

func ContextClient(ctx context.Context) *http.Client

ContextClient return *http.Client.

func ContextUserAgent

func ContextUserAgent(ctx context.Context) string

ContextUserAgent return User-Agent from context.

func DoRequest

func DoRequest(ctx context.Context, req *http.Request) (*http.Response, error)

DoRequest sends an HTTP request and returns an HTTP response.

The provided ctx must be non-nil. If it is canceled or times out, ctx.Err() will be returned.

func XMLSanitizerReader

func XMLSanitizerReader(xml io.Reader) io.Reader

XMLSanitizerReader creates an io.Reader that wraps another io.Reader and removes illegal xml characters from the io stream.

Types

type CharsetUnknownError

type CharsetUnknownError struct {
	Name string
}

CharsetUnknownError unknown charset.

func (*CharsetUnknownError) Error

func (c *CharsetUnknownError) Error() string

Error returns the message of a CharsetUnknownError.

type ContextKey

type ContextKey int

ContextKey is just an empty struct. It exists so HTTPClient can be an immutable public variable with a unique type. It's immutable because nobody else can create a ContextKey, being unexported.

const (
	HTTPClientKey ContextKey = iota
	UserAgentKey
	GroupIDKey
	EventIDKey
	LongPollTsKey
	CallbackRetryCounterKey
	CallbackRetryAfterKey
	CallbackRemove
	EventVersionKey
)

ContextKey list.

Jump to

Keyboard shortcuts

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