dl

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package dl implements documentation downloading facility.

Index

Constants

View Source
const NoLayer = 0

NoLayer can be passed as "layer" argument.

Variables

View Source
var ErrReadOnly = errors.New("write operation in read only mode")

Functions

func NewZipFS

func NewZipFS(p string) (vfs.FS, error)

Types

type Client

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

func NewClient

func NewClient(opt Options) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Get

func (c *Client) Get(ctx context.Context, layer int, key string) ([]byte, error)

Get fetches documentation by key and layer.

Pass "NoLayer" as layer to use default documentation. Examples for "key" value:

  • "schema" for index of documentation
  • "constructor/inputMediaGeoLive" for constructor "inputMediaGeoLive"
  • "type/InputMedia" for class "InputMedia"
  • "method/messages.addChatUser" for "messages.addChatUser" method

Blank key is invalid.

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type Options

type Options struct {
	Path     string
	FS       vfs.FS
	Client   HTTPClient
	Readonly bool
}

Jump to

Keyboard shortcuts

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