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 ¶
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 ¶
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 ¶
func (p *ExampleWorkspaceProvider) GetInjectables(_ context.Context, _ *entity.InjectorContext) (*port.GetInjectablesResult, error)
GetInjectables returns available injectables for a workspace. Called when the editor opens to populate the injectable list.
func (*ExampleWorkspaceProvider) ResolveInjectables ¶
func (p *ExampleWorkspaceProvider) ResolveInjectables(_ context.Context, _ *port.ResolveInjectablesRequest) (*port.ResolveInjectablesResult, error)
ResolveInjectables resolves a batch of injectable codes during render.