ast

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 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

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

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

ControllerError represents an error during controller registration

func (*ControllerError) Error

func (e *ControllerError) Error() string

func (*ControllerError) Unwrap

func (e *ControllerError) Unwrap() error

type ProviderError

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

func (e *ProviderError) Error() string

func (*ProviderError) Unwrap

func (e *ProviderError) Unwrap() error

Jump to

Keyboard shortcuts

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