Documentation
¶
Index ¶
- func AsRawBytes(c Content) ([]byte, error)
- func BuildContentRoutes(contentRoot string, options RouteOptions) (map[string]ContentRoute, error)
- func BuildViewSourceIndexHTML(recipeAssets []RecipeSourceAsset, markdownRequestPaths []string) []byte
- func CanonicalRequestPath(requestPath string, options RouteOptions) (string, bool)
- func CollectMarkdownRequestPathsFromRoutes(routes map[string]ContentRoute) []string
- func ContentTypeOf(content Content) string
- func DecodeBMPToRGBA(input []byte) (*image.RGBA, error)
- func EncodeRGBAToBMP(img *image.RGBA) ([]byte, error)
- func FilterMarkdownRequestPaths(paths []string) []string
- func GetBMPDimensions(data []byte) (int, int, error)
- func NewRequestHandler(config RequestHandlerConfig) http.Handler
- func RGBAF32ToRGBA(rgba RGBAF32Content) *image.RGBA
- func RGBAToRGBAF32(img *image.RGBA) []float32
- func RunComplyCommand(args []string) error
- func RunFormCommand(args []string) error
- type BMPContent
- type Content
- type ContentRoute
- type Encoding
- type I32ArrayContent
- type ImageContent
- type InProcessHTTPResponse
- type ModuleDriver
- type Pipeline
- type RGBAF32Content
- type RawBytesContent
- type RecipeSourceAsset
- type RequestHandlerConfig
- type RouteOptions
- type RoutedResponse
- type RunStage
- type Stage
- type StringContent
- type TileGroupStage
- type TileModuleDriver
- type TrailingSlashMode
- type WasmRunDriver
- type WasmTileModuleDriver
- func (d *WasmTileModuleDriver) Close(ctx context.Context) error
- func (d *WasmTileModuleDriver) ExecuteTile(ctx context.Context, x, y float32, tilePixels []float32) ([]float32, error)
- func (d *WasmTileModuleDriver) HaloPx() int
- func (d *WasmTileModuleDriver) SetImageSize(ctx context.Context, width, height int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsRawBytes ¶
func BuildContentRoutes ¶
func BuildContentRoutes(contentRoot string, options RouteOptions) (map[string]ContentRoute, error)
func BuildViewSourceIndexHTML ¶
func BuildViewSourceIndexHTML(recipeAssets []RecipeSourceAsset, markdownRequestPaths []string) []byte
func CanonicalRequestPath ¶
func CanonicalRequestPath(requestPath string, options RouteOptions) (string, bool)
func CollectMarkdownRequestPathsFromRoutes ¶
func CollectMarkdownRequestPathsFromRoutes(routes map[string]ContentRoute) []string
func ContentTypeOf ¶
func NewRequestHandler ¶
func NewRequestHandler(config RequestHandlerConfig) http.Handler
func RGBAF32ToRGBA ¶
func RGBAF32ToRGBA(rgba RGBAF32Content) *image.RGBA
func RGBAToRGBAF32 ¶
func RunComplyCommand ¶
func RunFormCommand ¶
Types ¶
type BMPContent ¶
type BMPContent interface {
RawBytesContent
ImageContent
}
BMPContent is a specialization for BMP file data.
func NewBMPContent ¶
func NewBMPContent(data []byte, width, height int) BMPContent
func NewBMPContentWithType ¶
func NewBMPContentWithType(data []byte, width, height int, contentType string) BMPContent
func ToBMPContent ¶
func ToBMPContent(c Content) (BMPContent, error)
type Content ¶
type Content interface {
Encoding() Encoding
}
Content is the base interface for all data flowing through the pipeline.
func WithContentType ¶
type ContentRoute ¶
func ResolveContentRoute ¶
func ResolveContentRoute(routes map[string]ContentRoute, requestPath string, options RouteOptions) (ContentRoute, bool)
type I32ArrayContent ¶
type I32ArrayContent interface {
Content
RawBytes() []byte // Still stored as bytes for WASM memory compatibility
}
I32ArrayContent is for modules that output arrays of 32-bit integers.
func NewI32ArrayContent ¶
func NewI32ArrayContent(data []byte) I32ArrayContent
func NewI32ArrayContentWithType ¶
func NewI32ArrayContentWithType(data []byte, contentType string) I32ArrayContent
type ImageContent ¶
ImageContent provides metadata for image-based data.
type InProcessHTTPResponse ¶
func ServeInProcessHTTP ¶
type ModuleDriver ¶
type ModuleDriver interface {
Execute(ctx context.Context, input Content, requestID uint64) (Content, error)
Close(ctx context.Context) error
}
ModuleDriver defines the interface for executing a specific type of Wasm module.
type RGBAF32Content ¶
type RGBAF32Content interface {
ImageContent
Pixels() []float32
}
RGBAF32Content is high-precision float pixel data used for tile processing.
func NewRGBAF32Content ¶
func NewRGBAF32Content(pixels []float32, width, height int) RGBAF32Content
func NewRGBAF32ContentWithType ¶
func NewRGBAF32ContentWithType(pixels []float32, width, height int, contentType string) RGBAF32Content
type RawBytesContent ¶
RawBytesContent provides access to raw data.
func NewRawBytesContent ¶
func NewRawBytesContent(data []byte) RawBytesContent
func NewRawBytesContentWithType ¶
func NewRawBytesContentWithType(data []byte, contentType string) RawBytesContent
type RecipeSourceAsset ¶
func CollectRecipeSourceAssets ¶
func CollectRecipeSourceAssets(recipesRoot string) ([]RecipeSourceAsset, error)
type RequestHandlerConfig ¶
type RequestHandlerConfig struct {
LogPrefix string
RouteOptions RouteOptions
Reload func()
Resolve func(r *http.Request, requestID uint64) (RoutedResponse, error)
WriteError func(http.ResponseWriter, error)
FormatDuration func(total time.Duration, moduleDurations []time.Duration, instantiationDurations []time.Duration) string
Logf func(format string, args ...any)
}
type RouteOptions ¶
type RouteOptions struct {
TrailingSlashMode TrailingSlashMode
}
func DefaultRouteOptions ¶
func DefaultRouteOptions() RouteOptions
type RoutedResponse ¶
type RunStage ¶
type RunStage struct {
Driver ModuleDriver
}
type StringContent ¶
StringContent provides access to UTF-8 string data.
func NewStringContent ¶
func NewStringContent(data string) StringContent
func NewStringContentWithType ¶
func NewStringContentWithType(data string, contentType string) StringContent
func ToUTF8Content ¶
func ToUTF8Content(c Content) (StringContent, error)
type TileGroupStage ¶
type TileGroupStage struct {
Drivers []TileModuleDriver
}
type TileModuleDriver ¶
type TrailingSlashMode ¶
type TrailingSlashMode string
const ( TrailingSlashModeNever TrailingSlashMode = "never" TrailingSlashModeAlways TrailingSlashMode = "always" )
type WasmRunDriver ¶
type WasmRunDriver struct {
RunFunc func(ctx context.Context, input []byte, requestID uint64) (Content, error)
CloseFunc func(ctx context.Context) error
}
WasmRunDriver implements ModuleDriver for a single 'run' Wasm module.
type WasmTileModuleDriver ¶
type WasmTileModuleDriver struct {
TileFunc func(ctx context.Context, x, y float32, tilePixels []float32) ([]float32, error)
SetSizeFunc func(ctx context.Context, width, height int) error
CloseFunc func(ctx context.Context) error
HaloValue int
}
WasmTileModuleDriver implements TileModuleDriver for a 'tile' Wasm module.
func (*WasmTileModuleDriver) Close ¶
func (d *WasmTileModuleDriver) Close(ctx context.Context) error
func (*WasmTileModuleDriver) ExecuteTile ¶
func (*WasmTileModuleDriver) HaloPx ¶
func (d *WasmTileModuleDriver) HaloPx() int
func (*WasmTileModuleDriver) SetImageSize ¶
func (d *WasmTileModuleDriver) SetImageSize(ctx context.Context, width, height int) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.