Documentation ¶
Index ¶
- Variables
- func DeleteFiles(master string, grpcDialOption grpc.DialOption, fileIds []string) ([]*volume_server_pb.DeleteResult, error)
- func DeleteFilesAtOneVolumeServer(volumeServer string, grpcDialOption grpc.DialOption, fileIds []string) (ret []*volume_server_pb.DeleteResult, err error)
- func DeleteFilesWithLookupVolumeId(grpcDialOption grpc.DialOption, fileIds []string, ...) ([]*volume_server_pb.DeleteResult, error)
- func GetVolumeSyncStatus(server string, grpcDialOption grpc.DialOption, vid uint32) (resp *volume_server_pb.VolumeSyncStatusResponse, err error)
- func LookupFileId(server string, fileId string) (fullUrl string, err error)
- func LookupJwt(master string, fileId string) security.EncodedJwt
- func LookupVolumeIds(server string, grpcDialOption grpc.DialOption, vids []string) (map[string]LookupResult, error)
- func ParseFileId(fid string) (vid string, key_cookie string, err error)
- func Statistics(server string, grpcDialOption grpc.DialOption, ...) (resp *master_pb.StatisticsResponse, err error)
- func TailVolume(master string, grpcDialOption grpc.DialOption, vid needle.VolumeId, ...) error
- func TailVolumeFromSource(volumeServer string, grpcDialOption grpc.DialOption, vid needle.VolumeId, ...) error
- func WithMasterServerClient(masterServer string, grpcDialOption grpc.DialOption, ...) error
- func WithVolumeServerClient(volumeServer string, grpcDialOption grpc.DialOption, ...) 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 DeleteResult
- type FilePart
- type JoinResult
- type Location
- type LookupResult
- type SubmitResult
- 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") )
View Source
var ErrorNotFound = errors.New("not found")
Functions ¶
func DeleteFiles ¶
func DeleteFiles(master string, grpcDialOption grpc.DialOption, fileIds []string) ([]*volume_server_pb.DeleteResult, error)
DeleteFiles batch deletes a list of fileIds
func DeleteFilesAtOneVolumeServer ¶
func DeleteFilesAtOneVolumeServer(volumeServer string, grpcDialOption grpc.DialOption, fileIds []string) (ret []*volume_server_pb.DeleteResult, err error)
DeleteFilesAtOneVolumeServer deletes a list of files that is on one volume server via gRpc
func DeleteFilesWithLookupVolumeId ¶
func DeleteFilesWithLookupVolumeId(grpcDialOption grpc.DialOption, fileIds []string, lookupFunc func(vid []string) (map[string]LookupResult, error)) ([]*volume_server_pb.DeleteResult, error)
func GetVolumeSyncStatus ¶
func GetVolumeSyncStatus(server string, grpcDialOption grpc.DialOption, vid uint32) (resp *volume_server_pb.VolumeSyncStatusResponse, err error)
func LookupVolumeIds ¶
func LookupVolumeIds(server string, grpcDialOption grpc.DialOption, vids []string) (map[string]LookupResult, error)
LookupVolumeIds find volume locations by cache and actual lookup
func Statistics ¶
func Statistics(server string, grpcDialOption grpc.DialOption, req *master_pb.StatisticsRequest) (resp *master_pb.StatisticsResponse, err error)
func TailVolume ¶
func TailVolumeFromSource ¶
func WithMasterServerClient ¶
func WithMasterServerClient(masterServer string, grpcDialOption grpc.DialOption, fn func(masterClient master_pb.SeaweedClient) error) error
func WithVolumeServerClient ¶
func WithVolumeServerClient(volumeServer string, grpcDialOption grpc.DialOption, fn func(volume_server_pb.VolumeServerClient) error) error
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"` Auth security.EncodedJwt `json:"auth,omitempty"` }
func Assign ¶
func Assign(server string, grpcDialOption grpc.DialOption, primaryRequest *VolumeAssignRequest, alternativeRequests ...*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, grpcDialOption grpc.DialOption) 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 DeleteResult ¶
type FilePart ¶
type FilePart struct { Reader io.Reader FileName string FileSize int64 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 SubmitResult struct { FileName string `json:"fileName,omitempty"` FileUrl string `json:"fileUrl,omitempty"` Fid string `json:"fid,omitempty"` Size uint32 `json:"size,omitempty"` Error string `json:"error,omitempty"` }
func SubmitFiles ¶
type UploadResult ¶
type UploadResult struct { Name string `json:"name,omitempty"` Size uint32 `json:"size,omitempty"` Error string `json:"error,omitempty"` ETag string `json:"eTag,omitempty"` }
func Upload ¶
func Upload(uploadUrl string, filename string, reader io.Reader, isGzipped bool, mtype string, pairMap map[string]string, jwt security.EncodedJwt) (*UploadResult, error)
Upload sends a POST request to a volume server to upload the content with fast compression
func UploadWithLocalCompressionLevel ¶
func UploadWithLocalCompressionLevel(uploadUrl string, filename string, reader io.Reader, isGzipped bool, mtype string, pairMap map[string]string, jwt security.EncodedJwt, compressionLevel int) (*UploadResult, error)
Upload sends a POST request to a volume server to upload the content with adjustable compression level
Click to show internal directories.
Click to hide internal directories.