dl

package
v0.0.0-...-8375cc0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultUpdateInterval = 24 * time.Hour
	DefaultAppName        = "DL"
	DefaultAppVersion     = "1.0"
)

Variables

This section is empty.

Functions

func NewErrStatusCode

func NewErrStatusCode(i int) error

Types

type DL

type DL struct {
	URL            *url.URL
	BaseDir        string
	UpdateInterval time.Duration
	Client         Doer
	Logger         *slog.Logger

	AppName    string
	AppVersion string
	DebugHTTP  bool
	// contains filtered or unexported fields
}

func New

func New(u *url.URL, baseDir string) *DL

func (*DL) Init

func (d *DL) Init() error

func (*DL) Start

func (d *DL) Start()

func (*DL) Stop

func (d *DL) Stop()

func (*DL) Update

func (d *DL) Update() (updated bool, err error)

type Doer

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

type ErrStatusCode

type ErrStatusCode int

func (ErrStatusCode) Error

func (e ErrStatusCode) Error() string

func (ErrStatusCode) Int

func (e ErrStatusCode) Int() int

func (ErrStatusCode) String

func (e ErrStatusCode) String() string

Jump to

Keyboard shortcuts

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