internal

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package internal unimportable

Package internal unimportable

Index

Constants

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

UserAgent module.

Variables

This section is empty.

Functions

func CharsetReader added in v1.4.0

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 added in v1.4.0

func ContextUserAgent(ctx context.Context) string

ContextUserAgent return User-Agent from context.

func DoRequest added in v1.4.0

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 added in v1.4.0

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 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
)

ContextKey list.

type TokenPool added in v1.5.0

type TokenPool struct {
	// contains filtered or unexported fields
}

TokenPool is a simple round-robin based token pool.

func NewTokenPool added in v1.5.0

func NewTokenPool(tokens ...string) TokenPool

NewTokenPool returns new token pool.

func (TokenPool) Get added in v1.5.0

func (tp TokenPool) Get() string

Get returns access token from pool.

Jump to

Keyboard shortcuts

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