Documentation
¶
Overview ¶
Package api provides the implementation of the API server for the application.
Index ¶
- type API
- type Config
- type MockService
- func (_m *MockService) EXPECT() *MockService_Expecter
- func (_m *MockService) GetAsset(ctx context.Context, repo string, path string) ([]byte, error)
- func (_m *MockService) GetDocument(ctx context.Context, repo string, path string) (core.Document, []byte, []core.Heading, error)
- func (_m *MockService) IngestDocuments(ctx context.Context, req *core.IngestRequest) (*core.IngestResponse, error)
- func (_m *MockService) ListDocuments(ctx context.Context, repo string) ([]core.DocumentMeta, error)
- func (_m *MockService) ListRepos(ctx context.Context) ([]core.RepoInfo, error)
- func (_m *MockService) SearchDocs(ctx context.Context, query string, opts core.SearchOpts) (*core.SearchResults, error)
- type MockService_Expecter
- func (_e *MockService_Expecter) GetAsset(ctx interface{}, repo interface{}, path interface{}) *MockService_GetAsset_Call
- func (_e *MockService_Expecter) GetDocument(ctx interface{}, repo interface{}, path interface{}) *MockService_GetDocument_Call
- func (_e *MockService_Expecter) IngestDocuments(ctx interface{}, req interface{}) *MockService_IngestDocuments_Call
- func (_e *MockService_Expecter) ListDocuments(ctx interface{}, repo interface{}) *MockService_ListDocuments_Call
- func (_e *MockService_Expecter) ListRepos(ctx interface{}) *MockService_ListRepos_Call
- func (_e *MockService_Expecter) SearchDocs(ctx interface{}, query interface{}, opts interface{}) *MockService_SearchDocs_Call
- type MockService_GetAsset_Call
- func (_c *MockService_GetAsset_Call) Return(_a0 []byte, _a1 error) *MockService_GetAsset_Call
- func (_c *MockService_GetAsset_Call) Run(run func(ctx context.Context, repo string, path string)) *MockService_GetAsset_Call
- func (_c *MockService_GetAsset_Call) RunAndReturn(run func(context.Context, string, string) ([]byte, error)) *MockService_GetAsset_Call
- type MockService_GetDocument_Call
- func (_c *MockService_GetDocument_Call) Return(_a0 core.Document, _a1 []byte, _a2 []core.Heading, _a3 error) *MockService_GetDocument_Call
- func (_c *MockService_GetDocument_Call) Run(run func(ctx context.Context, repo string, path string)) *MockService_GetDocument_Call
- func (_c *MockService_GetDocument_Call) RunAndReturn(...) *MockService_GetDocument_Call
- type MockService_IngestDocuments_Call
- func (_c *MockService_IngestDocuments_Call) Return(_a0 *core.IngestResponse, _a1 error) *MockService_IngestDocuments_Call
- func (_c *MockService_IngestDocuments_Call) Run(run func(ctx context.Context, req *core.IngestRequest)) *MockService_IngestDocuments_Call
- func (_c *MockService_IngestDocuments_Call) RunAndReturn(run func(context.Context, *core.IngestRequest) (*core.IngestResponse, error)) *MockService_IngestDocuments_Call
- type MockService_ListDocuments_Call
- func (_c *MockService_ListDocuments_Call) Return(_a0 []core.DocumentMeta, _a1 error) *MockService_ListDocuments_Call
- func (_c *MockService_ListDocuments_Call) Run(run func(ctx context.Context, repo string)) *MockService_ListDocuments_Call
- func (_c *MockService_ListDocuments_Call) RunAndReturn(run func(context.Context, string) ([]core.DocumentMeta, error)) *MockService_ListDocuments_Call
- type MockService_ListRepos_Call
- func (_c *MockService_ListRepos_Call) Return(_a0 []core.RepoInfo, _a1 error) *MockService_ListRepos_Call
- func (_c *MockService_ListRepos_Call) Run(run func(ctx context.Context)) *MockService_ListRepos_Call
- func (_c *MockService_ListRepos_Call) RunAndReturn(run func(context.Context) ([]core.RepoInfo, error)) *MockService_ListRepos_Call
- type MockService_SearchDocs_Call
- func (_c *MockService_SearchDocs_Call) Return(_a0 *core.SearchResults, _a1 error) *MockService_SearchDocs_Call
- func (_c *MockService_SearchDocs_Call) Run(run func(ctx context.Context, query string, opts core.SearchOpts)) *MockService_SearchDocs_Call
- func (_c *MockService_SearchDocs_Call) RunAndReturn(...) *MockService_SearchDocs_Call
- type MockViewRenderer
- func (_m *MockViewRenderer) EXPECT() *MockViewRenderer_Expecter
- func (_m *MockViewRenderer) RenderDoc(w io.Writer, doc core.Document, html []byte, headings []core.Heading, ...) error
- func (_m *MockViewRenderer) RenderHome(w io.Writer, repos []core.RepoInfo, partial bool) error
- func (_m *MockViewRenderer) RenderNotFound(w io.Writer) error
- func (_m *MockViewRenderer) RenderRepoIndex(w io.Writer, repo string, docs []core.DocumentMeta, partial bool) error
- func (_m *MockViewRenderer) RenderSearch(w io.Writer, query string, results *core.SearchResults, partial bool) error
- type MockViewRenderer_Expecter
- func (_e *MockViewRenderer_Expecter) RenderDoc(w interface{}, doc interface{}, html interface{}, headings interface{}, ...) *MockViewRenderer_RenderDoc_Call
- func (_e *MockViewRenderer_Expecter) RenderHome(w interface{}, repos interface{}, partial interface{}) *MockViewRenderer_RenderHome_Call
- func (_e *MockViewRenderer_Expecter) RenderNotFound(w interface{}) *MockViewRenderer_RenderNotFound_Call
- func (_e *MockViewRenderer_Expecter) RenderRepoIndex(w interface{}, repo interface{}, docs interface{}, partial interface{}) *MockViewRenderer_RenderRepoIndex_Call
- func (_e *MockViewRenderer_Expecter) RenderSearch(w interface{}, query interface{}, results interface{}, partial interface{}) *MockViewRenderer_RenderSearch_Call
- type MockViewRenderer_RenderDoc_Call
- type MockViewRenderer_RenderHome_Call
- func (_c *MockViewRenderer_RenderHome_Call) Return(_a0 error) *MockViewRenderer_RenderHome_Call
- func (_c *MockViewRenderer_RenderHome_Call) Run(run func(w io.Writer, repos []core.RepoInfo, partial bool)) *MockViewRenderer_RenderHome_Call
- func (_c *MockViewRenderer_RenderHome_Call) RunAndReturn(run func(io.Writer, []core.RepoInfo, bool) error) *MockViewRenderer_RenderHome_Call
- type MockViewRenderer_RenderNotFound_Call
- func (_c *MockViewRenderer_RenderNotFound_Call) Return(_a0 error) *MockViewRenderer_RenderNotFound_Call
- func (_c *MockViewRenderer_RenderNotFound_Call) Run(run func(w io.Writer)) *MockViewRenderer_RenderNotFound_Call
- func (_c *MockViewRenderer_RenderNotFound_Call) RunAndReturn(run func(io.Writer) error) *MockViewRenderer_RenderNotFound_Call
- type MockViewRenderer_RenderRepoIndex_Call
- func (_c *MockViewRenderer_RenderRepoIndex_Call) Return(_a0 error) *MockViewRenderer_RenderRepoIndex_Call
- func (_c *MockViewRenderer_RenderRepoIndex_Call) Run(run func(w io.Writer, repo string, docs []core.DocumentMeta, partial bool)) *MockViewRenderer_RenderRepoIndex_Call
- func (_c *MockViewRenderer_RenderRepoIndex_Call) RunAndReturn(run func(io.Writer, string, []core.DocumentMeta, bool) error) *MockViewRenderer_RenderRepoIndex_Call
- type MockViewRenderer_RenderSearch_Call
- func (_c *MockViewRenderer_RenderSearch_Call) Return(_a0 error) *MockViewRenderer_RenderSearch_Call
- func (_c *MockViewRenderer_RenderSearch_Call) Run(run func(w io.Writer, query string, results *core.SearchResults, partial bool)) *MockViewRenderer_RenderSearch_Call
- func (_c *MockViewRenderer_RenderSearch_Call) RunAndReturn(run func(io.Writer, string, *core.SearchResults, bool) error) *MockViewRenderer_RenderSearch_Call
- type Service
- type ViewRenderer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API is the main HTTP server that serves both the ingest API and the documentation portal.
func New ¶
func New(cfg Config, svc Service, views ViewRenderer) (*API, error)
New creates a new API instance with the provided configuration, service, and view renderer. It validates the configuration and returns an error if the listen address is not specified.
type Config ¶
type Config struct {
StaticFS fs.FS `mapstructure:"-"`
Listen string `mapstructure:"listen"`
APIKeys []string `mapstructure:"api_keys"`
MaxIngestBodyMiB int64 `mapstructure:"max_ingest_body_mib"` // Maximum ingest request body in MiB (default 50).
}
Config holds the configuration for the API server.
type MockService ¶
MockService is an autogenerated mock type for the Service type
func NewMockService ¶
func NewMockService(t interface {
mock.TestingT
Cleanup(func())
}) *MockService
NewMockService creates a new instance of MockService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockService) EXPECT ¶
func (_m *MockService) EXPECT() *MockService_Expecter
func (*MockService) GetDocument ¶
func (_m *MockService) GetDocument(ctx context.Context, repo string, path string) (core.Document, []byte, []core.Heading, error)
GetDocument provides a mock function with given fields: ctx, repo, path
func (*MockService) IngestDocuments ¶
func (_m *MockService) IngestDocuments(ctx context.Context, req *core.IngestRequest) (*core.IngestResponse, error)
IngestDocuments provides a mock function with given fields: ctx, req
func (*MockService) ListDocuments ¶
func (_m *MockService) ListDocuments(ctx context.Context, repo string) ([]core.DocumentMeta, error)
ListDocuments provides a mock function with given fields: ctx, repo
func (*MockService) SearchDocs ¶
func (_m *MockService) SearchDocs(ctx context.Context, query string, opts core.SearchOpts) (*core.SearchResults, error)
SearchDocs provides a mock function with given fields: ctx, query, opts
type MockService_Expecter ¶
type MockService_Expecter struct {
// contains filtered or unexported fields
}
func (*MockService_Expecter) GetAsset ¶
func (_e *MockService_Expecter) GetAsset(ctx interface{}, repo interface{}, path interface{}) *MockService_GetAsset_Call
GetAsset is a helper method to define mock.On call
- ctx context.Context
- repo string
- path string
func (*MockService_Expecter) GetDocument ¶
func (_e *MockService_Expecter) GetDocument(ctx interface{}, repo interface{}, path interface{}) *MockService_GetDocument_Call
GetDocument is a helper method to define mock.On call
- ctx context.Context
- repo string
- path string
func (*MockService_Expecter) IngestDocuments ¶
func (_e *MockService_Expecter) IngestDocuments(ctx interface{}, req interface{}) *MockService_IngestDocuments_Call
IngestDocuments is a helper method to define mock.On call
- ctx context.Context
- req *core.IngestRequest
func (*MockService_Expecter) ListDocuments ¶
func (_e *MockService_Expecter) ListDocuments(ctx interface{}, repo interface{}) *MockService_ListDocuments_Call
ListDocuments is a helper method to define mock.On call
- ctx context.Context
- repo string
func (*MockService_Expecter) ListRepos ¶
func (_e *MockService_Expecter) ListRepos(ctx interface{}) *MockService_ListRepos_Call
ListRepos is a helper method to define mock.On call
- ctx context.Context
func (*MockService_Expecter) SearchDocs ¶
func (_e *MockService_Expecter) SearchDocs(ctx interface{}, query interface{}, opts interface{}) *MockService_SearchDocs_Call
SearchDocs is a helper method to define mock.On call
- ctx context.Context
- query string
- opts core.SearchOpts
type MockService_GetAsset_Call ¶
MockService_GetAsset_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAsset'
func (*MockService_GetAsset_Call) Return ¶
func (_c *MockService_GetAsset_Call) Return(_a0 []byte, _a1 error) *MockService_GetAsset_Call
func (*MockService_GetAsset_Call) Run ¶
func (_c *MockService_GetAsset_Call) Run(run func(ctx context.Context, repo string, path string)) *MockService_GetAsset_Call
func (*MockService_GetAsset_Call) RunAndReturn ¶
func (_c *MockService_GetAsset_Call) RunAndReturn(run func(context.Context, string, string) ([]byte, error)) *MockService_GetAsset_Call
type MockService_GetDocument_Call ¶
MockService_GetDocument_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDocument'
func (*MockService_GetDocument_Call) Return ¶
func (_c *MockService_GetDocument_Call) Return(_a0 core.Document, _a1 []byte, _a2 []core.Heading, _a3 error) *MockService_GetDocument_Call
func (*MockService_GetDocument_Call) Run ¶
func (_c *MockService_GetDocument_Call) Run(run func(ctx context.Context, repo string, path string)) *MockService_GetDocument_Call
func (*MockService_GetDocument_Call) RunAndReturn ¶
type MockService_IngestDocuments_Call ¶
MockService_IngestDocuments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IngestDocuments'
func (*MockService_IngestDocuments_Call) Return ¶
func (_c *MockService_IngestDocuments_Call) Return(_a0 *core.IngestResponse, _a1 error) *MockService_IngestDocuments_Call
func (*MockService_IngestDocuments_Call) Run ¶
func (_c *MockService_IngestDocuments_Call) Run(run func(ctx context.Context, req *core.IngestRequest)) *MockService_IngestDocuments_Call
func (*MockService_IngestDocuments_Call) RunAndReturn ¶
func (_c *MockService_IngestDocuments_Call) RunAndReturn(run func(context.Context, *core.IngestRequest) (*core.IngestResponse, error)) *MockService_IngestDocuments_Call
type MockService_ListDocuments_Call ¶
MockService_ListDocuments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDocuments'
func (*MockService_ListDocuments_Call) Return ¶
func (_c *MockService_ListDocuments_Call) Return(_a0 []core.DocumentMeta, _a1 error) *MockService_ListDocuments_Call
func (*MockService_ListDocuments_Call) Run ¶
func (_c *MockService_ListDocuments_Call) Run(run func(ctx context.Context, repo string)) *MockService_ListDocuments_Call
func (*MockService_ListDocuments_Call) RunAndReturn ¶
func (_c *MockService_ListDocuments_Call) RunAndReturn(run func(context.Context, string) ([]core.DocumentMeta, error)) *MockService_ListDocuments_Call
type MockService_ListRepos_Call ¶
MockService_ListRepos_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRepos'
func (*MockService_ListRepos_Call) Return ¶
func (_c *MockService_ListRepos_Call) Return(_a0 []core.RepoInfo, _a1 error) *MockService_ListRepos_Call
func (*MockService_ListRepos_Call) Run ¶
func (_c *MockService_ListRepos_Call) Run(run func(ctx context.Context)) *MockService_ListRepos_Call
func (*MockService_ListRepos_Call) RunAndReturn ¶
func (_c *MockService_ListRepos_Call) RunAndReturn(run func(context.Context) ([]core.RepoInfo, error)) *MockService_ListRepos_Call
type MockService_SearchDocs_Call ¶
MockService_SearchDocs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SearchDocs'
func (*MockService_SearchDocs_Call) Return ¶
func (_c *MockService_SearchDocs_Call) Return(_a0 *core.SearchResults, _a1 error) *MockService_SearchDocs_Call
func (*MockService_SearchDocs_Call) Run ¶
func (_c *MockService_SearchDocs_Call) Run(run func(ctx context.Context, query string, opts core.SearchOpts)) *MockService_SearchDocs_Call
func (*MockService_SearchDocs_Call) RunAndReturn ¶
func (_c *MockService_SearchDocs_Call) RunAndReturn(run func(context.Context, string, core.SearchOpts) (*core.SearchResults, error)) *MockService_SearchDocs_Call
type MockViewRenderer ¶
MockViewRenderer is an autogenerated mock type for the ViewRenderer type
func NewMockViewRenderer ¶
func NewMockViewRenderer(t interface {
mock.TestingT
Cleanup(func())
}) *MockViewRenderer
NewMockViewRenderer creates a new instance of MockViewRenderer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockViewRenderer) EXPECT ¶
func (_m *MockViewRenderer) EXPECT() *MockViewRenderer_Expecter
func (*MockViewRenderer) RenderDoc ¶
func (_m *MockViewRenderer) RenderDoc(w io.Writer, doc core.Document, html []byte, headings []core.Heading, navDocs []core.DocumentMeta, partial bool) error
RenderDoc provides a mock function with given fields: w, doc, html, headings, navDocs, partial
func (*MockViewRenderer) RenderHome ¶
RenderHome provides a mock function with given fields: w, repos, partial
func (*MockViewRenderer) RenderNotFound ¶
func (_m *MockViewRenderer) RenderNotFound(w io.Writer) error
RenderNotFound provides a mock function with given fields: w
func (*MockViewRenderer) RenderRepoIndex ¶
func (_m *MockViewRenderer) RenderRepoIndex(w io.Writer, repo string, docs []core.DocumentMeta, partial bool) error
RenderRepoIndex provides a mock function with given fields: w, repo, docs, partial
func (*MockViewRenderer) RenderSearch ¶
func (_m *MockViewRenderer) RenderSearch(w io.Writer, query string, results *core.SearchResults, partial bool) error
RenderSearch provides a mock function with given fields: w, query, results, partial
type MockViewRenderer_Expecter ¶
type MockViewRenderer_Expecter struct {
// contains filtered or unexported fields
}
func (*MockViewRenderer_Expecter) RenderDoc ¶
func (_e *MockViewRenderer_Expecter) RenderDoc(w interface{}, doc interface{}, html interface{}, headings interface{}, navDocs interface{}, partial interface{}) *MockViewRenderer_RenderDoc_Call
RenderDoc is a helper method to define mock.On call
- w io.Writer
- doc core.Document
- html []byte
- headings []core.Heading
- navDocs []core.DocumentMeta
- partial bool
func (*MockViewRenderer_Expecter) RenderHome ¶
func (_e *MockViewRenderer_Expecter) RenderHome(w interface{}, repos interface{}, partial interface{}) *MockViewRenderer_RenderHome_Call
RenderHome is a helper method to define mock.On call
- w io.Writer
- repos []core.RepoInfo
- partial bool
func (*MockViewRenderer_Expecter) RenderNotFound ¶
func (_e *MockViewRenderer_Expecter) RenderNotFound(w interface{}) *MockViewRenderer_RenderNotFound_Call
RenderNotFound is a helper method to define mock.On call
- w io.Writer
func (*MockViewRenderer_Expecter) RenderRepoIndex ¶
func (_e *MockViewRenderer_Expecter) RenderRepoIndex(w interface{}, repo interface{}, docs interface{}, partial interface{}) *MockViewRenderer_RenderRepoIndex_Call
RenderRepoIndex is a helper method to define mock.On call
- w io.Writer
- repo string
- docs []core.DocumentMeta
- partial bool
func (*MockViewRenderer_Expecter) RenderSearch ¶
func (_e *MockViewRenderer_Expecter) RenderSearch(w interface{}, query interface{}, results interface{}, partial interface{}) *MockViewRenderer_RenderSearch_Call
RenderSearch is a helper method to define mock.On call
- w io.Writer
- query string
- results *core.SearchResults
- partial bool
type MockViewRenderer_RenderDoc_Call ¶
MockViewRenderer_RenderDoc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RenderDoc'
func (*MockViewRenderer_RenderDoc_Call) Return ¶
func (_c *MockViewRenderer_RenderDoc_Call) Return(_a0 error) *MockViewRenderer_RenderDoc_Call
func (*MockViewRenderer_RenderDoc_Call) Run ¶
func (_c *MockViewRenderer_RenderDoc_Call) Run(run func(w io.Writer, doc core.Document, html []byte, headings []core.Heading, navDocs []core.DocumentMeta, partial bool)) *MockViewRenderer_RenderDoc_Call
func (*MockViewRenderer_RenderDoc_Call) RunAndReturn ¶
func (_c *MockViewRenderer_RenderDoc_Call) RunAndReturn(run func(io.Writer, core.Document, []byte, []core.Heading, []core.DocumentMeta, bool) error) *MockViewRenderer_RenderDoc_Call
type MockViewRenderer_RenderHome_Call ¶
MockViewRenderer_RenderHome_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RenderHome'
func (*MockViewRenderer_RenderHome_Call) Return ¶
func (_c *MockViewRenderer_RenderHome_Call) Return(_a0 error) *MockViewRenderer_RenderHome_Call
func (*MockViewRenderer_RenderHome_Call) Run ¶
func (_c *MockViewRenderer_RenderHome_Call) Run(run func(w io.Writer, repos []core.RepoInfo, partial bool)) *MockViewRenderer_RenderHome_Call
func (*MockViewRenderer_RenderHome_Call) RunAndReturn ¶
func (_c *MockViewRenderer_RenderHome_Call) RunAndReturn(run func(io.Writer, []core.RepoInfo, bool) error) *MockViewRenderer_RenderHome_Call
type MockViewRenderer_RenderNotFound_Call ¶
MockViewRenderer_RenderNotFound_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RenderNotFound'
func (*MockViewRenderer_RenderNotFound_Call) Return ¶
func (_c *MockViewRenderer_RenderNotFound_Call) Return(_a0 error) *MockViewRenderer_RenderNotFound_Call
func (*MockViewRenderer_RenderNotFound_Call) Run ¶
func (_c *MockViewRenderer_RenderNotFound_Call) Run(run func(w io.Writer)) *MockViewRenderer_RenderNotFound_Call
func (*MockViewRenderer_RenderNotFound_Call) RunAndReturn ¶
func (_c *MockViewRenderer_RenderNotFound_Call) RunAndReturn(run func(io.Writer) error) *MockViewRenderer_RenderNotFound_Call
type MockViewRenderer_RenderRepoIndex_Call ¶
MockViewRenderer_RenderRepoIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RenderRepoIndex'
func (*MockViewRenderer_RenderRepoIndex_Call) Return ¶
func (_c *MockViewRenderer_RenderRepoIndex_Call) Return(_a0 error) *MockViewRenderer_RenderRepoIndex_Call
func (*MockViewRenderer_RenderRepoIndex_Call) Run ¶
func (_c *MockViewRenderer_RenderRepoIndex_Call) Run(run func(w io.Writer, repo string, docs []core.DocumentMeta, partial bool)) *MockViewRenderer_RenderRepoIndex_Call
func (*MockViewRenderer_RenderRepoIndex_Call) RunAndReturn ¶
func (_c *MockViewRenderer_RenderRepoIndex_Call) RunAndReturn(run func(io.Writer, string, []core.DocumentMeta, bool) error) *MockViewRenderer_RenderRepoIndex_Call
type MockViewRenderer_RenderSearch_Call ¶
MockViewRenderer_RenderSearch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RenderSearch'
func (*MockViewRenderer_RenderSearch_Call) Return ¶
func (_c *MockViewRenderer_RenderSearch_Call) Return(_a0 error) *MockViewRenderer_RenderSearch_Call
func (*MockViewRenderer_RenderSearch_Call) Run ¶
func (_c *MockViewRenderer_RenderSearch_Call) Run(run func(w io.Writer, query string, results *core.SearchResults, partial bool)) *MockViewRenderer_RenderSearch_Call
func (*MockViewRenderer_RenderSearch_Call) RunAndReturn ¶
func (_c *MockViewRenderer_RenderSearch_Call) RunAndReturn(run func(io.Writer, string, *core.SearchResults, bool) error) *MockViewRenderer_RenderSearch_Call
type Service ¶
type Service interface {
IngestDocuments(ctx context.Context, req *core.IngestRequest) (*core.IngestResponse, error)
GetDocument(ctx context.Context, repo, path string) (core.Document, []byte, []core.Heading, error)
GetAsset(ctx context.Context, repo, path string) ([]byte, error)
SearchDocs(ctx context.Context, query string, opts core.SearchOpts) (*core.SearchResults, error)
ListRepos(ctx context.Context) ([]core.RepoInfo, error)
ListDocuments(ctx context.Context, repo string) ([]core.DocumentMeta, error)
}
Service defines the interface for core business logic operations.
type ViewRenderer ¶
type ViewRenderer interface {
RenderHome(w io.Writer, repos []core.RepoInfo, partial bool) error
RenderRepoIndex(w io.Writer, repo string, docs []core.DocumentMeta, partial bool) error
RenderDoc(w io.Writer, doc core.Document, html []byte, headings []core.Heading, navDocs []core.DocumentMeta, partial bool) error
RenderSearch(w io.Writer, query string, results *core.SearchResults, partial bool) error
RenderNotFound(w io.Writer) error
}
ViewRenderer defines the interface for rendering HTML views.