tokenshare

package module
v0.0.0-...-1e1986f Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ID   = "id"
	File = "file"

	ReqList     = "/list"
	ReqCreate   = "/create"
	ReqUpload   = "/upload"
	ReqSingle   = "/single"
	ReqTransfer = "/transfer"
	ReqDownload = "/download"
)

Variables

This section is empty.

Functions

func Call

func Call(call string, cookie *http.Cookie, values map[string]string) ([]byte, error)

func Download

func Download(call, id string) ([]byte, error)

func Marshal

func Marshal(t Token) ([]byte, error)

func MarshalList

func MarshalList(t []Token) ([]byte, error)

func Transfer

func Transfer(call, name, id string, data []byte, progress chan int) error

Types

type Client

type Client struct{}

func (Client) Create

func (c Client) Create(div *dom.HTMLDivElement) error

func (Client) List

func (c Client) List(div *dom.HTMLDivElement) error

func (Client) Open

func (c Client) Open(input *dom.HTMLInputElement, res *OpenResult)

func (Client) Single

func (c Client) Single(id string) (Token, bool, error)

func (Client) Upload

func (c Client) Upload(p []byte, name, id string, progress *dom.HTMLDivElement) error

func (Client) Url

func (c Client) Url() *url.URL

type NoSuchToken

type NoSuchToken struct{}

func (NoSuchToken) Error

func (_ NoSuchToken) Error() string

type OpenResult

type OpenResult struct {
	Data []byte
	Name string

	sync.Mutex
}

func (*OpenResult) Get

func (o *OpenResult) Get() *OpenResult

func (*OpenResult) Set

func (o *OpenResult) Set(data []byte, name string)

type Token

type Token struct {
	ID   []byte    `json:id`
	T    time.Time `json:t`
	Name string    `jsoon:name`
}

func Create

func Create(call string, cookie *http.Cookie) (Token, error)

func List

func List(call string, cookie *http.Cookie) ([]Token, error)

func Unmarshal

func Unmarshal(d []byte) (Token, error)

func UnmarshalList

func UnmarshalList(d []byte) ([]Token, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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