Documentation ¶
Index ¶
- Variables
- func BulkProcessor() *elastic.BulkProcessor
- func BulkStats(w http.ResponseWriter, r *http.Request)
- func EADDownload(w http.ResponseWriter, r *http.Request)
- func EADMeta(w http.ResponseWriter, r *http.Request)
- func ErrInvalidRequest(err error) render.Renderer
- func ErrRender(err error) render.Renderer
- func GetScrollResult(w http.ResponseWriter, r *http.Request)
- func METSDownload(w http.ResponseWriter, r *http.Request)
- func NewPrometheuusMiddleware(name string, buckets ...float64) *prometheusMiddleware
- func PDFDownload(w http.ResponseWriter, r *http.Request)
- func PrepareCacheRequest(r *http.Request) (cacheKey string, err error)
- func ProcessSearchRequest(w http.ResponseWriter, r *http.Request, searchRequest *fragments.SearchRequest)
- func RegisterBulkIndexer(r chi.Router)
- func RegisterCSV(r chi.Router)
- func RegisterCache(r chi.Router)
- func RegisterContentStats(r chi.Router)
- func RegisterDatasets(router chi.Router)
- func RegisterEAD(r chi.Router)
- func RegisterElasticSearchProxy(router chi.Router)
- func RegisterFuzzer(r chi.Router)
- func RegisterImageProxy(r chi.Router)
- func RegisterIntrospection(r chi.Router)
- func RegisterLOD(r chi.Router)
- func RegisterLinkedDataFragments(router chi.Router)
- func RegisterMetrics(r chi.Router)
- func RegisterNamespace(router chi.Router)
- func RegisterRDF(r chi.Router)
- func RegisterSearch(router chi.Router)
- func RegisterSparql(r chi.Router)
- func RegisterStaticAssets(r chi.Router)
- func RenderLODResource(w http.ResponseWriter, r *http.Request)
- func TreeDescriptionAPI(w http.ResponseWriter, r *http.Request)
- func TreeDescriptionSearch(w http.ResponseWriter, r *http.Request)
- func TreeList(w http.ResponseWriter, r *http.Request)
- type APIErrorMessage
- type CachedResponse
- type ErrResponse
- type ErrorMessage
- type OldBulkProcessor
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = &ErrResponse{HTTPStatusCode: 404, StatusText: "Resource not found."}
ErrNotFound is a 404 convenience variable
Functions ¶
func BulkProcessor ¶
func BulkProcessor() *elastic.BulkProcessor
BulkProcessor creates a new BulkProcessor.
func BulkStats ¶
func BulkStats(w http.ResponseWriter, r *http.Request)
Get returns JSON formatted statistics for the BulkProcessor
func EADDownload ¶
func EADDownload(w http.ResponseWriter, r *http.Request)
EADDownload is a handler that returns a stored XML for an EAD Archive
func ErrInvalidRequest ¶
ErrInvalidRequest returns an Invalid Request Response
func GetScrollResult ¶
func GetScrollResult(w http.ResponseWriter, r *http.Request)
func METSDownload ¶
func METSDownload(w http.ResponseWriter, r *http.Request)
MetsDownload is a handler that returns a stored METS XML for an inventory.
func NewPrometheuusMiddleware ¶
NewMiddleware returns a new prometheus Middleware handler.
func PDFDownload ¶
func PDFDownload(w http.ResponseWriter, r *http.Request)
PDFDownload is a handler that returns a stored PDF for an EAD Archive
func PrepareCacheRequest ¶
PrepareCacheRequest modifies the request for the remote call It returns the unique hash from the request that is used as the cacheKey
func ProcessSearchRequest ¶
func ProcessSearchRequest(w http.ResponseWriter, r *http.Request, searchRequest *fragments.SearchRequest)
func RegisterBulkIndexer ¶
RegisterBulkIndexer registers routes for the BulkIndexer API.
func RegisterCSV ¶
func RegisterCache ¶
func RegisterContentStats ¶
func RegisterDatasets ¶
func RegisterEAD ¶
func RegisterFuzzer ¶
func RegisterImageProxy ¶
func RegisterIntrospection ¶
IntrospectionRouter gives access to the configuration at runtime when debug mode is enabled.
func RegisterLOD ¶
func RegisterMetrics ¶
func RegisterNamespace ¶
func RegisterRDF ¶
func RegisterSearch ¶
func RegisterSparql ¶
func RegisterStaticAssets ¶
func RenderLODResource ¶
func RenderLODResource(w http.ResponseWriter, r *http.Request)
RenderLODResource returns a list of matching fragments for a LOD resource. This mimicks a SPARQL describe request
func TreeDescriptionAPI ¶
func TreeDescriptionAPI(w http.ResponseWriter, r *http.Request)
func TreeDescriptionSearch ¶ added in v0.1.10
func TreeDescriptionSearch(w http.ResponseWriter, r *http.Request)
Types ¶
type APIErrorMessage ¶
type APIErrorMessage struct { HTTPStatus int `json:"code"` Message string `json:"type"` Error error `json:"error"` }
APIErrorMessage contains the default API error messages
type CachedResponse ¶
CachedResponse stores the request in the Cache. This object is always return from the CacheRequest
type ErrResponse ¶
type ErrResponse struct { Err error `json:"-"` // low-level runtime error HTTPStatusCode int `json:"-"` // http response status code StatusText string `json:"status"` // user-level status message AppCode int64 `json:"code,omitempty"` // application-specific error code ErrorText string `json:"error,omitempty"` // application-level error message, for debugging }
ErrResponse renderer type for handling all sorts of errors.
In the best case scenario, the excellent github.com/pkg/errors package helps reveal information on the error, setting it on Err, and in the Render() method, using it to set the application-specific error code in AppCode.
func (*ErrResponse) Render ¶
func (e *ErrResponse) Render(w http.ResponseWriter, r *http.Request) error
Render renders the ErrResponse
type ErrorMessage ¶
ErrorMessage is a placeholder for disabled endpoints
type OldBulkProcessor ¶ added in v0.1.8
type OldBulkProcessor struct {
// contains filtered or unexported fields
}
func NewOldBulkProcessor ¶ added in v0.1.8
func NewOldBulkProcessor() *OldBulkProcessor
func (OldBulkProcessor) Publish ¶ added in v0.1.8
func (bp OldBulkProcessor) Publish(ctx context.Context, msg ...*domainpb.IndexMessage) error