Versions in this module Expand all Collapse all v0 v0.6.3 Mar 29, 2024 Changes in this version + func GetFileExtension(fileName string) (extension string) + func GetFileName(fullPath string) (fileName string) + func IsDir(path string) bool + func IsFileMarkBytes(data []byte, m FileMark) bool type FileInfo + func ListFilesRecursive(dirPath string) (files []FileInfo, err error) + type FileMark rune + const EmptyMark + func (m FileMark) Bytes() []byte + func (m FileMark) String() string type FilerFileInfo + func GetFileWithExtendedFields(file FilerFileInfo) (res FilerFileInfo) v0.6.0-beta.20211101.1936 Nov 1, 2021 v0.6.0-beta.20210725.1917 Jul 24, 2021 v0.2.0 Jul 15, 2021 Changes in this version + type FilerOption func(f *Filer) + func WithFilerAuthKey(authKey string) FilerOption + type HttpClientOption func(client *httpClient) + func WithHttpClientAuthKey(authKey string) HttpClientOption v0.1.6 May 14, 2021 Changes in this version + const ParamAssignCount + const ParamAssignDataCenter + const ParamAssignReplication + const ParamCollection + const ParamCount + const ParamGrowCollection + const ParamGrowCount + const ParamGrowDataCenter + const ParamGrowReplication + const ParamGrowTTL + const ParamLookupCollection + const ParamLookupPretty + const ParamLookupVolumeID + const ParamTTL + const ParamVacuumGarbageThreshold + var ErrFileNotFound = fmt.Errorf("File not found") + func GetBytesMd5sum(data []byte) (md5sum string, err error) + func GetFileMd5sum(filePath string) (md5sum string, err error) + type AssignResult struct + Count uint64 + Error string + FileID string + PublicURL string + URL string + type ChunkInfo struct + Fid string + Offset int64 + Size int64 + type ChunkManifest struct + Chunks []*ChunkInfo + Mime string + Name string + Size int64 + func (c *ChunkManifest) Marshal() ([]byte, error) + type ClusterStatus struct + IsLeader bool + Leader string + Peers []string + type DataCenter struct + Free int + Max int + Racks []*Rack + type DataNode struct + Free int + Max int + PublicURL string + URL string + Volumes int + type FileInfo struct + Md5 string + Name string + Path string + func ListLocalFilesRecursive(dirPath string) (files []FileInfo, err error) + type FilePart struct + Collection string + FileID string + FileName string + FileSize int64 + MimeType string + ModTime int64 + Reader io.ReadCloser + Server string + TTL string + func NewFilePart(fullPathFilename string) (*FilePart, error) + func NewFilePartFromReader(reader io.ReadCloser, fileName string, fileSize int64) *FilePart + func NewFileParts(fullPathFilenames []string) (ret []*FilePart, err error) + func (f *FilePart) Close() (err error) + type Filer struct + func NewFiler(u string, client *http.Client) (f *Filer, err error) + func (f *Filer) Close() (err error) + func (f *Filer) Delete(path string, args url.Values) (err error) + func (f *Filer) DeleteDir(path string) (err error) + func (f *Filer) DeleteFile(path string) (err error) + func (f *Filer) Download(path string, args url.Values, callback func(io.Reader) error) (err error) + func (f *Filer) Get(path string, args url.Values, header map[string]string) (data []byte, statusCode int, err error) + func (f *Filer) GetJson(path string, args url.Values) (data []byte, statusCode int, err error) + func (f *Filer) ListDir(path string) (files []FilerFileInfo, err error) + func (f *Filer) ListDirRecursive(path string) (files []FilerFileInfo, err error) + func (f *Filer) Upload(content io.Reader, fileSize int64, newPath, collection, ttl string) (result *FilerUploadResult, err error) + func (f *Filer) UploadDir(localDirPath, newPath, collection, ttl string) (results []*FilerUploadResult, err error) + func (f *Filer) UploadFile(localFilePath, newPath, collection, ttl string) (result *FilerUploadResult, err error) + type FilerFileInfo struct + Children []FilerFileInfo + Chunks interface{} + Collection string + Crtime time.Time + Extended string + Extension string + FileSize int64 + FullPath string + Gid int + GroupNames string + HardLinkCounter int64 + HardLinkId string + IsDir bool + Md5 string + Mime string + Mode int + Mtime time.Time + Name string + Replication string + SymlinkTarget string + TtlSec int + Uid int + UserName string + type FilerListDirResponse struct + Entries []FilerFileInfo + Path string + type FilerUploadResult struct + Error string + FileID string + FileURL string + Name string + Size int64 + type Layout struct + Replication string + Writables []uint64 + type LookupResult struct + Error string + VolumeLocations VolumeLocations + type Rack struct + DataNodes []*DataNode + Free int + Max int + type Seaweed struct + func NewSeaweed(masterURL string, filers []string, chunkSize int64, client *http.Client) (c *Seaweed, err error) + func (c *Seaweed) Assign(args url.Values) (result *AssignResult, err error) + func (c *Seaweed) BatchUploadFileParts(files []*FilePart, collection string, ttl string) ([]*SubmitResult, error) + func (c *Seaweed) BatchUploadFiles(files []string, collection, ttl string) (results []*SubmitResult, err error) + func (c *Seaweed) Close() (err error) + func (c *Seaweed) ClusterStatus() (result *ClusterStatus, err error) + func (c *Seaweed) DeleteChunks(cm *ChunkManifest, args url.Values) (err error) + func (c *Seaweed) DeleteFile(fileID string, args url.Values) (err error) + func (c *Seaweed) Download(fileID string, args url.Values, callback func(io.Reader) error) (fileName string, err error) + func (c *Seaweed) Filers() []*Filer + func (c *Seaweed) GC(threshold float64) (err error) + func (c *Seaweed) Grow(count int, collection, replication, dataCenter string) error + func (c *Seaweed) GrowArgs(args url.Values) (err error) + func (c *Seaweed) Lookup(volID string, args url.Values) (result *LookupResult, err error) + func (c *Seaweed) LookupFileID(fileID string, args url.Values, readonly bool) (fullURL string, err error) + func (c *Seaweed) LookupServerByFileID(fileID string, args url.Values, readonly bool) (server string, err error) + func (c *Seaweed) Replace(fileID string, newContent io.Reader, fileName string, size int64, ...) (err error) + func (c *Seaweed) ReplaceFile(fileID, localFilePath string, deleteFirst bool) (err error) + func (c *Seaweed) ReplaceFilePart(f *FilePart, deleteFirst bool) (err error) + func (c *Seaweed) Status() (result *SystemStatus, err error) + func (c *Seaweed) Submit(filePath string, collection, ttl string) (result *SubmitResult, err error) + func (c *Seaweed) SubmitFilePart(f *FilePart, args url.Values) (result *SubmitResult, err error) + func (c *Seaweed) Upload(fileReader io.Reader, fileName string, size int64, collection, ttl string) (fp *FilePart, err error) + func (c *Seaweed) UploadFile(filePath string, collection, ttl string) (cm *ChunkManifest, fp *FilePart, err error) + func (c *Seaweed) UploadFilePart(f *FilePart) (cm *ChunkManifest, err error) + type SubmitResult struct + Error string + FileID string + FileName string + FileURL string + Size int64 + type SystemStatus struct + Error string + Topology Topology + Version string + type Topology struct + DataCenters []*DataCenter + Free int + Layouts []*Layout + Max int + type UploadResult struct + Error string + Name string + Size int64 + type VolumeLocation struct + PublicURL string + URL string + type VolumeLocations []*VolumeLocation + func (c VolumeLocations) Head() *VolumeLocation + func (c VolumeLocations) RandomPickForRead() *VolumeLocation