Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TraceMiddleware ¶
func TraceMiddleware(logger log.Logger, tracerProvider trace.TracerProvider) echo.MiddlewareFunc
TraceMiddleware extract parent span from query parameters or from referer header. And start new span.
Types ¶
type DocumentID ¶
type DocumentID uint64
DocumentID is store key.
func (DocumentID) String ¶ added in v0.9.1
func (id DocumentID) String() string
type EchoServer ¶
type EchoServer struct {
// contains filtered or unexported fields
}
EchoServer for browser render.
func ProvideServer ¶
func ProvideServer( ctx context.Context, handler *Handler, tracerProvider trace.TracerProvider, ) (*EchoServer, func(), error)
ProvideServer create, start server and return closer function.
func (*EchoServer) GetURL ¶
func (server *EchoServer) GetURL( ctx context.Context, templateName pdfrender.TemplateName, documentHash DocumentID, requestID string, ) string
GetURL on internal server by templateName and documentID.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler of CDP render Server.
func NewHandler ¶
func NewHandler( documentsStore Store, templatesStoreConsumer templates.StoreConsumer, logger log.Logger, tracerProvider trace.TracerProvider, ) *Handler
NewHandler constructor.
type MapStore ¶
MapStore is default implementation for Store.
func (*MapStore) Add ¶
func (mapStore *MapStore) Add( document pdfrender.Document, events pdfrender.CallbackEventChan, ) DocumentID
Add document to store.
func (*MapStore) Get ¶
func (mapStore *MapStore) Get(documentID DocumentID) ( pdfrender.Document, pdfrender.CallbackEventChan, bool, )
Get document by ID.
func (*MapStore) Remove ¶
func (mapStore *MapStore) Remove(documentID DocumentID)
Remove document by ID.
type Server ¶
type Server interface { GetURL( ctx context.Context, templateName pdfrender.TemplateName, documentHash DocumentID, requestID string, ) string }
Server provide GetURL.
type Store ¶
type Store interface { Add(pdfrender.Document, pdfrender.CallbackEventChan) DocumentID Remove(DocumentID) Get(DocumentID) (pdfrender.Document, pdfrender.CallbackEventChan, bool) }
Store interface for Handler.
type TraceIDNotProvidedError ¶
type TraceIDNotProvidedError struct{}
TraceIDNotProvidedError returns from extractSpanContextFromRequest.
func NewTraceIDNotProvidedError ¶
func NewTraceIDNotProvidedError() *TraceIDNotProvidedError
NewTraceIDNotProvidedError construct new TraceIDNotProvidedError.
func (*TraceIDNotProvidedError) Error ¶
func (*TraceIDNotProvidedError) Error() string
Error implements error interface.