schema

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxListLimit is the maximum number of objects that can be returned in a
	// single ListObjects call. Clients must paginate using Offset for larger sets.
	MaxListLimit = 1000

	// MaxUploadFiles is the maximum number of files accepted in a single multipart upload request.
	MaxUploadFiles = 1000
)
View Source
const (
	DefaultSchema = "filer"

	// HTTP headers
	ObjectMetaHeader = "X-Object-Meta"

	// prefix for user-defined metadata headers on PUT
	ObjectMetaKeyPrefix = "X-Meta-"

	// 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"

	// IndexingQueueName is the name of the queue used by the manager to schedule
	// background tasks for indexing objects.
	IndexingQueueName = "filer-index"

	// Maximum of 15 minutes for each indexing task
	IndexingTTL = time.Minute * 15
)

Variables

View Source
var Objects string
View Source
var Queries string

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 {
	Volume string   `json:"volume,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 Metadata

type Metadata struct {
	ObjectKey
	MetadataMeta
	CreatedAt time.Time `json:"created_at,omitzero"`
}

func (Metadata) Insert

func (m Metadata) Insert(bind *pg.Bind) (string, error)

func (*Metadata) Scan

func (m *Metadata) Scan(row pg.Row) error

func (Metadata) String

func (m Metadata) String() string

type MetadataMeta

type MetadataMeta struct {
	Title   *string  `json:"title,omitempty"`
	Summary *string  `json:"summary,omitempty"`
	Text    *string  `json:"text,omitempty"`
	Tags    []string `json:"tags,omitempty"`
}

func (MetadataMeta) Insert

func (m MetadataMeta) Insert(bind *pg.Bind) (string, error)

func (MetadataMeta) String

func (m MetadataMeta) String() string

func (MetadataMeta) Update

func (m MetadataMeta) Update(bind *pg.Bind) error

type Object

type Object struct {
	Volume      string     `json:"volume,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) Insert

func (o Object) Insert(bind *pg.Bind) (string, error)

func (*Object) Scan

func (o *Object) Scan(row pg.Row) error

func (Object) String

func (o Object) String() string

func (Object) Update

func (o Object) Update(bind *pg.Bind) error

type ObjectKey

type ObjectKey struct {
	Volume string `json:"volume,omitempty"`
	Path   string `json:"path,omitempty"`
}

func (ObjectKey) Select

func (k ObjectKey) Select(bind *pg.Bind, op pg.Op) (string, error)

func (ObjectKey) String

func (k ObjectKey) 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