lxd: github.com/lxc/lxd/shared/cancel Index | Files

package cancel

import "github.com/lxc/lxd/shared/cancel"


Package Files


func CancelableDownload Uses

func CancelableDownload(c *Canceler, client *http.Client, req *http.Request) (*http.Response, chan bool, error)

CancelableDownload performs an http request and allows for it to be canceled at any time

type Canceler Uses

type Canceler struct {
    // contains filtered or unexported fields

Canceler tracks a cancelable operation

func NewCanceler Uses

func NewCanceler() *Canceler

NewCanceler returns a new Canceler struct

func (*Canceler) Cancel Uses

func (c *Canceler) Cancel() error

Cancel will attempt to cancel all ongoing operations

func (*Canceler) Cancelable Uses

func (c *Canceler) Cancelable() bool

Cancelable indicates whether there are operations that support cancelation

Package cancel imports 3 packages (graph) and is imported by 31 packages. Updated 2018-02-19. Refresh now. Tools for package owners.