bindings

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BindingEntry

type BindingEntry struct {
	AnchorKey        string
	StableID         string
	DebugName        string
	CodecFingerprint string
	Kind             string
	Class            string
	Persisted        bool
	IsAlias          bool
	PrimaryAnchor    string
}

BindingEntry represents a single binding in the generated code.

type FileDiff

type FileDiff struct {
	Path   string
	Status string
}

FileDiff describes a mismatch between generated and existing files.

type GenerationResult

type GenerationResult struct {
	Files         []string
	WrittenFiles  []string
	DeletedFiles  []string
	BindingsHash  string
	PackageCount  int
	TotalBindings int
}

GenerationResult contains the results of bindings generation.

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator generates bindings files from the state manifest.

func NewGenerator

func NewGenerator(config GeneratorConfig) *Generator

NewGenerator creates a new bindings generator.

func (*Generator) ComputeBindingsHash

func (g *Generator) ComputeBindingsHash() (string, error)

ComputeBindingsHash computes the deterministic bindings hash from manifest and setup callsites without writing generated files.

func (*Generator) Generate

func (g *Generator) Generate() (*GenerationResult, error)

Generate reads the manifest and generates bindings files.

func (*Generator) GenerateToDir

func (g *Generator) GenerateToDir(outputDir string) (*GenerationResult, error)

GenerateToDir generates bindings into a specified output directory.

func (*Generator) VerifyUpToDate

func (g *Generator) VerifyUpToDate() (*VerifyResult, error)

VerifyUpToDate checks whether generated bindings match the current manifest.

type GeneratorConfig

type GeneratorConfig struct {
	ProjectDir                string
	ModulePath                string
	ManifestPath              string
	OutputDir                 string
	ValidateManifestFreshness bool
}

GeneratorConfig configures the bindings generator.

type PackageBindings

type PackageBindings struct {
	ImportPath     string
	PackageName    string
	RelDir         string
	FilePath       string
	Bindings       map[string]BindingEntry
	SessionKeys    map[string]SessionKeyBindingEntry
	SetupCallsites map[string][]SetupCallsiteEntry
}

PackageBindings groups bindings by their Go package.

type SessionKeyBindingEntry

type SessionKeyBindingEntry struct {
	Name             string
	StableID         string
	CodecFingerprint string
	HasDefault       bool
}

SessionKeyBindingEntry represents a session key binding entry.

type SetupCallsiteEntry

type SetupCallsiteEntry struct {
	Line       int
	SetupIndex int
}

SetupCallsiteEntry represents a single Setup callsite for a function.

type VerifyResult

type VerifyResult struct {
	Current     bool
	Differences []FileDiff
}

VerifyResult contains the result of bindings verification.

Jump to

Keyboard shortcuts

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