gofile

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 9 Imported by: 0

README

gofile.mynn.ing

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Email        string `json:"email"`
	Id           string `json:"id"`
	RootFolder   string `json:"rootFolder"`
	StatsCurrent struct {
		FileCount            int `json:"fileCount"`
		FolderCount          int `json:"folderCount"`
		Storage              int `json:"storage"`
		TrafficWebDownloaded int `json:"trafficWebDownloaded"`
	} `json:"statsCurrent"`
	Tier  string `json:"tier"`
	Token string `json:"token"`
	// contains filtered or unexported fields
}

type Children

type Children interface {
	Delete() error
	IsFolder() bool
	IsId(string) bool
	GetId() string
}

type ClientOption

type ClientOption struct {
	Wt    string
	Cache bool
	Proxy string
}

type Content

type Content struct {
	Id                 string              `json:"id"`
	Type               string              `json:"type"`
	Name               string              `json:"name"`
	ParentFolder       string              `json:"parentFolder"`
	Code               string              `json:"code"`
	CreateTime         int                 `json:"createTime"`
	Public             bool                `json:"public"`
	TotalDownloadCount int                 `json:"totalDownloadCount"`
	TotalSize          int                 `json:"totalSize"`
	IsOwner            bool                `json:"isOwner"`
	IsRoot             bool                `json:"isRoot"`
	ChildrenIds        []string            `json:"childrenIds"`
	Children           map[string]Children `json:"children"`
	// contains filtered or unexported fields
}

func (*Content) Delete

func (c *Content) Delete() error

func (*Content) FindChildren

func (c *Content) FindChildren(contentId string, args ...string) (*Content, Children, error)

func (*Content) GetId

func (c *Content) GetId() string

func (*Content) IsFolder

func (c *Content) IsFolder() bool

func (*Content) IsId

func (c *Content) IsId(id string) bool
type DirectLink struct {
	ExpireTime       int      `json:"expireTime"`
	SourceIpsAllowed []string `json:"sourceIpsAllowed"`
	DomainsAllowed   []string `json:"domainsAllowed"`
	Auth             []string `json:"auth"`
	IsReqLink        bool     `json:"isReqLink"`
	Id               string   `json:"id"`
	DirectLink       string   `json:"directLink"`
}

type File

type File struct {
	Code         string `json:"code"`
	DownloadPage string `json:"downloadPage"`
	FileId       string `json:"fileId"`
	FileName     string `json:"fileName"`
	Md5          string `json:"md5"`
	ParentFolder string `json:"parentFolder"`
	// contains filtered or unexported fields
}

func (*File) Delete

func (f *File) Delete() error

type FileContent

type FileContent struct {
	Id             string `json:"id"`
	Type           string `json:"type"`
	Name           string `json:"name"`
	ParentFolder   string `json:"parentFolder"`
	Code           string `json:"code"`
	CreateTime     int    `json:"createTime"`
	Size           int    `json:"size"`
	DownloadCount  int    `json:"downloadCount"`
	Md5            string `json:"md5"`
	MimeType       string `json:"mimetype"`
	ServerSelected string `json:"serverSelected"`
	Link           string `json:"link"`
	Thumbnail      string `json:"thumbnail"`
	// contains filtered or unexported fields
}

func (*FileContent) Delete

func (f *FileContent) Delete() error

func (*FileContent) GetId

func (f *FileContent) GetId() string

func (*FileContent) IsFolder

func (f *FileContent) IsFolder() bool

func (*FileContent) IsId

func (f *FileContent) IsId(id string) bool

type Folder

type Folder struct {
	FolderId     string `json:"folderId"`
	Type         string `json:"type"`
	Name         string `json:"name"`
	ParentFolder string `json:"parentFolder"`
	CreateTime   int    `json:"createTime"`
	Code         string `json:"code"`
	// contains filtered or unexported fields
}

func (*Folder) Delete

func (f *Folder) Delete() error

type FolderContent

type FolderContent struct {
	Id           string   `json:"id"`
	Type         string   `json:"type"`
	Name         string   `json:"name"`
	ParentFolder string   `json:"parentFolder"`
	Code         string   `json:"code"`
	CreateTime   int      `json:"createTime"`
	Public       bool     `json:"public"`
	ChildrenIds  []string `json:"childrenIds"`
	// contains filtered or unexported fields
}

func (*FolderContent) Delete

func (f *FolderContent) Delete() error

func (*FolderContent) GetId

func (f *FolderContent) GetId() string

func (*FolderContent) IsFolder

func (f *FolderContent) IsFolder() bool

func (*FolderContent) IsId

func (f *FolderContent) IsId(id string) bool

type Gofile

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

func Anonymous added in v0.0.3

func Anonymous(args ...ClientOption) (*Gofile, error)

func New

func New(token string, args ...ClientOption) (*Gofile, error)

func (*Gofile) CreateFolder

func (g *Gofile) CreateFolder(parentFolderId, folderName string) (*Folder, error)

func (*Gofile) DeleteContent

func (g *Gofile) DeleteContent(contentId string) error

func (*Gofile) DeleteContents

func (g *Gofile) DeleteContents(contentIds ...string) error
func (g *Gofile) DirectLink(contentId string) (*DirectLink, error)

func (*Gofile) Download

func (g *Gofile) Download(contentId string) (io.Reader, error)

func (*Gofile) DownloadUrl added in v0.0.5

func (g *Gofile) DownloadUrl(url string) (io.Reader, error)

func (*Gofile) FindFile

func (g *Gofile) FindFile(value string, args ...string) (*Content, *FileContent, error)

func (*Gofile) FindFolder

func (g *Gofile) FindFolder(value string, args ...string) (*Content, *FolderContent, error)

func (*Gofile) GetAccount

func (g *Gofile) GetAccount(args ...string) (*Account, error)

func (*Gofile) GetAccountId

func (g *Gofile) GetAccountId() (string, error)

func (*Gofile) GetContent

func (g *Gofile) GetContent(contentId string) (*Content, error)

func (*Gofile) GetFile

func (g *Gofile) GetFile(folderId, fileId string) (*FileContent, error)

func (*Gofile) RemoveProxy added in v0.0.4

func (g *Gofile) RemoveProxy(proxy string)

func (*Gofile) ResetToken

func (g *Gofile) ResetToken() error

func (*Gofile) Servers

func (g *Gofile) Servers() ([]Server, error)

func (*Gofile) SetCache

func (g *Gofile) SetCache(cache bool)

func (*Gofile) SetProxy added in v0.0.4

func (g *Gofile) SetProxy(proxy string)

func (*Gofile) SetWt

func (g *Gofile) SetWt(wt string)

func (*Gofile) UpdateContent added in v0.0.6

func (g *Gofile) UpdateContent(contentId string, data map[string]string) error

func (*Gofile) UploadFile

func (g *Gofile) UploadFile(folderId, filename string, file io.Reader) (*File, error)

type Server

type Server struct {
	Name string `json:"name"`
	Zone string `json:"zone"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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