extensions

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomHeadersMiddleware

func CustomHeadersMiddleware() gin.HandlerFunc

CustomHeadersMiddleware adds custom response headers.

func ExampleInit

func ExampleInit() port.InitFunc

ExampleInit returns an InitFunc that runs once before all injectors on each render request. Use this to load shared data (e.g., from headers or an external source) that multiple injectors need.

func Register

func Register(engine *bootstrap.Engine)

Register registers all user-defined extensions with the engine. This is the single entry point for all customizations.

func RequestLoggerMiddleware

func RequestLoggerMiddleware() gin.HandlerFunc

RequestLoggerMiddleware logs request latency and status.

func TenantValidationMiddleware

func TenantValidationMiddleware() gin.HandlerFunc

TenantValidationMiddleware validates tenant access. Runs after authentication, so user context is available.

Types

type ExampleMapper

type ExampleMapper struct{}

ExampleMapper implements port.RequestMapper. Parses the raw render request body as a JSON object. Replace this with your own parsing logic if your payload has a different structure.

func (*ExampleMapper) Map

func (m *ExampleMapper) Map(_ context.Context, mapCtx *port.MapperContext) (any, error)

type ExampleRenderAuth

type ExampleRenderAuth struct{}

ExampleRenderAuth implements port.RenderAuthenticator. Replace this with your own authentication logic (e.g., API key validation, JWT verification).

func (*ExampleRenderAuth) Authenticate

func (a *ExampleRenderAuth) Authenticate(c *gin.Context) (*port.RenderAuthClaims, error)

Authenticate extracts the Bearer token from the Authorization header and returns example claims.

type ExampleWorkspaceProvider

type ExampleWorkspaceProvider struct{}

ExampleWorkspaceProvider implements port.WorkspaceInjectableProvider. Replace this with your own logic to provide dynamic, workspace-specific injectables (e.g., from an external database or API).

func (*ExampleWorkspaceProvider) GetInjectables

GetInjectables returns available injectables for a workspace. Called when the editor opens to populate the injectable list.

func (*ExampleWorkspaceProvider) ResolveInjectables

ResolveInjectables resolves a batch of injectable codes during render.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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