render

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package render turns a fully-resolved view (the IR built by the gather phase) into Go source. It does so through templates only: render makes no resolution decisions and imports no metadata or type-mapping packages — every value it needs is already present on the view. Its FuncMap holds pure formatting helpers, never type logic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsyncMethod

func AsyncMethod(m view.AsyncMethod) ([]byte, error)

AsyncMethod renders a completion-handler method as a blocking, ctx-aware call.

func BoolNSErrorMethod

func BoolNSErrorMethod(m view.BoolNSErrorMethod) ([]byte, error)

BoolNSErrorMethod renders a BOOL+NSError method as an error-returning method.

func Constants

func Constants(constants []view.Constant) ([]byte, error)

Constants renders the global-constant accessor functions for a package as a Go source fragment (before file assembly and gofmt).

func Enums

func Enums(enums []view.Enum) ([]byte, error)

Enums renders the concrete enum definitions for a package as a Go source fragment (a package body, before file assembly and gofmt). Each enum becomes a `type X <underlying>` declaration with a typed const block and a String method.

func Funcs

func Funcs(funcs []view.Func) ([]byte, error)

Funcs renders the C-function wrappers for a package as a Go source fragment (before file assembly and gofmt).

func Method

func Method(m view.Method) ([]byte, error)

Method renders one Go method (or package-level function) — signature, doc, and body — from a resolved view.Method. The body comes from the method's Dispatch, so no Go syntax is assembled by string concatenation in the caller.

func Sentinels

func Sentinels(sentinels []view.ErrorSentinel) ([]byte, error)

Sentinels renders the error-sentinel variable declarations for a package as a Go source fragment (before file assembly and gofmt).

func SliceMethod

func SliceMethod(m view.SliceMethod) ([]byte, error)

SliceMethod renders an array-returning getter as a slice-returning method.

func Structs

func Structs(structs []view.Struct) ([]byte, error)

Structs renders the value-struct definitions for a package as a Go source fragment (a package body, before file assembly and gofmt).

Types

This section is empty.

Jump to

Keyboard shortcuts

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