Documentation
¶
Index ¶
- Variables
- func BuildAPIURL(path string) string
- func GetAPIBaseURL() string
- func Handler() http.Handler
- func Log(ctx app.Context, level LogLevel, message string, attrs map[string]interface{})
- func LogDebug(ctx app.Context, message string, attrs map[string]interface{})
- func LogError(ctx app.Context, message string, attrs map[string]interface{})
- func LogInfo(ctx app.Context, message string, attrs map[string]interface{})
- func LogWarn(ctx app.Context, message string, attrs map[string]interface{})
- func ManualLog(ctx app.Context)
- func RegisterRoutes()
- type AboutInfo
- type AboutPage
- type App
- type BrowsePage
- type CleanPage
- type Dimension
- type DimensionValue
- type Document
- type DocumentCard
- type DocumentStatus
- type EditPage
- type FileSystem
- type FileTreeNode
- type HomePage
- type IngestPage
- type Job
- type JobsPage
- type LogLevel
- type ManualLogPage
- type NavBar
- type NotFoundPage
- type PaginatedResponse
- type RecentSearch
- type RouteConfig
- type SavedSearchWithCount
- type SavedSearchesPage
- type SearchAPIResponse
- type SearchPage
- type SearchResultItem
- type SearchResultsPage
- type Sidebar
- type Tag
- type TagWithUsage
- type TagsManagerPage
- type TextResponse
- type TextViewPage
- type WordCloudMetadata
- type WordCloudPage
- type WordCloudResponse
- type WordFrequency
Constants ¶
This section is empty.
Variables ¶
var ( Version = "dev" BuildDate = "" )
Version info - can be set at build time with -ldflags
var AppRoutes = []RouteConfig{ {Path: "/", Render: func() app.UI { return &HomePage{} }}, {Path: "/browse", Render: func() app.UI { return &BrowsePage{} }}, {Path: "/ingest", Render: func() app.UI { return &IngestPage{} }}, {Path: "/clean", Render: func() app.UI { return &CleanPage{} }}, {Path: "/search", Render: func() app.UI { return &SearchPage{} }}, {Path: "/results", Render: func() app.UI { return &SearchResultsPage{} }}, {Path: "/wordcloud", Render: func() app.UI { return &WordCloudPage{} }}, {Path: "/jobs", Render: func() app.UI { return &JobsPage{} }}, {Path: "/tags", Render: func() app.UI { return &TagsManagerPage{} }}, {Path: "/searches", Render: func() app.UI { return &SavedSearchesPage{} }}, {Path: "/about", Render: func() app.UI { return &AboutPage{} }}, {Path: "/manuallog", Render: func() app.UI { return &ManualLogPage{} }}, { Path: "/edit/", Render: func() app.UI { return &EditPage{} }, MatchFunc: func(path string) bool { return len(path) > 6 && path[:6] == "/edit/" }, }, { Path: "/text/", Render: func() app.UI { return &TextViewPage{} }, MatchFunc: func(path string) bool { return len(path) > 6 && path[:6] == "/text/" }, }, }
AppRoutes defines all application routes and their corresponding pages
Functions ¶
func BuildAPIURL ¶
BuildAPIURL constructs a full API URL from a path Example: BuildAPIURL("/api/documents/latest") -> "http://backend:8000/api/documents/latest" or just "/api/documents/latest" if using relative URLs
func GetAPIBaseURL ¶
func GetAPIBaseURL() string
GetAPIBaseURL returns the configured API base URL Priority: 1) window.godocsBackendURL (detected from wasm_exec.js source)
- window.godocsConfig.apiURL (from config.js)
- Fallback to port 8000 on same host
func Log ¶ added in v0.23.0
Log sends a structured log message to the backend using slog-compatible format This function encapsulates the slog interface for frontend logging
func ManualLog ¶ added in v0.27.8
Log sends a structured log message to the backend using slog-compatible format This function encapsulates the slog interface for frontend logging
func RegisterRoutes ¶ added in v0.28.3
func RegisterRoutes()
RegisterRoutes registers all application routes
Types ¶
type AboutInfo ¶
type AboutInfo struct {
Version string `json:"version"`
OCRConfigured bool `json:"ocrConfigured"`
OCRPath string `json:"ocrPath"`
DatabaseType string `json:"databaseType"`
DatabaseHost string `json:"databaseHost"`
DatabasePort string `json:"databasePort"`
DatabaseName string `json:"databaseName"`
IsEphemeral bool `json:"isEphemeral"`
IngressPath string `json:"ingressPath"`
DocumentPath string `json:"documentPath"`
LogLevel string `json:"logLevel"`
SchemaVersion string `json:"schemaVersion"`
}
AboutInfo represents the about information from the API
type AboutPage ¶
AboutPage displays information about the application
type BrowsePage ¶
BrowsePage displays the document file tree
func (*BrowsePage) OnMount ¶
func (b *BrowsePage) OnMount(ctx app.Context)
OnMount is called when the component is mounted
type CleanPage ¶
CleanPage allows users to clean the database by removing orphaned entries
func (*CleanPage) OnDismount ¶ added in v0.32.0
func (c *CleanPage) OnDismount()
OnDismount stops the poll ticker when leaving the page
type Dimension ¶ added in v0.22.1
type Dimension struct {
ID int `json:"id"`
Name string `json:"name"`
DisplayName string `json:"display_name"`
Values []DimensionValue `json:"values"`
}
Dimension represents a dimension with its values
type DimensionValue ¶ added in v0.22.1
type DimensionValue struct {
ID int `json:"id"`
Value string `json:"value"`
DisplayName string `json:"display_name"`
Color string `json:"color"`
}
DimensionValue represents a dimension value
type Document ¶
type Document struct {
ID int `json:"ID"`
Name string `json:"Name"`
Path string `json:"Path"`
IngressTime string `json:"IngressTime"`
Folder string `json:"Folder"`
Hash string `json:"Hash"`
ULID string `json:"ULID"`
DocumentType string `json:"DocumentType"`
FullText string `json:"FullText"`
URL string `json:"URL"`
ThumbnailURL string `json:"thumbnailURL,omitempty"`
}
Document represents a document from the API
type DocumentCard ¶
DocumentCard displays a single document card
func (*DocumentCard) OnMount ¶ added in v0.33.0
func (d *DocumentCard) OnMount(ctx app.Context)
OnMount is called when the component is mounted - fetches document tags
func (*DocumentCard) Render ¶
func (d *DocumentCard) Render() app.UI
Render renders the document card
type DocumentStatus ¶ added in v0.32.0
type DocumentStatus struct {
ULID string `json:"ulid"`
Name string `json:"name"`
Path string `json:"path"`
DocumentType string `json:"documentType"`
HasThumbnail bool `json:"hasThumbnail"`
ThumbnailURL string `json:"thumbnailURL,omitempty"`
HasText bool `json:"hasText"`
TextLength int `json:"textLength"`
TextURL string `json:"textURL,omitempty"`
HasTags bool `json:"hasTags"`
TagCount int `json:"tagCount"`
ViewURL string `json:"viewURL"`
IngressTime string `json:"ingressTime"`
FileExists bool `json:"fileExists"`
FileSizeBytes int64 `json:"fileSizeBytes,omitempty"`
}
DocumentStatus represents status information for a document
type EditPage ¶ added in v0.22.1
EditPage allows editing document tags (unified with grouped tags for dimensions)
type FileSystem ¶
type FileSystem struct {
FileSystem []FileTreeNode `json:"fileSystem"`
Error string `json:"error"`
Warnings []string `json:"warnings,omitempty"`
}
FileSystem represents the API response
type FileTreeNode ¶
type FileTreeNode struct {
ID string `json:"id"`
ULID string `json:"ulid"`
Name string `json:"name"`
Size int64 `json:"size"`
ModDate string `json:"modDate"`
Openable bool `json:"openable"`
ParentID string `json:"parentID"`
IsDir bool `json:"isDir"`
ChildrenIDs []string `json:"childrenIDs"`
FullPath string `json:"fullPath"`
FileURL string `json:"fileURL"`
ThumbnailURL string `json:"thumbnailURL,omitempty"`
}
FileTreeNode represents a node in the file tree
type HomePage ¶
HomePage displays the latest documents with pagination
type IngestPage ¶
IngestPage allows users to trigger the ingestion process manually
type Job ¶
type Job struct {
ID string `json:"id"`
Type string `json:"type"`
Status string `json:"status"`
Progress int `json:"progress"`
CurrentStep string `json:"currentStep"`
TotalSteps int `json:"totalSteps"`
Message string `json:"message"`
Error string `json:"error,omitempty"`
Result string `json:"result,omitempty"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
StartedAt string `json:"startedAt,omitempty"`
CompletedAt string `json:"completedAt,omitempty"`
}
Job represents a background job
type JobsPage ¶
JobsPage displays and manages background jobs
func (*JobsPage) OnDismount ¶
func (j *JobsPage) OnDismount()
OnDismount is called when the component is unmounted
type LogLevel ¶ added in v0.23.0
type LogLevel string
LogLevel represents log severity levels matching slog
type ManualLogPage ¶ added in v0.27.8
AboutPage displays information about the application
func (*ManualLogPage) OnMount ¶ added in v0.28.4
func (m *ManualLogPage) OnMount(ctx app.Context)
OnMount is called when the ManualLogPage component is mounted
func (*ManualLogPage) Render ¶ added in v0.28.2
func (a *ManualLogPage) Render() app.UI
Render renders ManualLog page just to say we were here
type NavBar ¶
type NavBar struct {
// contains filtered or unexported fields
}
NavBar is the navigation bar component
func (*NavBar) OnDismount ¶
func (n *NavBar) OnDismount()
OnDismount is called when the component is unmounted
type NotFoundPage ¶
NotFoundPage displays a 404 error message
func (*NotFoundPage) OnNav ¶ added in v0.27.1
func (p *NotFoundPage) OnNav(ctx app.Context)
OnNav is called when this page is navigated to
type PaginatedResponse ¶
type PaginatedResponse struct {
Documents []Document `json:"documents"`
Page int `json:"page"`
PageSize int `json:"pageSize"`
TotalCount int `json:"totalCount"`
TotalPages int `json:"totalPages"`
HasNext bool `json:"hasNext"`
HasPrevious bool `json:"hasPrevious"`
}
PaginatedResponse represents the paginated API response
type RecentSearch ¶ added in v0.34.0
type RecentSearch struct {
Query string `json:"query"`
Name string `json:"name"`
SearchID int `json:"searchId,omitempty"`
Timestamp int64 `json:"timestamp"`
TotalCount int `json:"totalCount"`
}
RecentSearch represents a recent search for localStorage
type RouteConfig ¶ added in v0.28.3
type RouteConfig struct {
Path string
Render func() app.UI
MatchFunc func(path string) bool // Optional: custom path matching logic
}
RouteConfig defines a route and its render function
type SavedSearchWithCount ¶ added in v0.34.0
type SavedSearchWithCount struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Query string `json:"query"`
Icon string `json:"icon"`
SortOrder int `json:"sort_order"`
IsSystem bool `json:"is_system"`
DocumentCount int `json:"document_count"`
}
SavedSearchWithCount matches the API response
type SavedSearchesPage ¶ added in v0.35.0
SavedSearchesPage displays and manages all saved searches in the system
func (*SavedSearchesPage) OnMount ¶ added in v0.35.0
func (s *SavedSearchesPage) OnMount(ctx app.Context)
OnMount is called when the component is mounted
func (*SavedSearchesPage) Render ¶ added in v0.35.0
func (s *SavedSearchesPage) Render() app.UI
Render renders the saved searches manager page
type SearchAPIResponse ¶ added in v0.34.0
type SearchAPIResponse struct {
Documents []Document `json:"documents"`
Page int `json:"page"`
PageSize int `json:"pageSize"`
TotalCount int `json:"totalCount"`
TotalPages int `json:"totalPages"`
HasNext bool `json:"hasNext"`
HasPrevious bool `json:"hasPrevious"`
Query string `json:"query"`
SearchName string `json:"searchName,omitempty"`
}
SearchAPIResponse matches the SearchResponse from the API
type SearchPage ¶
SearchPage provides full-text search functionality
func (*SearchPage) OnMount ¶
func (s *SearchPage) OnMount(ctx app.Context)
OnMount is called when the component is mounted
type SearchResultItem ¶
type SearchResultItem struct {
app.Compo
Node FileTreeNode
// contains filtered or unexported fields
}
SearchResultItem displays a single search result
func (*SearchResultItem) OnMount ¶ added in v0.36.1
func (s *SearchResultItem) OnMount(ctx app.Context)
OnMount is called when the component is mounted - fetches document tags
func (*SearchResultItem) Render ¶
func (s *SearchResultItem) Render() app.UI
Render renders the search result item
type SearchResultsPage ¶ added in v0.34.0
SearchResultsPage displays search results with pagination
func (*SearchResultsPage) OnMount ¶ added in v0.34.0
func (s *SearchResultsPage) OnMount(ctx app.Context)
OnMount is called when the component is mounted
func (*SearchResultsPage) Render ¶ added in v0.34.0
func (s *SearchResultsPage) Render() app.UI
Render renders the search results page
type Sidebar ¶
Sidebar is the left sidebar menu component
type Tag ¶ added in v0.22.1
type Tag struct {
ID int `json:"id"`
Name string `json:"name"`
Color string `json:"color"`
Description string `json:"description"`
TagGroup *string `json:"tag_group"`
SortOrder int `json:"sort_order"`
}
Tag represents a tag from the API
type TagWithUsage ¶ added in v0.33.0
type TagWithUsage struct {
ID int `json:"id"`
Name string `json:"name"`
Color string `json:"color"`
Description string `json:"description"`
TagGroup *string `json:"tag_group"`
SortOrder int `json:"sort_order"`
UsageCount int `json:"usageCount"`
}
TagWithUsage represents a tag with its usage count from the API
type TagsManagerPage ¶ added in v0.33.0
TagsManagerPage displays and manages all tags in the system
func (*TagsManagerPage) OnMount ¶ added in v0.33.0
func (t *TagsManagerPage) OnMount(ctx app.Context)
OnMount is called when the component is mounted
func (*TagsManagerPage) Render ¶ added in v0.33.0
func (t *TagsManagerPage) Render() app.UI
Render renders the tags manager page
type TextResponse ¶ added in v0.32.2
type TextResponse struct {
ULID string `json:"ulid"`
Name string `json:"name"`
Text string `json:"text"`
}
TextResponse represents the API response for document text
type TextViewPage ¶ added in v0.32.2
TextViewPage displays the extracted text content of a document
func (*TextViewPage) OnMount ¶ added in v0.32.2
func (t *TextViewPage) OnMount(ctx app.Context)
OnMount is called when the component is mounted
func (*TextViewPage) Render ¶ added in v0.32.2
func (t *TextViewPage) Render() app.UI
Render renders the text view page
type WordCloudMetadata ¶
type WordCloudMetadata struct {
LastCalculation string `json:"lastCalculation"`
TotalDocsProcessed int `json:"totalDocsProcessed"`
TotalWordsIndexed int `json:"totalWordsIndexed"`
Version int `json:"version"`
}
WordCloudMetadata contains metadata about the word cloud
type WordCloudPage ¶
WordCloudPage displays a word cloud of the most frequent words
func (*WordCloudPage) OnMount ¶
func (w *WordCloudPage) OnMount(ctx app.Context)
OnMount is called when the component is mounted
func (*WordCloudPage) Render ¶
func (w *WordCloudPage) Render() app.UI
Render renders the word cloud page
type WordCloudResponse ¶
type WordCloudResponse struct {
Words []WordFrequency `json:"words"`
Metadata *WordCloudMetadata `json:"metadata"`
Count int `json:"count"`
}
WordCloudResponse is the API response structure
type WordFrequency ¶
WordFrequency represents a word and its frequency