seafile

package module
v0.0.0-...-09d2388 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(baseURL, repoID string) *Client

func (*Client) DeleteFile

func (s *Client) DeleteFile(name string) error

func (*Client) FetchToken

func (s *Client) FetchToken(username, password string) error

func (*Client) FileDetail

func (s *Client) FileDetail(name string) (*FileDetail, error)

func (*Client) ListDirectoryEntries

func (s *Client) ListDirectoryEntries() ([]*ListDirectoryResponseItem, error)

func (*Client) Request

func (s *Client) Request(meth, url string, body io.Reader) (*http.Request, error)

func (*Client) ShareFile

func (s *Client) ShareFile(filename string) (*ShareFileResponse, error)

func (*Client) UploadFile

func (s *Client) UploadFile(file string) ([]*UploadResponseItem, error)

UploadFile creates an upload link first and then posts a file to it.

type FileDetail

type FileDetail struct {
	ID    string `json:"id"`
	Mtime uint64 `json:"mtime"`
	Type  string `json:"type"`
	Name  string `json:"name"`
	Size  uint64 `json:"size"`
}

type ListDirectoryResponseItem

type ListDirectoryResponseItem struct {
	ID   string `json:"id"`
	Type string `json:"type"`
	Name string `json:"name"`
	Size uint64 `json:"size"`
}

type ShareFileResponse

type ShareFileResponse struct {
	Username   string      `json:"username"`
	ViewCnt    uint64      `json:"view_cnt"`
	Ctime      string      `json:"ctime"`
	Token      string      `json:"token"`
	RepoID     string      `json:"repo_id"`
	Link       string      `json:"link"`
	ExpireDate interface{} `json:"expire_date"`
	Path       string      `json:"path"`
	IsExpired  bool        `json:"is_expired"`
}

type TokenResponse

type TokenResponse struct{ Token string }

type UploadResponseItem

type UploadResponseItem struct {
	Name string `json:"name"`
	ID   string `json:"id"`
	Size uint64 `json:"size"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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