lib

package
v0.9.17 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2016 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const MB = int64(1048576)

Variables

This section is empty.

Functions

func SetBasicAuth

func SetBasicAuth(username, password string)

func SetTokenAuth

func SetTokenAuth(t *Token)

Types

type Acls

type Acls struct {
	R bool
	W bool
	D bool
}

type Node

type Node node.Node

func (*Node) AclAdd

func (n *Node) AclAdd(acl, users string) (err error)

func (*Node) AclChown

func (n *Node) AclChown(user string) (err error)

func (*Node) AclRemove

func (n *Node) AclRemove(acl, users string) (err error)

func (*Node) Create

func (n *Node) Create(opts Opts) (err error)

func (*Node) Download

func (n *Node) Download(opts Opts) (download io.Reader, err error)

func (*Node) Get

func (n *Node) Get() (err error)

func (*Node) PP

func (n *Node) PP()

func (*Node) PrettyPrint

func (n *Node) PrettyPrint()

func (*Node) String

func (n *Node) String() string

func (*Node) Update

func (n *Node) Update(opts Opts) (err error)

func (*Node) UploadPart

func (n *Node) UploadPart(part string, r io.Reader, size int64) (err error)

type OLP

type OLP struct {
	Offset int64
	Length int64
	Part   int
}

type Opts

type Opts map[string]string

func (*Opts) HasKey

func (o *Opts) HasKey(key string) bool

func (*Opts) Value

func (o *Opts) Value(key string) string

type Token

type Token struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
	UserName    string `json:"user_name"`
}

func OAuthToken

func OAuthToken(username, password string) (t *Token, err error)

func (*Token) Delete

func (t *Token) Delete() (err error)

func (*Token) ExpiresInDays

func (t *Token) ExpiresInDays() int

func (*Token) Load

func (t *Token) Load() (err error)

func (*Token) Path

func (t *Token) Path() (path string)

func (*Token) Store

func (t *Token) Store() (err error)

type Trans

type Trans struct {
	Url   string
	Count int
	Path  string
	Name  string
	Size  int64
	Parts []OLP
}

func PartionUpload

func PartionUpload(url string, path string) (t Trans, err error)

type User

type User struct {
	Username string
	Password string
	Token    string
	Expire   string
}

type WAcl

type WAcl struct {
	Data  *acl.Acl  `json:"data"`
	Error *[]string `json:"error"`
}

type WNode

type WNode struct {
	Status int       `json:"status"`
	Data   *Node     `json:"data"`
	Error  *[]string `json:"error"`
}

type Wrapper

type Wrapper struct {
	Data  interface{} `json:"data"`
	Error *[]string   `json:"error"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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