Documentation
¶
Index ¶
- Variables
- func DocumentText(name string, mimeType string, data []byte) (string, string, error)
- func NewDeleteTool(store deleteStore) tools.Executor
- func NewListTool(store listStore) tools.Executor
- func NewReadTool(store readStore) tools.Executor
- func NewSaveTemporaryTool(store saveTemporaryStore) tools.Executor
- func NewSaveTool(store saveStore) tools.Executor
- func NewUpdateMetadataTool(store updateMetadataStore) tools.Executor
- type CleanupResponse
- type CleanupResult
- type Config
- type Entry
- type FileResponse
- type FileSaveRequest
- type ListFilter
- type ListResult
- type LocalStore
- func (s *LocalStore) CleanupTemporary() (CleanupResult, error)
- func (s *LocalStore) CopyTemporary(rawPath string, destPath string) (Entry, error)
- func (s *LocalStore) Delete(rawPath string) (Entry, error)
- func (s *LocalStore) DeleteTemporary(rawPath string) (TempEntry, error)
- func (s *LocalStore) List(prefix string, query string, limit int) ([]Entry, error)
- func (s *LocalStore) ListTemporary(limit int) (TempListResult, error)
- func (s *LocalStore) LocalPath(rawPath string, temporary bool) string
- func (s *LocalStore) PromoteTemporary(rawPath string, destPath string) (Entry, error)
- func (s *LocalStore) Read(rawPath string, maxBytes int64) (Entry, string, error)
- func (s *LocalStore) ReadBytes(rawPath string, maxBytes int64) (Entry, []byte, error)
- func (s *LocalStore) ReadTemporaryBytes(rawPath string) (TempEntry, []byte, error)
- func (s *LocalStore) Root() string
- func (s *LocalStore) Save(rawPath string, content string, title string, tags []string, mimeType string) (Entry, error)
- func (s *LocalStore) SaveBytes(rawPath string, content []byte, title string, tags []string, mimeType string) (Entry, error)
- func (s *LocalStore) SaveTemporary(rawPath string, content []byte, title string, tags []string, mimeType string) (TempEntry, error)
- func (s *LocalStore) UpdateMetadata(rawPath string, title string, tags []string, mimeType string) (Entry, error)
- func (s *LocalStore) UpdateTemporarySettings(autoCleanup *bool, ttlDays int64, maxGB float64) (TempSettings, error)
- type Module
- type ReadBytesResponse
- type ReadResult
- type TempEntry
- type TempFileResponse
- type TempListResult
- type TempPromoteRequest
- type TempReadBytesResponse
- type TempSettings
- type TempSettingsResponse
- type TempSettingsUpdateRequest
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidPath = errors.New("invalid storage path") ErrNotFound = errors.New("storage file not found") )
Functions ¶
func DocumentText ¶ added in v0.2.4
DocumentText is the text of a stored file, with what it was read as: plain text in UTF-8, UTF-16 or Windows-1251, a PDF, an office document or the listing of an archive.
func NewDeleteTool ¶
func NewListTool ¶
func NewReadTool ¶
func NewSaveTemporaryTool ¶
func NewSaveTool ¶
func NewUpdateMetadataTool ¶
Types ¶
type CleanupResponse ¶
type CleanupResponse struct {
Cleanup CleanupResult `json:"cleanup"`
}
type CleanupResult ¶
type FileResponse ¶
type FileResponse struct {
File Entry `json:"file"`
}
type FileSaveRequest ¶
type FileSaveRequest struct {
Path string `json:"path"`
ContentBase64 string `json:"content_base64"`
Title string `json:"title"`
Tags []string `json:"tags"`
MIMEType string `json:"mime_type"`
}
func NewFileSaveRequest ¶
func (FileSaveRequest) ContentBytes ¶
func (r FileSaveRequest) ContentBytes() ([]byte, error)
func (*FileSaveRequest) UnmarshalJSON ¶
func (r *FileSaveRequest) UnmarshalJSON(data []byte) error
type ListFilter ¶
type ListResult ¶
type LocalStore ¶
type LocalStore struct {
// contains filtered or unexported fields
}
func NewLocalStore ¶
func NewLocalStore(root string, maxBytes int64) (*LocalStore, error)
func (*LocalStore) CleanupTemporary ¶
func (s *LocalStore) CleanupTemporary() (CleanupResult, error)
func (*LocalStore) CopyTemporary ¶
func (s *LocalStore) CopyTemporary(rawPath string, destPath string) (Entry, error)
func (*LocalStore) DeleteTemporary ¶
func (s *LocalStore) DeleteTemporary(rawPath string) (TempEntry, error)
func (*LocalStore) ListTemporary ¶
func (s *LocalStore) ListTemporary(limit int) (TempListResult, error)
func (*LocalStore) LocalPath ¶ added in v0.2.4
func (s *LocalStore) LocalPath(rawPath string, temporary bool) string
LocalPath is where a stored file lies on disk, for tools that take a file path; it is empty for a path storage would refuse.
func (*LocalStore) PromoteTemporary ¶
func (s *LocalStore) PromoteTemporary(rawPath string, destPath string) (Entry, error)
func (*LocalStore) ReadTemporaryBytes ¶
func (s *LocalStore) ReadTemporaryBytes(rawPath string) (TempEntry, []byte, error)
func (*LocalStore) Root ¶
func (s *LocalStore) Root() string
func (*LocalStore) SaveTemporary ¶
func (*LocalStore) UpdateMetadata ¶
func (*LocalStore) UpdateTemporarySettings ¶
func (s *LocalStore) UpdateTemporarySettings(autoCleanup *bool, ttlDays int64, maxGB float64) (TempSettings, error)
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func (*Module) Store ¶
func (m *Module) Store() *LocalStore
type ReadBytesResponse ¶ added in v0.1.15
type ReadBytesResponse struct {
File Entry `json:"file"`
ContentBase64 string `json:"content_base64"`
}
func NewReadBytesResponse ¶ added in v0.1.15
func NewReadBytesResponse(file Entry, content []byte) ReadBytesResponse
func (ReadBytesResponse) ContentBytes ¶ added in v0.1.15
func (r ReadBytesResponse) ContentBytes() ([]byte, error)
type ReadResult ¶
type TempFileResponse ¶
type TempFileResponse struct {
File TempEntry `json:"file"`
}
type TempListResult ¶
type TempListResult struct {
Root string `json:"root"`
Files []TempEntry `json:"files"`
Settings TempSettings `json:"settings"`
}
type TempPromoteRequest ¶
type TempPromoteRequest struct {
DestPath string `json:"dest_path"`
}
type TempReadBytesResponse ¶ added in v0.1.15
type TempReadBytesResponse struct {
File TempEntry `json:"file"`
ContentBase64 string `json:"content_base64"`
}
func NewTempReadBytesResponse ¶ added in v0.1.15
func NewTempReadBytesResponse(file TempEntry, content []byte) TempReadBytesResponse
func (TempReadBytesResponse) ContentBytes ¶ added in v0.1.15
func (r TempReadBytesResponse) ContentBytes() ([]byte, error)
type TempSettings ¶
type TempSettingsResponse ¶
type TempSettingsResponse struct {
Settings TempSettings `json:"settings"`
}