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 EditPage
- type FileSystem
- type FileTreeNode
- type HomePage
- type IngestPage
- type Job
- type JobsPage
- type LogLevel
- type ManualLogPage
- type NavBar
- type NotFoundPage
- type PaginatedResponse
- type RouteConfig
- type SearchPage
- type SearchResultItem
- type Sidebar
- type Tag
- 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: "/wordcloud", Render: func() app.UI { return &WordCloudPage{} }}, {Path: "/jobs", Render: func() app.UI { return &JobsPage{} }}, {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/" }, }, }
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 It reads from window.godocsConfig.apiURL if available, otherwise falls back to empty string (relative URLs)
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"`
}
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 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 {
StormID int `json:"StormID"`
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) Render ¶
func (d *DocumentCard) Render() app.UI
Render renders the document card
type EditPage ¶ added in v0.22.1
EditPage allows editing document tags and dimensions
type FileSystem ¶
type FileSystem struct {
FileSystem []FileTreeNode `json:"fileSystem"`
Error string `json:"error"`
}
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 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 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
}
SearchResultItem displays a single search result
func (*SearchResultItem) Render ¶
func (s *SearchResultItem) Render() app.UI
Render renders the search result item
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"`
}
Tag represents a tag from the API
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