Documentation ¶
Index ¶
- Variables
- func DeleteFile(master string, fileId string, jwt security.EncodedJwt) error
- func GetVolumeIdxEntries(server string, vid string, eachEntryFn func(key uint64, offset, size uint32)) error
- func GzipData(input []byte) ([]byte, error)
- func IsGzippable(ext, mtype string) bool
- func ListMasters(server string) (leader string, peers []string, err error)
- func LookupFileId(server string, fileId string) (fullUrl string, err error)
- func LookupVolumeIds(server string, vids []string) (map[string]LookupResult, error)
- func ParseFileId(fid string) (vid string, key_cookie string, err error)
- func UnGzipData(input []byte) ([]byte, error)
- type AssignResult
- type ChunkInfo
- type ChunkList
- type ChunkManifest
- type ChunkedFileReader
- func (cf *ChunkedFileReader) Close() (e error)
- func (cf *ChunkedFileReader) Read(p []byte) (int, error)
- func (cf *ChunkedFileReader) ReadAt(p []byte, off int64) (n int, err error)
- func (cf *ChunkedFileReader) Seek(offset int64, whence int) (int64, error)
- func (cf *ChunkedFileReader) WriteTo(w io.Writer) (n int64, err error)
- type ClusterStatusResult
- type DeleteFilesResult
- type DeleteResult
- type FilePart
- type JoinResult
- type Location
- type LookupResult
- type SubmitResult
- type SyncVolumeResponse
- type UploadResult
- type VidCache
- type VidInfo
- type VolumeAssignRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // when the remote server does not allow range requests (Accept-Ranges was not set) ErrRangeRequestsNotSupported = errors.New("Range requests are not supported by the remote server") // ErrInvalidRange is returned by Read when trying to read past the end of the file ErrInvalidRange = errors.New("Invalid range") )
Functions ¶
func DeleteFile ¶
func DeleteFile(master string, fileId string, jwt security.EncodedJwt) error
func GetVolumeIdxEntries ¶
func IsGzippable ¶
* Default more not to gzip since gzip can be done on client side.
func LookupVolumeIds ¶
func LookupVolumeIds(server string, vids []string) (map[string]LookupResult, error)
LookupVolumeIds find volume locations by cache and actual lookup
func UnGzipData ¶
Types ¶
type AssignResult ¶
type AssignResult struct { Fid string `json:"fid,omitempty"` Url string `json:"url,omitempty"` PublicUrl string `json:"publicUrl,omitempty"` Count uint64 `json:"count,omitempty"` Error string `json:"error,omitempty"` }
func Assign ¶
func Assign(server string, r *VolumeAssignRequest) (*AssignResult, error)
type ChunkManifest ¶
type ChunkManifest struct { Name string `json:"name,omitempty"` Mime string `json:"mime,omitempty"` Size int64 `json:"size,omitempty"` Chunks ChunkList `json:"chunks,omitempty"` }
func LoadChunkManifest ¶
func LoadChunkManifest(buffer []byte, isGzipped bool) (*ChunkManifest, error)
func (*ChunkManifest) DeleteChunks ¶
func (cm *ChunkManifest) DeleteChunks(master string) error
func (*ChunkManifest) Marshal ¶
func (cm *ChunkManifest) Marshal() ([]byte, error)
type ChunkedFileReader ¶
type ChunkedFileReader struct { Manifest *ChunkManifest Master string // contains filtered or unexported fields }
seekable chunked file reader
func (*ChunkedFileReader) Close ¶
func (cf *ChunkedFileReader) Close() (e error)
func (*ChunkedFileReader) ReadAt ¶
func (cf *ChunkedFileReader) ReadAt(p []byte, off int64) (n int, err error)
type ClusterStatusResult ¶
type DeleteFilesResult ¶
type DeleteFilesResult struct { Errors []string Results []DeleteResult }
func DeleteFiles ¶
func DeleteFiles(master string, fileIds []string) (*DeleteFilesResult, error)
type DeleteResult ¶
type FilePart ¶
type FilePart struct { Reader io.Reader FileName string FileSize int64 IsGzipped bool MimeType string ModTime int64 //in seconds Replication string Collection string DataCenter string Ttl string Server string //this comes from assign result Fid string //this comes from assign result, but customizable }
func NewFileParts ¶
type JoinResult ¶
type LookupResult ¶
type LookupResult struct { VolumeId string `json:"volumeId,omitempty"` Locations []Location `json:"locations,omitempty"` Error string `json:"error,omitempty"` }
func (*LookupResult) String ¶
func (lr *LookupResult) String() string
type SubmitResult ¶
type SyncVolumeResponse ¶
type SyncVolumeResponse struct { Replication string `json:"Replication,omitempty"` Ttl string `json:"Ttl,omitempty"` TailOffset uint64 `json:"TailOffset,omitempty"` CompactRevision uint16 `json:"CompactRevision,omitempty"` IdxFileSize uint64 `json:"IdxFileSize,omitempty"` Error string `json:"error,omitempty"` }
func GetVolumeSyncStatus ¶
func GetVolumeSyncStatus(server string, vid string) (*SyncVolumeResponse, error)
type UploadResult ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.