sdk

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package sdk is the public API surface of pdf-forge.

Extension authors and fork consumers should import only this package. All types, interfaces, and constructors needed to build custom injectors, mappers, providers, and authenticators are re-exported here as type aliases.

Example usage:

import "github.com/rendis/pdf-forge/core/sdk"

engine := sdk.New()
engine.RegisterInjector(&MyInjector{})
engine.Run()

Index

Constants

View Source
const (
	ValueTypeString = entity.ValueTypeString
	ValueTypeNumber = entity.ValueTypeNumber
	ValueTypeBool   = entity.ValueTypeBool
	ValueTypeTime   = entity.ValueTypeTime
	ValueTypeTable  = entity.ValueTypeTable
	ValueTypeImage  = entity.ValueTypeImage
	ValueTypeList   = entity.ValueTypeList
)
View Source
const (
	InjectableDataTypeText     = entity.InjectableDataTypeText
	InjectableDataTypeNumber   = entity.InjectableDataTypeNumber
	InjectableDataTypeDate     = entity.InjectableDataTypeDate
	InjectableDataTypeCurrency = entity.InjectableDataTypeCurrency
	InjectableDataTypeBoolean  = entity.InjectableDataTypeBoolean
	InjectableDataTypeImage    = entity.InjectableDataTypeImage
	InjectableDataTypeTable    = entity.InjectableDataTypeTable
	InjectableDataTypeList     = entity.InjectableDataTypeList
)
View Source
const (
	ListSymbolBullet = entity.ListSymbolBullet
	ListSymbolNumber = entity.ListSymbolNumber
	ListSymbolDash   = entity.ListSymbolDash
	ListSymbolRoman  = entity.ListSymbolRoman
	ListSymbolLetter = entity.ListSymbolLetter
)

ListSymbol constants.

Variables

View Source
var (
	StringValue    = entity.StringValue
	NumberValue    = entity.NumberValue
	BoolValue      = entity.BoolValue
	TimeValue      = entity.TimeValue
	ImageValue     = entity.ImageValue
	TableValueData = entity.TableValueData
	ListValueData  = entity.ListValueData
)
View Source
var (
	NewTableValue = entity.NewTableValue
	Cell          = entity.Cell
	CellWithSpan  = entity.CellWithSpan
	EmptyCell     = entity.EmptyCell
)

Table constructors and helpers.

View Source
var (
	NewListValue   = entity.NewListValue
	ListItemValue  = entity.ListItemValue
	ListItemNested = entity.ListItemNested
)

List constructors and helpers.

View Source
var (
	StringPtr = entity.StringPtr
	IntPtr    = entity.IntPtr
)
View Source
var DefaultDesignTokens = pdfrenderer.DefaultDesignTokens

DefaultDesignTokens returns the built-in design tokens.

New creates a new Engine with default configuration.

View Source
var NewWithConfig = bootstrap.NewWithConfig

NewWithConfig creates a new Engine that loads config from the given file path.

Functions

This section is empty.

Types

type Engine

type Engine = bootstrap.Engine

Engine is the main entry point for pdf-forge. Create with New(), register extensions, then call Run().

type FormatConfig

type FormatConfig = entity.FormatConfig

FormatConfig defines formatting options for an injector.

type GetInjectablesResult

type GetInjectablesResult = port.GetInjectablesResult

GetInjectablesResult contains the list of available injectables and groups.

type InitFunc

type InitFunc = port.InitFunc

InitFunc is the global initialization function that runs before all injectors.

type InjectableDataType

type InjectableDataType = entity.InjectableDataType

InjectableDataType represents the data type of an injectable variable.

type InjectableValue

type InjectableValue = entity.InjectableValue

InjectableValue is the typed value returned by an injector.

type Injector

type Injector = port.Injector

Injector defines the interface that users implement for custom injectable resolution.

type InjectorContext

type InjectorContext = entity.InjectorContext

InjectorContext encapsulates request context data with thread-safe access.

type InjectorResult

type InjectorResult = entity.InjectorResult

InjectorResult is the result of resolving an injector.

type ListItem

type ListItem = entity.ListItem

ListItem represents a single item in a list, optionally with nested children.

type ListSchema

type ListSchema = entity.ListSchema

ListSchema exposes the default configuration of a list injector to the frontend.

type ListSchemaProvider

type ListSchemaProvider = port.ListSchemaProvider

ListSchemaProvider is an optional interface that list injectors can implement to expose their default configuration at the API level.

type ListStyles

type ListStyles = entity.ListStyles

ListStyles defines styling options for list header or items.

type ListSymbol

type ListSymbol = entity.ListSymbol

ListSymbol represents the marker/numbering style for a list.

type ListValue

type ListValue = entity.ListValue

ListValue represents a complete injectable list with items and styling.

type MapperContext

type MapperContext = port.MapperContext

MapperContext contains the context for request mapping.

type ProviderFormat

type ProviderFormat = port.ProviderFormat

ProviderFormat represents a format option for an injectable.

type ProviderGroup

type ProviderGroup = port.ProviderGroup

ProviderGroup represents a custom group for organizing injectables.

type ProviderInjectable

type ProviderInjectable = port.ProviderInjectable

ProviderInjectable represents an injectable definition from the provider.

type RenderAuthClaims

type RenderAuthClaims = port.RenderAuthClaims

RenderAuthClaims contains authenticated caller information.

type RenderAuthenticator

type RenderAuthenticator = port.RenderAuthenticator

RenderAuthenticator defines custom authentication for render endpoints.

type RequestMapper

type RequestMapper = port.RequestMapper

RequestMapper defines the interface that users implement to map render requests.

type ResolveFunc

type ResolveFunc = port.ResolveFunc

ResolveFunc is the function that resolves the injector value.

type ResolveInjectablesRequest

type ResolveInjectablesRequest = port.ResolveInjectablesRequest

ResolveInjectablesRequest contains parameters for resolving injectable values.

type ResolveInjectablesResult

type ResolveInjectablesResult = port.ResolveInjectablesResult

ResolveInjectablesResult contains the resolved values and any non-critical errors.

type TableCell

type TableCell = entity.TableCell

TableCell represents a single cell in a table row.

type TableColumn

type TableColumn = entity.TableColumn

TableColumn defines a column in a dynamic table.

type TableRow

type TableRow = entity.TableRow

TableRow represents a row of cells in a table.

type TableSchemaProvider

type TableSchemaProvider = port.TableSchemaProvider

TableSchemaProvider is an optional interface that table injectors can implement to expose their column structure at the API level.

type TableStyles

type TableStyles = entity.TableStyles

TableStyles defines styling options for table headers and body content.

type TableValue

type TableValue = entity.TableValue

TableValue represents a complete table with columns, rows, and styling.

type TypstDesignTokens

type TypstDesignTokens = pdfrenderer.TypstDesignTokens

TypstDesignTokens holds all configurable design values for Typst PDF output. Customize via engine.SetDesignTokens().

type ValueType

type ValueType = entity.ValueType

ValueType indicates the type of an injectable value.

type WorkspaceInjectableProvider

type WorkspaceInjectableProvider = port.WorkspaceInjectableProvider

WorkspaceInjectableProvider defines the interface for dynamic workspace-specific injectables.

Jump to

Keyboard shortcuts

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