Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CatalogHandlers ¶
type CatalogHandlers struct {
// contains filtered or unexported fields
}
CatalogHandlers handles HTTP requests for catalog content
func NewCatalogHandlers ¶
func NewCatalogHandlers(store CatalogStore, graphqlSvc service.GraphQLService, rootURL *url.URL, enableMetas MetasHandlerMode, enableGraphQL GraphQLQueriesMode) *CatalogHandlers
NewCatalogHandlers creates a new HTTP handlers instance
func (*CatalogHandlers) Handler ¶
func (h *CatalogHandlers) Handler() http.Handler
Handler returns an HTTP handler with all routes configured
type CatalogStore ¶
type CatalogStore interface {
// GetCatalogData returns the catalog file and its metadata
GetCatalogData(catalog string) (*os.File, os.FileInfo, error)
// GetCatalogFS returns a filesystem interface for the catalog
GetCatalogFS(catalog string) (fs.FS, error)
// GetIndex returns the index for a catalog (if metas handler is enabled)
GetIndex(catalog string) (Index, error)
}
CatalogStore defines the storage interface needed by handlers
type GraphQLQueriesMode ¶
type GraphQLQueriesMode bool
GraphQLQueriesMode controls whether GraphQL queries are enabled
const ( GraphQLQueriesDisabled GraphQLQueriesMode = false GraphQLQueriesEnabled GraphQLQueriesMode = true )
type MetasHandlerMode ¶
type MetasHandlerMode bool
MetasHandlerMode controls whether the metas API endpoint is enabled
const ( MetasHandlerDisabled MetasHandlerMode = false MetasHandlerEnabled MetasHandlerMode = true )
Click to show internal directories.
Click to hide internal directories.