Documentation
¶
Index ¶
- func BaseHeader() map[string]string
- func FileMd5Bytes(path string) ([]byte, error)
- func FileMd5Hex(path string) (string, error)
- func FileSha256Bytes(path string) ([]byte, error)
- func FileSha256Hex(path string) (string, error)
- type FileBrowserBasicFunc
- type FileBrowserClient
- func (f *FileBrowserClient) Debug(isDebug bool)
- func (f *FileBrowserClient) GetBaseUrl() string
- func (f *FileBrowserClient) GetRecaptcha() string
- func (f *FileBrowserClient) GetUsername() string
- func (f *FileBrowserClient) IsLogin() bool
- func (f *FileBrowserClient) Login() error
- func (f *FileBrowserClient) ResourceDownload(remotePath string, localPath string, override bool) error
- func (f *FileBrowserClient) ResourcesDeletePath(remotePath string) (bool, error)
- func (f *FileBrowserClient) ResourcesGet(pathResource string) (web_api.Resources, error)
- func (f *FileBrowserClient) ResourcesGetCheckSum(pathResource string, checksum string) (web_api.Resources, error)
- func (f *FileBrowserClient) ResourcesPostDirectoryFiles(resourceDirectory ResourcePostDirectory, override bool) (ResourcesPostDirectoryResult, error)
- func (f *FileBrowserClient) ResourcesPostFile(resourceFile ResourcePostFile, override bool) error
- func (f *FileBrowserClient) SetRecaptcha(recaptcha string)
- func (f *FileBrowserClient) ShareDelete(hash string) (bool, error)
- func (f *FileBrowserClient) ShareGetByRemotePath(remotePath string) ([]web_api.ShareLink, error)
- func (f *FileBrowserClient) SharePost(shareResource ShareResource) (ShareContent, error)
- func (f *FileBrowserClient) SharesGet() ([]web_api.ShareLink, error)
- type FileBrowserDirectoryFunc
- type FileBrowserResourceFunc
- type FileBrowserShareFunc
- type ResourcePostDirectory
- type ResourcePostFile
- type ResourcesPostDirectoryResult
- type ShareContent
- type ShareResource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BaseHeader ¶
func FileMd5Bytes ¶ added in v0.4.0
func FileMd5Hex ¶ added in v0.4.0
func FileSha256Bytes ¶ added in v0.4.0
func FileSha256Hex ¶ added in v0.4.0
Types ¶
type FileBrowserBasicFunc ¶ added in v0.7.0
type FileBrowserClient ¶
type FileBrowserClient struct {
FileBrowserBasicFunc FileBrowserBasicFunc `json:"-"`
FileBrowserResourceFunc FileBrowserResourceFunc `json:"-"`
FileBrowserDirectoryFunc FileBrowserDirectoryFunc `json:"-"`
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient( username, password, baseUrl string, timeoutSecond, timeoutFileSecond uint, ) (FileBrowserClient, error)
NewClient new client for filebrowser
func (*FileBrowserClient) Debug ¶
func (f *FileBrowserClient) Debug(isDebug bool)
Debug open FileBrowserClient debug or close
func (*FileBrowserClient) GetBaseUrl ¶ added in v0.7.0
func (f *FileBrowserClient) GetBaseUrl() string
func (*FileBrowserClient) GetRecaptcha ¶ added in v0.7.0
func (f *FileBrowserClient) GetRecaptcha() string
func (*FileBrowserClient) GetUsername ¶ added in v0.7.0
func (f *FileBrowserClient) GetUsername() string
func (*FileBrowserClient) IsLogin ¶
func (f *FileBrowserClient) IsLogin() bool
IsLogin check FileBrowserClient has login
func (*FileBrowserClient) Login ¶
func (f *FileBrowserClient) Login() error
Login do login in by FileBrowserClient
func (*FileBrowserClient) ResourceDownload ¶
func (f *FileBrowserClient) ResourceDownload(remotePath string, localPath string, override bool) error
ResourceDownload remotePath must exist and not empty; override is true, will not check localPath and will mkdir by parent folder override is false, will check localPath and not mkdir by parent folder
func (*FileBrowserClient) ResourcesDeletePath ¶
func (f *FileBrowserClient) ResourcesDeletePath(remotePath string) (bool, error)
ResourcesDeletePath remotePath just use remote path
func (*FileBrowserClient) ResourcesGet ¶
func (f *FileBrowserClient) ResourcesGet(pathResource string) (web_api.Resources, error)
ResourcesGet pathResource path resource at remote
func (*FileBrowserClient) ResourcesGetCheckSum ¶
func (f *FileBrowserClient) ResourcesGetCheckSum(pathResource string, checksum string) (web_api.Resources, error)
ResourcesGetCheckSum pathResource path resource at remote checksum will be [ md5 sha1 sha256 sha512 ] or empty
func (*FileBrowserClient) ResourcesPostDirectoryFiles ¶
func (f *FileBrowserClient) ResourcesPostDirectoryFiles(resourceDirectory ResourcePostDirectory, override bool) (ResourcesPostDirectoryResult, error)
ResourcesPostDirectoryFiles post directory full files by ResourcePostDirectory settings ResourcePostDirectory.LocalDirectoryPath must exist override will want override remote path, but success must enable the permission at filebrowser to modify files
func (*FileBrowserClient) ResourcesPostFile ¶
func (f *FileBrowserClient) ResourcesPostFile(resourceFile ResourcePostFile, override bool) error
ResourcesPostFile param post file by ResourcePostFile, ResourcePostFile.LocalFilePath must exist; override will want override remote path, but success must enable the permission at filebrowser to modify files
func (*FileBrowserClient) SetRecaptcha ¶ added in v0.7.0
func (f *FileBrowserClient) SetRecaptcha(recaptcha string)
func (*FileBrowserClient) ShareDelete ¶
func (f *FileBrowserClient) ShareDelete(hash string) (bool, error)
ShareDelete delete share by share hash warning: For security purposes, this api always returns correct if the permission is passed
func (*FileBrowserClient) ShareGetByRemotePath ¶
func (f *FileBrowserClient) ShareGetByRemotePath(remotePath string) ([]web_api.ShareLink, error)
ShareGetByRemotePath get share by remote path return shareLink will be list
func (*FileBrowserClient) SharePost ¶
func (f *FileBrowserClient) SharePost(shareResource ShareResource) (ShareContent, error)
SharePost post share by ShareResource settings ShareResource.RemotePath must exist
type FileBrowserDirectoryFunc ¶ added in v0.7.0
type FileBrowserDirectoryFunc interface {
ResourcesPostDirectoryFiles(resourceDirectory ResourcePostDirectory, override bool) (ResourcesPostDirectoryResult, error)
}
type FileBrowserResourceFunc ¶ added in v0.7.0
type FileBrowserResourceFunc interface {
ResourcesGet(pathResource string) (web_api.Resources, error)
ResourcesGetCheckSum(pathResource string, checksum string) (web_api.Resources, error)
ResourcesDeletePath(remotePath string) (bool, error)
ResourcesPostFile(resourceFile ResourcePostFile, override bool) error
ResourceDownload(remotePath string, localPath string, override bool) error
}
type FileBrowserShareFunc ¶ added in v0.7.0
type FileBrowserShareFunc interface {
}
type ResourcePostDirectory ¶
type ResourcePostFile ¶
type ResourcesPostDirectoryResult ¶
type ResourcesPostDirectoryResult struct {
FullSuccess bool `json:"full_success"`
SuccessFiles []ResourcePostFile `json:"post_success_files,omitempty"`
FailFiles []ResourcePostFile `json:"fail_files,omitempty"`
}
type ShareContent ¶
type ShareContent struct {
}
type ShareResource ¶
type ShareResource struct {
}