models

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicLit

type BasicLit *ast.BasicLit

func GetStringBasicLit

func GetStringBasicLit(value string) BasicLit

GetStringBasicLit returns an AST string literal.

type Decl

type Decl ast.Decl

func GetFuncDecl

func GetFuncDecl(name string, params Fields, bodyStmts Stmts) Decl

GetFuncDecl returns an AST Function declaration.

func GetVarDecl

func GetVarDecl(name, typeExpr string) Decl

GetVarDecl returns an AST Variable declaration.

type Expr

type Expr ast.Expr

func GetCallExpr

func GetCallExpr(caller Expr, params Exprs) Expr

GetCallExpr returns as AST Calling expression.

func GetKeyValueExpr

func GetKeyValueExpr(key, value Expr) Expr

GetKeyValueExpr returns an AST Key-Value expression.

func GetNameExpr

func GetNameExpr(name string) Expr

GetNameExpr returns an AST Name expression.

func GetNeqExpr

func GetNeqExpr(left, right Expr) Expr

GetNeqExpr returns as AST Not Equal expression.

func GetSelectorExpr

func GetSelectorExpr(source Expr, item string) Expr

GetSelectorExpr returns an AST Selector expression.

func GetStructLitExpr

func GetStructLitExpr(name string, elements Exprs) Expr

GetStructLitExpr returns an AST struct literal.

type Exprs

type Exprs []Expr

func (Exprs) Ast

func (es Exprs) Ast() []ast.Expr

Ast returns Exprs as []ast.Expr.

type Field

type Field *ast.Field

func GetField

func GetField(name, typeExpr, tag string) Field

GetField returns as AST field.

type Fields

type Fields []Field

func (Fields) Ast

func (fs Fields) Ast() []*ast.Field

Ast returns Fields as []*ast.Field.

type Stmt

type Stmt ast.Stmt

func GetAssignDefineStmt

func GetAssignDefineStmt(left, right Exprs) Stmt

GetAssignDefineStmt returns an AST Assign (Define) statement.

func GetAssignStmt

func GetAssignStmt(left, right Exprs) Stmt

GetAssignStmt returns an AST Assign statement.

func GetExprStmt

func GetExprStmt(expr Expr) Stmt

GetExprStmt returns an AST expression as statement.

func GetIfStmt

func GetIfStmt(cond Expr, bodyStmts Stmts) Stmt

GetIfStmt returns an AST If statement.

func GetStructStmt

func GetStructStmt(name string, fields Fields) Stmt

GetStructStmt returns an AST Struct statement.

type Stmts

type Stmts []Stmt

func (Stmts) Ast

func (ss Stmts) Ast() []ast.Stmt

Ast returns Stmts as []ast.Stmt.

Jump to

Keyboard shortcuts

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