exporthttp

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package exporthttp provides HTTP transport adapters for go-export.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PDFAssetsHandler

func PDFAssetsHandler(prefix string) http.Handler

PDFAssetsHandler serves embedded PDF preview assets (echarts, jsPDF, html2canvas).

func RuntimeAssetsHandler

func RuntimeAssetsHandler() http.Handler

RuntimeAssetsHandler serves embedded frontend helpers (datagrid export client).

func WithActor

func WithActor(ctx context.Context, actor export.Actor) context.Context

WithActor stores an actor in context for HTTP handlers.

Types

type Config

type Config = exportapi.Config

Config configures the HTTP adapter.

type ContextActorProvider

type ContextActorProvider struct {
	Key any
}

ContextActorProvider reads actors from request contexts.

func (ContextActorProvider) FromContext

func (p ContextActorProvider) FromContext(ctx context.Context) (export.Actor, error)

FromContext returns the actor stored in context.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler exposes export HTTP endpoints.

func NewHandler

func NewHandler(cfg Config) *Handler

NewHandler creates a new HTTP handler.

func (*Handler) RegisterRoutes

func (h *Handler) RegisterRoutes(router any)

RegisterRoutes registers handlers on a compatible router.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP routes export endpoints.

type IdempotencyStore

type IdempotencyStore = exportapi.IdempotencyStore

IdempotencyStore stores idempotency keys.

type JSONRequestDecoder

type JSONRequestDecoder = exportapi.JSONRequestDecoder

JSONRequestDecoder decodes JSON into export requests.

type MemoryIdempotencyStore

type MemoryIdempotencyStore = exportapi.MemoryIdempotencyStore

MemoryIdempotencyStore stores idempotency keys in memory.

func NewMemoryIdempotencyStore

func NewMemoryIdempotencyStore() *MemoryIdempotencyStore

NewMemoryIdempotencyStore creates an in-memory store.

type QueryDecoder

type QueryDecoder = exportapi.QueryDecoder

QueryDecoder converts raw JSON query payloads into typed values.

type QueryRequestDecoder

type QueryRequestDecoder = exportapi.QueryRequestDecoder

QueryRequestDecoder decodes querystring payloads into export requests.

type RequestDecoder

type RequestDecoder = exportapi.RequestDecoder

RequestDecoder parses an HTTP request into an export request.

type StaticActorProvider

type StaticActorProvider struct {
	Actor export.Actor
}

StaticActorProvider always returns the configured actor.

func (StaticActorProvider) FromContext

func (p StaticActorProvider) FromContext(ctx context.Context) (export.Actor, error)

FromContext returns the configured actor.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL