schema

package
v0.2.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultSchema = "filer"
	NotifyChannel = "filer_changes"
)
View Source
const (
	VolumeListLimit   = 100
	ObjectListLimit   = 100
	MetadataListLimit = 100

	// MaxUploadFiles is the maximum number of files accepted in a single multipart upload request.
	MaxUploadFiles = 1000
)

Variables

View Source
var Objects string
View Source
var Queries string

Functions

This section is empty.

Types

type CreateObjectRequest

type CreateObjectRequest struct {
	Body        io.Reader `json:"-"`
	IfNotExists bool      // if true, fail with ErrConflict when the object already exists
	ObjectMeta
}

Operations

func (CreateObjectRequest) String

func (r CreateObjectRequest) String() string

type DeleteObjectRequest

type DeleteObjectRequest struct {
	GetObjectRequest
}

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 Meta added in v0.2.0

type Meta struct {
	Key   string          `json:"key,omitempty"`
	Value json.RawMessage `json:"value,omitempty"`
}

Meta 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.

func AppendMeta added in v0.2.0

func AppendMeta(kv []Meta, key string, value any) []Meta

func (Meta) Insert added in v0.2.0

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

func (*Meta) Scan added in v0.2.0

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

func (Meta) Update added in v0.2.0

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

type Metadata added in v0.1.2

type Metadata struct {
	Key       string    `json:"key,omitempty"`
	IndexedAt time.Time `json:"indexed_at,omitzero"`
	MetadataCreate
}

func (Metadata) Cell added in v0.2.0

func (r Metadata) Cell(col int) string

func (Metadata) Header added in v0.2.0

func (r Metadata) Header() []string

func (*Metadata) Scan added in v0.1.2

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

func (Metadata) String added in v0.1.2

func (m Metadata) String() string

func (Metadata) Width added in v0.2.0

func (r Metadata) Width(col int) int

type MetadataCreate added in v0.2.0

type MetadataCreate struct {
	Filename   string    `json:"filename,omitempty"`
	Etag       string    `json:"etag,omitempty"`
	Size       int64     `json:"size"`
	ModifiedAt time.Time `json:"modified_at,omitzero"`
	MetadataMeta
}

func (MetadataCreate) Insert added in v0.2.0

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

type MetadataKV added in v0.2.0

type MetadataKV struct {
	Metadata string          `json:"-"`
	Key      string          `json:"key,omitempty"`
	Value    json.RawMessage `json:"value,omitempty"`
}

func AppendMetadataKV added in v0.2.0

func AppendMetadataKV(metadata []MetadataKV, key string, value any) []MetadataKV

func (MetadataKV) Insert added in v0.2.0

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

func (*MetadataKV) Scan added in v0.2.0

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

func (MetadataKV) String added in v0.2.0

func (m MetadataKV) String() string

func (MetadataKV) Update added in v0.2.0

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

type MetadataKey added in v0.2.0

type MetadataKey string

func (MetadataKey) Select added in v0.2.0

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

type MetadataList added in v0.2.0

type MetadataList struct {
	MetadataListRequest
	Count uint64      `json:"count"`
	Body  []*Metadata `json:"body"`
}

func (*MetadataList) Scan added in v0.2.0

func (l *MetadataList) Scan(row pg.Row) error

func (*MetadataList) ScanCount added in v0.2.0

func (l *MetadataList) ScanCount(row pg.Row) error

func (MetadataList) String added in v0.2.0

func (r MetadataList) String() string

type MetadataListRequest added in v0.2.0

type MetadataListRequest struct {
	Title *string `json:"title,omitempty" help:"filter by title"`
	Type  *string `json:"type,omitempty" help:"media type filter"`
	pg.OffsetLimit
}

func (*MetadataListRequest) Select added in v0.2.0

func (r *MetadataListRequest) Select(bind *pg.Bind, op pg.Op) (string, error)

func (MetadataListRequest) String added in v0.2.0

func (r MetadataListRequest) String() string

type MetadataMeta added in v0.1.2

type MetadataMeta struct {
	Title    string       `json:"title,omitempty"`
	Type     string       `json:"media_type,omitempty"`
	Summary  *string      `json:"summary,omitempty"`
	Tags     []string     `json:"tags,omitempty"`
	Metadata []MetadataKV `json:"metadata,omitempty"`
}

func (MetadataMeta) MetaMap added in v0.2.0

func (r MetadataMeta) MetaMap() map[string]any

func (MetadataMeta) String added in v0.1.2

func (m MetadataMeta) String() string

func (MetadataMeta) Update added in v0.1.2

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

type MetadataQueryRequest added in v0.2.0

type MetadataQueryRequest struct {
	Query string  `json:"query,omitempty" arg:"" required:"" help:"full text search query"`
	Type  *string `json:"type,omitempty" help:"media type filter"`
	pg.OffsetLimit
}

func (*MetadataQueryRequest) Select added in v0.2.0

func (r *MetadataQueryRequest) Select(bind *pg.Bind, op pg.Op) (string, error)

func (MetadataQueryRequest) String added in v0.2.0

func (r MetadataQueryRequest) String() string

type Object

type Object struct {
	ObjectKey
	ObjectMeta
	ObjectAttr
}

Object represents a single stored item returned by the API.

func (Object) Cell added in v0.2.0

func (r Object) Cell(col int) string

func (Object) Header added in v0.2.0

func (r Object) Header() []string

func (*Object) Scan added in v0.1.2

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

func (Object) String

func (o Object) String() string

func (Object) Width added in v0.2.0

func (r Object) Width(col int) int

type ObjectAttr added in v0.2.0

type ObjectAttr struct {
	Size    int64     `json:"size"`
	ETag    *string   `json:"etag,omitempty"`
	ModTime time.Time `json:"last-modified,omitzero"`
	IsDir   bool      `json:"dir,omitempty"`
}

ObjectAttr represents the attributes of an object, which are immutable and cannot be updated.

type ObjectCreate added in v0.2.0

type ObjectCreate struct {
	ObjectKey
	ObjectMeta
	ObjectAttr
}

ObjectCreate represents the result of creating an object in the database as part of indexing

func (ObjectCreate) Insert added in v0.2.0

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

type ObjectKey added in v0.1.2

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

ObjectKey represents the unique identifier of an object, which consists of a volume and a path.

func (ObjectKey) Select added in v0.1.2

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

func (ObjectKey) String added in v0.1.2

func (k ObjectKey) String() string

type ObjectList added in v0.2.0

type ObjectList struct {
	ObjectListRequest
	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 (*ObjectList) Scan added in v0.2.0

func (l *ObjectList) Scan(row pg.Row) error

func (*ObjectList) ScanCount added in v0.2.0

func (l *ObjectList) ScanCount(row pg.Row) error

func (ObjectList) String added in v0.2.0

func (r ObjectList) String() string

type ObjectListRequest added in v0.2.0

type ObjectListRequest struct {
	pg.OffsetLimit
	Volume    *string `json:"volume,omitempty"`    // optional volume name to filter by
	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
	Type      *string `json:"type,omitempty"`      // optional content type to filter by
}

func (ObjectListRequest) Query added in v0.2.0

func (r ObjectListRequest) Query() url.Values

func (*ObjectListRequest) Select added in v0.2.0

func (r *ObjectListRequest) Select(bind *pg.Bind, op pg.Op) (string, error)

func (ObjectListRequest) String added in v0.2.0

func (r ObjectListRequest) String() string

type ObjectMeta

type ObjectMeta struct {
	ContentType string `json:"type,omitempty"`
	Meta        []Meta `json:"meta,omitempty"`
}

ObjectMeta represents the metadata of an object, which can be updated.

func (ObjectMeta) Update added in v0.2.0

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

type ObjectTouch added in v0.2.0

type ObjectTouch ObjectKey

func (ObjectTouch) Select added in v0.2.0

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

type ReadObjectRequest

type ReadObjectRequest struct {
	GetObjectRequest
}

type Volume added in v0.2.0

type Volume struct {
	VolumeCreate
	Name      string     `json:"name,omitempty"`
	CreatedAt time.Time  `json:"created_at,omitempty"`
	IndexedAt *time.Time `json:"indexed_at,omitempty"`
}

func (*Volume) Scan added in v0.2.0

func (v *Volume) Scan(row pg.Row) error

func (Volume) String added in v0.2.0

func (v Volume) String() string

type VolumeCreate added in v0.2.0

type VolumeCreate struct {
	URL string `json:"url,omitempty" arg:"" help:"URL of the volume to create"`
	VolumeMeta
}

func (VolumeCreate) Insert added in v0.2.0

func (v VolumeCreate) Insert(bind *pg.Bind) (string, error)

type VolumeList added in v0.2.0

type VolumeList struct {
	VolumeListRequest
	Count uint64    `json:"count,omitempty"`
	Body  []*Volume `json:"body,omitempty"`
}

func (*VolumeList) Scan added in v0.2.0

func (v *VolumeList) Scan(row pg.Row) error

func (*VolumeList) ScanCount added in v0.2.0

func (v *VolumeList) ScanCount(row pg.Row) error

func (VolumeList) String added in v0.2.0

func (v VolumeList) String() string

type VolumeListRequest added in v0.2.0

type VolumeListRequest struct {
	Enabled *bool `json:"enabled,omitempty" help:"returns only enabled or disabled volumes"`
	Stale   bool  `json:"stale,omitzero" help:"returns volumes that need to be re-indexed"`
	pg.OffsetLimit
}

func (*VolumeListRequest) Select added in v0.2.0

func (v *VolumeListRequest) Select(bind *pg.Bind, op pg.Op) (string, error)

func (VolumeListRequest) String added in v0.2.0

func (v VolumeListRequest) String() string

type VolumeMeta added in v0.2.0

type VolumeMeta struct {
	Enabled    *bool          `json:"enabled,omitempty" negatable:""`
	IndexDelta *time.Duration `json:"delta,omitempty"` // if non-zero, forces a full re-index if the last index is older than this duration
}

func (VolumeMeta) Insert added in v0.2.0

func (v VolumeMeta) Insert(bind *pg.Bind) (string, error)

func (VolumeMeta) String added in v0.2.0

func (v VolumeMeta) String() string

func (VolumeMeta) Update added in v0.2.0

func (v VolumeMeta) Update(bind *pg.Bind) error

type VolumeName added in v0.2.0

type VolumeName string

func (VolumeName) Select added in v0.2.0

func (v VolumeName) Select(bind *pg.Bind, op pg.Op) (string, error)

type VolumeTouch added in v0.2.0

type VolumeTouch string

func (VolumeTouch) Select added in v0.2.0

func (v VolumeTouch) Select(bind *pg.Bind, op pg.Op) (string, error)

Jump to

Keyboard shortcuts

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