ast

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package ast provides AST modification utilities for modkit source files.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDefinitionNotFound = errors.New("Definition method not found")
	ErrProvidersNotFound  = errors.New("Providers field not found in Definition")
	ErrTokenExists        = errors.New("provider token already exists")
)

Common errors

View Source
var ErrControllersNotFound = errors.New("Controllers field not found in Definition")

ErrControllersNotFound is returned when Controllers field is not found in Definition

Functions

func AddController added in v0.12.0

func AddController(filePath, controllerName, buildFunc string) error

AddController registers a new controller in the module definition

func AddProvider

func AddProvider(filePath, providerToken, buildFunc string) error

AddProvider registers a new provider in the module definition.

Types

type ControllerError added in v0.12.0

type ControllerError struct {
	Op   string
	Name string
	File string
	Err  error
}

ControllerError represents an error during controller registration

func (*ControllerError) Error added in v0.12.0

func (e *ControllerError) Error() string

func (*ControllerError) Unwrap added in v0.12.0

func (e *ControllerError) Unwrap() error

type ProviderError added in v0.12.0

type ProviderError struct {
	Op    string // operation: "parse", "validate", "find", "insert"
	Token string
	File  string
	Err   error
}

ProviderError represents an error during provider registration

func (*ProviderError) Error added in v0.12.0

func (e *ProviderError) Error() string

func (*ProviderError) Unwrap added in v0.12.0

func (e *ProviderError) Unwrap() error

Jump to

Keyboard shortcuts

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