Documentation
¶
Index ¶
- Constants
- type BackendListResponse
- type CreateObjectRequest
- type DeleteObjectRequest
- type DeleteObjectsRequest
- type DeleteObjectsResponse
- type GetObjectRequest
- type ListObjectsRequest
- type ListObjectsResponse
- type Object
- type ObjectMeta
- type ReadObjectRequest
- type UploadDone
- type UploadError
- type UploadFile
- type UploadStart
Constants ¶
View Source
const ( // UploadStartEvent is sent once before the upload loop begins. // Payload: UploadStart UploadStartEvent = "start" // UploadFileEvent is sent each time the progress reader crosses a chunk // boundary (~64 KiB) while a file is being transferred. The first emission // for each file has Written == 0 and serves as the "file started" signal. // Payload: UploadFile UploadFileEvent = "file" // UploadCompleteEvent is sent after each file has been successfully // committed to the backend. Payload: schema.Object UploadCompleteEvent = "complete" // UploadErrorEvent is sent if any file fails. Rollback of previously // committed files is attempted before this event is emitted. // The stream is closed immediately after. Payload: UploadError UploadErrorEvent = "error" // UploadDoneEvent is sent after all files have been committed successfully, // just before the stream is closed. Payload: UploadDone UploadDoneEvent = "done" )
View Source
const ( SchemaName = "filer" // HTTP headers ObjectMetaHeader = "X-Object-Meta" ObjectMetaKeyPrefix = "X-Meta-" // prefix for user-defined metadata headers on PUT // AttrLastModified is the metadata key used to store the object modification time. // S3 normalizes metadata keys to lowercase, so we use lowercase for consistency. AttrLastModified = "last-modified" )
View Source
const MaxListLimit = 1000
MaxListLimit is the maximum number of objects that can be returned in a single ListObjects call. Clients must paginate using Offset for larger sets.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackendListResponse ¶
func (BackendListResponse) String ¶
func (r BackendListResponse) String() string
type CreateObjectRequest ¶
type CreateObjectRequest struct {
Path string
Body io.Reader `json:"-"`
ContentType string // optional: MIME type of the object
ModTime time.Time // optional: modification time (stored as metadata)
Meta ObjectMeta // optional: user-defined metadata
IfNotExists bool // if true, fail with ErrConflict when the object already exists
}
func (CreateObjectRequest) String ¶
func (r CreateObjectRequest) String() string
type DeleteObjectRequest ¶
type DeleteObjectRequest struct {
Path string
}
func (DeleteObjectRequest) String ¶
func (r DeleteObjectRequest) String() string
type DeleteObjectsRequest ¶
type DeleteObjectsRequest struct {
Path string `json:"path,omitempty"`
Recursive bool `json:"recursive,omitempty"` // if true, delete all objects recursively; if false, delete only immediate children
}
func (DeleteObjectsRequest) String ¶
func (r DeleteObjectsRequest) String() string
type DeleteObjectsResponse ¶
type DeleteObjectsResponse struct {
Name string `json:"name,omitempty"`
Body []Object `json:"body,omitempty"` // list of deleted objects
}
func (DeleteObjectsResponse) String ¶
func (r DeleteObjectsResponse) String() string
type GetObjectRequest ¶
type GetObjectRequest struct {
Path string
}
func (GetObjectRequest) String ¶
func (r GetObjectRequest) String() string
type ListObjectsRequest ¶
type ListObjectsRequest struct {
Path string `json:"path,omitempty"` // optional path prefix within the backend
Recursive bool `json:"recursive,omitempty"` // if true, list all objects recursively; if false, list only immediate children
Offset int `json:"offset,omitempty"` // number of objects to skip before returning results (0-based)
Limit int `json:"limit,omitempty"` // max objects to return; 0 means count-only (Body will be nil)
}
func (ListObjectsRequest) String ¶
func (r ListObjectsRequest) String() string
type ListObjectsResponse ¶
type ListObjectsResponse struct {
Name string `json:"name,omitempty"`
Count int `json:"count"` // total number of matching objects, before offset/limit
Body []Object `json:"body,omitempty"` // page of objects; nil when Limit==0 (count-only)
}
func (ListObjectsResponse) String ¶
func (r ListObjectsResponse) String() string
type Object ¶
type ObjectMeta ¶
ObjectMeta is a string key-value map for user-defined object metadata. Keys should be lowercase for S3 compatibility, as S3 normalizes all metadata keys to lowercase.
type ReadObjectRequest ¶
type ReadObjectRequest struct {
GetObjectRequest
}
type UploadDone ¶
type UploadDone struct {
// Files is the number of files successfully committed.
Files int `json:"files"`
// Bytes is the total number of bytes committed across all files.
Bytes int64 `json:"bytes"`
}
UploadDone is the payload for UploadDoneEvent.
type UploadError ¶
type UploadError struct {
// Index is the 0-based position of the file that failed.
Index int `json:"index"`
// Path is the destination object path that failed.
Path string `json:"path"`
// Message is the error description.
Message string `json:"message"`
}
UploadError is the payload for UploadErrorEvent.
type UploadFile ¶
type UploadFile struct {
// Index is the 0-based position of the file in the upload.
Index int `json:"index"`
// Path is the destination object path (normalised).
Path string `json:"path"`
// Written is the number of bytes transferred so far for this file.
Written int64 `json:"written"`
// Bytes is the declared size of this file in bytes, or 0 if unknown
// (multipart parts rarely include Content-Length).
Bytes int64 `json:"bytes,omitempty"`
}
UploadFile is the payload for UploadFileEvent.
type UploadStart ¶
type UploadStart struct {
// Files is the number of files to be uploaded.
Files int `json:"files"`
// Bytes is the sum of declared part sizes in bytes, or 0 if unknown
// (multipart parts rarely include Content-Length).
Bytes int64 `json:"bytes,omitempty"`
}
UploadStart is the payload for UploadStartEvent.
Click to show internal directories.
Click to hide internal directories.