schema

package
v0.0.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

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.

View Source
const MaxUploadFiles = 1000

MaxUploadFiles is the maximum number of files accepted in a single multipart upload request.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendListResponse

type BackendListResponse struct {
	Body map[string]string `json:"body"`
}

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 Object struct {
	Name        string     `json:"name,omitempty"`
	Path        string     `json:"path,omitempty"`
	IsDir       bool       `json:"dir,omitempty"`
	Size        int64      `json:"size"`
	ModTime     time.Time  `json:"last-modified,omitzero"`
	ContentType string     `json:"type,omitempty"`
	ETag        string     `json:"etag,omitempty"`
	Meta        ObjectMeta `json:"meta,omitempty"`
}

Object represents a single stored item returned by the API.

func (Object) String

func (o Object) String() string

type ObjectMeta

type ObjectMeta map[string]string

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL