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: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSchema = "filer"
	NotifyChannel = "filer_changes"
)
View Source
const (
	VolumeListLimit      = 100
	ObjectListLimit      = 100
	CredentialListLimit  = 100
	MetadataListLimit    = 100
	LLMProviderListLimit = 100
	SearchListLimit      = 25

	// 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 Credential added in v0.2.7

type Credential struct {
	CredentialKey
	UpdatedAt time.Time `json:"updated_at" help:"Update timestamp" readonly:""`
}

Credential is the public credential row returned from the database. Secret material and passphrase version are intentionally excluded.

func (Credential) Cell added in v0.2.9

func (r Credential) Cell(col int) string

func (Credential) Header added in v0.2.9

func (r Credential) Header() []string

func (*Credential) Scan added in v0.2.7

func (c *Credential) Scan(row pg.Row) error

Expected column order: key, updated_at.

func (Credential) String added in v0.2.7

func (c Credential) String() string

func (Credential) Width added in v0.2.9

func (r Credential) Width(col int) int

type CredentialCreate added in v0.2.9

type CredentialCreate struct {
	CredentialKey
	Credentials any `json:"credentials" help:"Credential value"`
}

CredentialCreate contains the values required to create a credential row. The returned Credential omits PV and Credentials.

func (CredentialCreate) Insert added in v0.2.9

func (c CredentialCreate) Insert(bind *pg.Bind) (string, error)

func (CredentialCreate) RedactedString added in v0.2.9

func (c CredentialCreate) RedactedString() string

func (*CredentialCreate) Scan added in v0.2.9

func (c *CredentialCreate) Scan(row pg.Row) error

Expected column order: key, credential.

func (CredentialCreate) String added in v0.2.9

func (c CredentialCreate) String() string

func (CredentialCreate) Update added in v0.2.9

func (c CredentialCreate) Update(_ *pg.Bind) error

type CredentialKey added in v0.2.7

type CredentialKey struct {
	Key string `json:"key" help:"Credential key"`
}

func (CredentialKey) Select added in v0.2.9

func (c CredentialKey) Select(bind *pg.Bind, op pg.Op) (string, error)

type CredentialList added in v0.2.9

type CredentialList struct {
	CredentialListRequest
	Count uint64        `json:"count,omitempty"`
	Body  []*Credential `json:"body,omitempty"`
}

func (*CredentialList) Scan added in v0.2.9

func (c *CredentialList) Scan(rows pg.Row) error

func (*CredentialList) ScanCount added in v0.2.9

func (c *CredentialList) ScanCount(row pg.Row) error

func (CredentialList) String added in v0.2.9

func (c CredentialList) String() string

type CredentialListRequest added in v0.2.9

type CredentialListRequest struct {
	pg.OffsetLimit
}

func (CredentialListRequest) Query added in v0.2.9

func (r CredentialListRequest) Query() url.Values

func (*CredentialListRequest) Select added in v0.2.9

func (c *CredentialListRequest) Select(bind *pg.Bind, op pg.Op) (string, error)

func (CredentialListRequest) String added in v0.2.9

func (c CredentialListRequest) 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 LLMProvider added in v0.2.10

type LLMProvider struct {
	LLMProviderCreate
	CreatedAt time.Time `json:"created_at,omitempty"`
}

func (LLMProvider) Cell added in v0.2.10

func (r LLMProvider) Cell(col int) string

func (LLMProvider) Header added in v0.2.10

func (r LLMProvider) Header() []string

func (*LLMProvider) Scan added in v0.2.10

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

func (LLMProvider) String added in v0.2.10

func (l LLMProvider) String() string

func (LLMProvider) Width added in v0.2.10

func (r LLMProvider) Width(col int) int

type LLMProviderCreate added in v0.2.10

type LLMProviderCreate struct {
	LLMProviderMeta
	Provider string `json:"provider,omitempty" arg:"" help:"Provider type (e.g. ollama, anthropic, openai)"`
}

func (LLMProviderCreate) Insert added in v0.2.10

func (l LLMProviderCreate) Insert(bind *pg.Bind) (string, error)

func (LLMProviderCreate) String added in v0.2.10

func (l LLMProviderCreate) String() string

type LLMProviderList added in v0.2.10

type LLMProviderList struct {
	LLMProviderListRequest
	Count uint64         `json:"count,omitempty"`
	Body  []*LLMProvider `json:"body,omitempty"`
}

func (*LLMProviderList) Scan added in v0.2.10

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

func (*LLMProviderList) ScanCount added in v0.2.10

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

func (LLMProviderList) String added in v0.2.10

func (l LLMProviderList) String() string

type LLMProviderListRequest added in v0.2.10

type LLMProviderListRequest struct {
	pg.OffsetLimit
}

func (LLMProviderListRequest) Query added in v0.2.10

func (r LLMProviderListRequest) Query() url.Values

func (*LLMProviderListRequest) Select added in v0.2.10

func (l *LLMProviderListRequest) Select(bind *pg.Bind, op pg.Op) (string, error)

func (LLMProviderListRequest) String added in v0.2.10

func (l LLMProviderListRequest) String() string

type LLMProviderMeta added in v0.2.10

type LLMProviderMeta struct {
	Name       *string `json:"name,omitempty" help:"Provider name"`
	URL        *string `json:"url,omitempty" help:"Provider URL"`
	Credential *string `json:"credential,omitempty" help:"Credential key for authentication"`
}

func (LLMProviderMeta) Insert added in v0.2.10

func (l LLMProviderMeta) Insert(bind *pg.Bind) (string, error)

func (LLMProviderMeta) String added in v0.2.10

func (l LLMProviderMeta) String() string

func (LLMProviderMeta) Update added in v0.2.10

func (l LLMProviderMeta) Update(bind *pg.Bind) error

type LLMProviderName added in v0.2.10

type LLMProviderName string

func (LLMProviderName) Select added in v0.2.10

func (l LLMProviderName) Select(bind *pg.Bind, op pg.Op) (string, error)

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 SearchList added in v0.2.10

type SearchList struct {
	SearchListRequest
	Count uint64          `json:"count"`
	Body  []*SearchResult `json:"body"`
}

func (*SearchList) Scan added in v0.2.10

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

func (*SearchList) ScanCount added in v0.2.10

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

func (SearchList) String added in v0.2.10

func (r SearchList) String() string

type SearchListRequest added in v0.2.10

type SearchListRequest struct {
	Volumes []string `json:"volumes" help:"List of volumes to search"`
	Text    string   `json:"query" arg:"" name:"query" help:"Search query"`
	pg.OffsetLimit
}

func (SearchListRequest) Query added in v0.2.10

func (r SearchListRequest) Query() url.Values

func (*SearchListRequest) Select added in v0.2.10

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

func (SearchListRequest) String added in v0.2.10

func (r SearchListRequest) String() string

type SearchResult added in v0.2.10

type SearchResult struct {
	Title   string  `json:"title"`
	Summary string  `json:"summary"`
	Rank    float64 `json:"rank"`
	Object
}

func (SearchResult) Cell added in v0.2.10

func (r SearchResult) Cell(col int) string

func (SearchResult) Header added in v0.2.10

func (r SearchResult) Header() []string

func (*SearchResult) Scan added in v0.2.10

func (s *SearchResult) Scan(row pg.Row) error

func (SearchResult) String added in v0.2.10

func (r SearchResult) String() string

func (SearchResult) Width added in v0.2.10

func (r SearchResult) Width(col int) int

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"`
	Objects   uint64     `json:"objects,omitempty"`
}

func (Volume) Cell added in v0.2.7

func (r Volume) Cell(col int) string

func (Volume) Header added in v0.2.7

func (r Volume) Header() []string

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

func (Volume) Width added in v0.2.7

func (r Volume) Width(col int) int

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" negatable:""`
	Stale   bool  `json:"stale,omitzero" help:"returns volumes that need to be re-indexed" negatable:""`
	pg.OffsetLimit
}

func (VolumeListRequest) Query added in v0.2.7

func (r VolumeListRequest) Query() url.Values

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