jsonnet

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatJsonnet

func FormatJsonnet() jsonnet.NativeFunction

func Manifest

func Manifest(elem any) (string, error)

func ManifestJsonnet

func ManifestJsonnet() jsonnet.NativeFunction

func MarshalNode

func MarshalNode(node ast.Node) ([]byte, error)

func Parse

func Parse(val string) (any, error)

func ParseJsonnet

func ParseJsonnet() jsonnet.NativeFunction

func Plugin

func Plugin(opts ...jpoet.PluginOption) *jpoet.Plugin

func UnmarshalNode

func UnmarshalNode(data []byte) (ast.Node, error)

Types

type Apply

type Apply ast.Apply

func (Apply) MarshalJSON

func (a Apply) MarshalJSON() ([]byte, error)

func (*Apply) UnmarshalJSON

func (a *Apply) UnmarshalJSON(data []byte) error

type ApplyBrace

type ApplyBrace ast.ApplyBrace

func (ApplyBrace) MarshalJSON

func (a ApplyBrace) MarshalJSON() ([]byte, error)

func (*ApplyBrace) UnmarshalJSON

func (a *ApplyBrace) UnmarshalJSON(data []byte) error

type Arguments

type Arguments ast.Arguments

func (Arguments) MarshalJSON

func (a Arguments) MarshalJSON() ([]byte, error)

func (*Arguments) UnmarshalJSON

func (a *Arguments) UnmarshalJSON(data []byte) error

type Array

type Array ast.Array

func (Array) MarshalJSON

func (a Array) MarshalJSON() ([]byte, error)

func (*Array) UnmarshalJSON

func (a *Array) UnmarshalJSON(data []byte) error

type ArrayComp

type ArrayComp ast.ArrayComp

func (ArrayComp) MarshalJSON

func (a ArrayComp) MarshalJSON() ([]byte, error)

func (*ArrayComp) UnmarshalJSON

func (a *ArrayComp) UnmarshalJSON(data []byte) error

type Assert

type Assert ast.Assert

func (Assert) MarshalJSON

func (a Assert) MarshalJSON() ([]byte, error)

func (*Assert) UnmarshalJSON

func (a *Assert) UnmarshalJSON(data []byte) error

type Binary

type Binary ast.Binary

func (Binary) MarshalJSON

func (b Binary) MarshalJSON() ([]byte, error)

func (*Binary) UnmarshalJSON

func (b *Binary) UnmarshalJSON(data []byte) error

type CommaSeparatedExpr

type CommaSeparatedExpr ast.CommaSeparatedExpr

func (CommaSeparatedExpr) MarshalJSON

func (c CommaSeparatedExpr) MarshalJSON() ([]byte, error)

func (*CommaSeparatedExpr) UnmarshalJSON

func (c *CommaSeparatedExpr) UnmarshalJSON(data []byte) error

type Conditional

type Conditional ast.Conditional

func (Conditional) MarshalJSON

func (c Conditional) MarshalJSON() ([]byte, error)

func (*Conditional) UnmarshalJSON

func (c *Conditional) UnmarshalJSON(data []byte) error

type Dollar

type Dollar ast.Dollar

func (Dollar) MarshalJSON

func (d Dollar) MarshalJSON() ([]byte, error)

func (*Dollar) UnmarshalJSON

func (d *Dollar) UnmarshalJSON(data []byte) error

type Error

type Error ast.Error

func (Error) MarshalJSON

func (e Error) MarshalJSON() ([]byte, error)

func (*Error) UnmarshalJSON

func (e *Error) UnmarshalJSON(data []byte) error

type Fodder

type Fodder []FodderElement

func NewFodder

func NewFodder(fodder ast.Fodder) Fodder

func (Fodder) Fodder

func (f Fodder) Fodder() ast.Fodder

type FodderElement

type FodderElement ast.FodderElement

func (FodderElement) MarshalJSON

func (f FodderElement) MarshalJSON() ([]byte, error)

func (*FodderElement) UnmarshalJSON

func (f *FodderElement) UnmarshalJSON(data []byte) error

type ForSpec

type ForSpec ast.ForSpec

func (ForSpec) MarshalJSON

func (f ForSpec) MarshalJSON() ([]byte, error)

func (*ForSpec) UnmarshalJSON

func (f *ForSpec) UnmarshalJSON(data []byte) error

type Function

type Function ast.Function

func (Function) MarshalJSON

func (f Function) MarshalJSON() ([]byte, error)

func (*Function) UnmarshalJSON

func (f *Function) UnmarshalJSON(data []byte) error

type IfSpec

type IfSpec ast.IfSpec

func (IfSpec) MarshalJSON

func (i IfSpec) MarshalJSON() ([]byte, error)

func (*IfSpec) UnmarshalJSON

func (i *IfSpec) UnmarshalJSON(data []byte) error

type Import

type Import ast.Import

func (Import) MarshalJSON

func (i Import) MarshalJSON() ([]byte, error)

func (*Import) UnmarshalJSON

func (i *Import) UnmarshalJSON(data []byte) error

type ImportBin

type ImportBin ast.ImportBin

func (ImportBin) MarshalJSON

func (i ImportBin) MarshalJSON() ([]byte, error)

func (*ImportBin) UnmarshalJSON

func (i *ImportBin) UnmarshalJSON(data []byte) error

type ImportStr

type ImportStr ast.ImportStr

func (ImportStr) MarshalJSON

func (i ImportStr) MarshalJSON() ([]byte, error)

func (*ImportStr) UnmarshalJSON

func (i *ImportStr) UnmarshalJSON(data []byte) error

type InSuper

type InSuper ast.InSuper

func (InSuper) MarshalJSON

func (i InSuper) MarshalJSON() ([]byte, error)

func (*InSuper) UnmarshalJSON

func (i *InSuper) UnmarshalJSON(data []byte) error

type Index

type Index ast.Index

func (Index) MarshalJSON

func (i Index) MarshalJSON() ([]byte, error)

func (*Index) UnmarshalJSON

func (i *Index) UnmarshalJSON(data []byte) error

type LiteralBoolean

type LiteralBoolean ast.LiteralBoolean

func (LiteralBoolean) MarshalJSON

func (l LiteralBoolean) MarshalJSON() ([]byte, error)

func (*LiteralBoolean) UnmarshalJSON

func (l *LiteralBoolean) UnmarshalJSON(data []byte) error

type LiteralNull

type LiteralNull ast.LiteralNull

func (LiteralNull) MarshalJSON

func (l LiteralNull) MarshalJSON() ([]byte, error)

func (*LiteralNull) UnmarshalJSON

func (l *LiteralNull) UnmarshalJSON(data []byte) error

type LiteralNumber

type LiteralNumber ast.LiteralNumber

func (LiteralNumber) MarshalJSON

func (l LiteralNumber) MarshalJSON() ([]byte, error)

func (*LiteralNumber) UnmarshalJSON

func (l *LiteralNumber) UnmarshalJSON(data []byte) error

type LiteralString

type LiteralString ast.LiteralString

func (LiteralString) MarshalJSON

func (l LiteralString) MarshalJSON() ([]byte, error)

func (*LiteralString) UnmarshalJSON

func (l *LiteralString) UnmarshalJSON(data []byte) error

type Local

type Local ast.Local

func (Local) MarshalJSON

func (l Local) MarshalJSON() ([]byte, error)

func (*Local) UnmarshalJSON

func (l *Local) UnmarshalJSON(data []byte) error

type LocalBind

type LocalBind ast.LocalBind

func (LocalBind) MarshalJSON

func (l LocalBind) MarshalJSON() ([]byte, error)

func (*LocalBind) UnmarshalJSON

func (l *LocalBind) UnmarshalJSON(data []byte) error

type Location

type Location ast.Location

func NewLocation

func NewLocation(location ast.Location) Location

func (Location) Location

func (s Location) Location() ast.Location

func (Location) MarshalJSON

func (s Location) MarshalJSON() ([]byte, error)

func (*Location) UnmarshalJSON

func (s *Location) UnmarshalJSON(data []byte) error

type LocationRange

type LocationRange ast.LocationRange

func NewLocationRange

func NewLocationRange(locationRange ast.LocationRange) LocationRange

func (LocationRange) LocationRange

func (l LocationRange) LocationRange() ast.LocationRange

func (LocationRange) MarshalJSON

func (l LocationRange) MarshalJSON() ([]byte, error)

func (*LocationRange) UnmarshalJSON

func (l *LocationRange) UnmarshalJSON(data []byte) error

type NamedArgument

type NamedArgument ast.NamedArgument

func (NamedArgument) MarshalJSON

func (n NamedArgument) MarshalJSON() ([]byte, error)

func (*NamedArgument) UnmarshalJSON

func (n *NamedArgument) UnmarshalJSON(data []byte) error

type Node

type Node struct {
	Node ast.Node
}

func NewNode

func NewNode(node ast.Node) Node

func (Node) MarshalJSON

func (n Node) MarshalJSON() ([]byte, error)

func (*Node) UnmarshalJSON

func (n *Node) UnmarshalJSON(data []byte) error

type Object

type Object ast.Object

func (Object) MarshalJSON

func (o Object) MarshalJSON() ([]byte, error)

func (*Object) UnmarshalJSON

func (o *Object) UnmarshalJSON(data []byte) error

type ObjectComp

type ObjectComp ast.ObjectComp

func (ObjectComp) MarshalJSON

func (o ObjectComp) MarshalJSON() ([]byte, error)

func (*ObjectComp) UnmarshalJSON

func (o *ObjectComp) UnmarshalJSON(data []byte) error

type ObjectField

type ObjectField ast.ObjectField

func (ObjectField) MarshalJSON

func (o ObjectField) MarshalJSON() ([]byte, error)

func (*ObjectField) UnmarshalJSON

func (o *ObjectField) UnmarshalJSON(data []byte) error

type Parameter

type Parameter ast.Parameter

func (Parameter) MarshalJSON

func (p Parameter) MarshalJSON() ([]byte, error)

func (*Parameter) UnmarshalJSON

func (p *Parameter) UnmarshalJSON(data []byte) error

type Parens

type Parens ast.Parens

func (Parens) MarshalJSON

func (p Parens) MarshalJSON() ([]byte, error)

func (*Parens) UnmarshalJSON

func (p *Parens) UnmarshalJSON(data []byte) error

type ProxyApply

type ProxyApply struct {
	Kind             string    `json:"__kind__"`
	Target           Node      `json:"target"`
	FodderLeft       Fodder    `json:"fodderLeft"`
	Arguments        Arguments `json:"arguments"`
	FodderRight      Fodder    `json:"fodderRight"`
	TailStrictFodder Fodder    `json:"tailStrictFodder"`
	ProxyNodeBase
	TrailingComma bool `json:"trailingComma"`
	TailStrict    bool `json:"tailStrict"`
}

type ProxyApplyBrace

type ProxyApplyBrace struct {
	Kind  string `json:"__kind__"`
	Left  Node   `json:"left"`
	Right Node   `json:"right"`
	ProxyNodeBase
}

type ProxyArguments

type ProxyArguments struct {
	Positional []CommaSeparatedExpr `json:"positional"`
	Named      []NamedArgument      `json:"named"`
}

type ProxyArray

type ProxyArray struct {
	Kind        string               `json:"__kind__"`
	Elements    []CommaSeparatedExpr `json:"elements"`
	CloseFodder Fodder               `json:"closeFodder"`
	ProxyNodeBase
	TrailingComma bool `json:"trailingComma"`
}

type ProxyArrayComp

type ProxyArrayComp struct {
	Kind                string  `json:"__kind__"`
	Body                Node    `json:"body"`
	TrailingCommaFodder Fodder  `json:"trailingCommaFodder"`
	Spec                ForSpec `json:"spec"`
	CloseFodder         Fodder  `json:"closeFodder"`
	ProxyNodeBase
	TrailingComma bool `json:"trailingComma"`
}

type ProxyAssert

type ProxyAssert struct {
	Kind            string `json:"__kind__"`
	Cond            Node   `json:"cond"`
	Message         Node   `json:"message"`
	Rest            Node   `json:"rest"`
	ColonFodder     Fodder `json:"colonFodder"`
	SemicolonFodder Fodder `json:"semicolonFodder"`
	ProxyNodeBase
}

type ProxyBinary

type ProxyBinary struct {
	Kind     string `json:"__kind__"`
	Right    Node   `json:"right"`
	Left     Node   `json:"left"`
	OpFodder Fodder `json:"opFodder"`
	ProxyNodeBase
	Op ast.BinaryOp `json:"op"`
}

type ProxyCommaSeparatedExpr

type ProxyCommaSeparatedExpr struct {
	Kind        string `json:"__kind__"`
	Expr        Node   `json:"expr"`
	CommaFodder Fodder `json:"commaFodder"`
}

type ProxyConditional

type ProxyConditional struct {
	Kind        string `json:"__kind__"`
	Cond        Node   `json:"cond"`
	BranchTrue  Node   `json:"branchTrue"`
	BranchFalse Node   `json:"branchFalse"`
	ThenFodder  Fodder `json:"thenFodder"`
	ElseFodder  Fodder `json:"elseFodder"`
	ProxyNodeBase
}

type ProxyDollar

type ProxyDollar struct {
	Kind string `json:"__kind__"`
	ProxyNodeBase
}

type ProxyError

type ProxyError struct {
	Kind string `json:"__kind__"`
	Expr Node   `json:"expr"`
	ProxyNodeBase
}

type ProxyFodderElement

type ProxyFodderElement struct {
	Comment []string       `json:"comment"`
	Kind    ast.FodderKind `json:"kind"`
	Blanks  int            `json:"blanks"`
	Indent  int            `json:"indent"`
}

type ProxyForSpec

type ProxyForSpec struct {
	Kind       string         `json:"__kind__"`
	ForFodder  Fodder         `json:"forFodder"`
	VarFodder  Fodder         `json:"varFodder"`
	Conditions []IfSpec       `json:"conditions"`
	Outer      *ForSpec       `json:"outer"`
	Expr       Node           `json:"expr"`
	VarName    ast.Identifier `json:"varName"`
	InFodder   Fodder         `json:"inFodder"`
}

type ProxyFunction

type ProxyFunction struct {
	Kind             string      `json:"__kind__"`
	ParenLeftFodder  Fodder      `json:"parenLeftFodder"`
	ParenRightFodder Fodder      `json:"parenRightFodder"`
	Body             Node        `json:"body"`
	Parameters       []Parameter `json:"parameters"`
	ProxyNodeBase
	TrailingComma bool `json:"trailingComma"`
}

type ProxyIfSpec

type ProxyIfSpec struct {
	Kind     string `json:"__kind__"`
	Expr     Node   `json:"expr"`
	IfFodder Fodder `json:"ifFodder"`
}

type ProxyImport

type ProxyImport struct {
	Kind string             `json:"__kind__"`
	File *ast.LiteralString `json:"file"`
	ProxyNodeBase
}

type ProxyImportBin

type ProxyImportBin struct {
	Kind string             `json:"__kind__"`
	File *ast.LiteralString `json:"file"`
	ProxyNodeBase
}

type ProxyImportStr

type ProxyImportStr struct {
	Kind string             `json:"__kind__"`
	File *ast.LiteralString `json:"file"`
	ProxyNodeBase
}

type ProxyInSuper

type ProxyInSuper struct {
	Kind        string `json:"__kind__"`
	Index       Node   `json:"index"`
	InFodder    Fodder `json:"inFodder"`
	SuperFodder Fodder `json:"superFodder"`
	ProxyNodeBase
}

type ProxyIndex

type ProxyIndex struct {
	Kind               string          `json:"__kind__"`
	Target             Node            `json:"target"`
	Index              Node            `json:"index"`
	RightBracketFodder Fodder          `json:"rightBracketFodder"`
	LeftBracketFodder  Fodder          `json:"leftBracketFodder"`
	Id                 *ast.Identifier `json:"id"`
	ProxyNodeBase
}

type ProxyLiteralBoolean

type ProxyLiteralBoolean struct {
	Kind  string `json:"__kind__"`
	Value bool   `json:"value"`
	ProxyNodeBase
}

type ProxyLiteralNull

type ProxyLiteralNull struct {
	Kind string `json:"__kind__"`
	ProxyNodeBase
}

type ProxyLiteralNumber

type ProxyLiteralNumber struct {
	Kind           string `json:"__kind__"`
	OriginalString string `json:"originalString"`
	ProxyNodeBase
}

type ProxyLiteralString

type ProxyLiteralString struct {
	NodeKind        string `json:"__kind__"`
	Value           string `json:"value"`
	BlockIndent     string `json:"blockIndent"`
	BlockTermIndent string `json:"blockTermIndent"`
	ProxyNodeBase
	Kind ast.LiteralStringKind `json:"kind"`
}

type ProxyLocal

type ProxyLocal struct {
	Kind  string      `json:"__kind__"`
	Binds []LocalBind `json:"binds"`
	Body  Node        `json:"body"`
	ProxyNodeBase
}

type ProxyLocalBind

type ProxyLocalBind struct {
	Kind        string         `json:"__kind__"`
	VarFodder   Fodder         `json:"varFodder"`
	Body        Node           `json:"body"`
	EqFodder    Fodder         `json:"eqFodder"`
	Variable    ast.Identifier `json:"variable"`
	CloseFodder Fodder         `json:"closeFodder"`
	Fun         *Function      `json:"fun"`
}

type ProxyLocation

type ProxyLocation struct {
	Line   int `json:"line"`
	Column int `json:"column"`
}

type ProxyLocationRange

type ProxyLocationRange struct {
	File     *Source  `json:"file"`
	FileName string   `json:"fileName"`
	Begin    Location `json:"begin"`
	End      Location `json:"end"`
}

type ProxyNamedArgument

type ProxyNamedArgument struct {
	Kind        string         `json:"__kind__"`
	NameFodder  Fodder         `json:"nameFodder"`
	Name        ast.Identifier `json:"name"`
	EqFodder    Fodder         `json:"eqFodder"`
	Arg         Node           `json:"arg"`
	CommaFodder Fodder         `json:"commaFodder"`
}

type ProxyNodeBase

type ProxyNodeBase struct {
	Fodder   Fodder          `json:"fodder"`
	Ctx      ast.Context     `json:"context"`
	FreeVars ast.Identifiers `json:"freeVars"`
	LocRange LocationRange   `json:"locRange"`
}

func NewProxyNodeBase

func NewProxyNodeBase(n ast.NodeBase) ProxyNodeBase

func (ProxyNodeBase) NodeBase

func (p ProxyNodeBase) NodeBase() ast.NodeBase

type ProxyObject

type ProxyObject struct {
	Kind        string        `json:"__kind__"`
	Fields      []ObjectField `json:"fields"`
	CloseFodder Fodder        `json:"closeFodder"`
	ProxyNodeBase
	TrailingComma bool `json:"trailingComma"`
}

type ProxyObjectComp

type ProxyObjectComp struct {
	Kind                string        `json:"__kind__"`
	Fields              []ObjectField `json:"fields"`
	TrailingCommaFodder Fodder        `json:"trailingCommaFodder"`
	CloseFodder         Fodder        `json:"closeFodder"`
	Spec                ForSpec       `json:"spec"`
	ProxyNodeBase
	TrailingComma bool `json:"trailingComma"`
}

type ProxyObjectField

type ProxyObjectField struct {
	NodeKind    string              `json:"__kind__"`
	Method      *Function           `json:"method"`
	Id          *ast.Identifier     `json:"id"`
	Fodder2     Fodder              `json:"fodder2"`
	Fodder1     Fodder              `json:"fodder1"`
	OpFodder    Fodder              `json:"opFodder"`
	CommaFodder Fodder              `json:"commaFodder"`
	Expr1       Node                `json:"expr1"`
	Expr2       Node                `json:"expr2"`
	Expr3       Node                `json:"expr3"`
	LocRange    ast.LocationRange   `json:"locRange"`
	Kind        ast.ObjectFieldKind `json:"kind"`
	Hide        ast.ObjectFieldHide
	SuperSugar  bool
}

type ProxyParameter

type ProxyParameter struct {
	Kind        string            `json:"__kind__"`
	NameFodder  Fodder            `json:"nameFodder"`
	Name        ast.Identifier    `json:"name"`
	CommaFodder Fodder            `json:"commaFodder"`
	EqFodder    Fodder            `json:"eqFodder"`
	DefaultArg  Node              `json:"defaultArg"`
	LocRange    ast.LocationRange `json:"locRange"`
}

type ProxyParens

type ProxyParens struct {
	Kind        string `json:"__kind__"`
	Inner       Node   `json:"inner"`
	CloseFodder Fodder `json:"closeFodder"`
	ProxyNodeBase
}

type ProxySelf

type ProxySelf struct {
	Kind string `json:"__kind__"`
	ProxyNodeBase
}

type ProxySlice

type ProxySlice struct {
	Kind               string `json:"__kind__"`
	Target             Node   `json:"target"`
	LeftBracketFodder  Fodder `json:"leftBracketFodder"`
	BeginIndex         Node   `json:"beginIndex"`
	EndColonFodder     Fodder `json:"endColonFodder"`
	EndIndex           Node   `json:"endIndex"`
	StepColonFodder    Fodder `json:"stepColonFodder"`
	Step               Node   `json:"step"`
	RightBracketFodder Fodder `json:"rightBracketFodder"`
	ProxyNodeBase
}

type ProxySource

type ProxySource struct {
	DiagnosticFileName ast.DiagnosticFileName `json:"diagnosticFileName"`
	Lines              []string               `json:"lines"`
}

type ProxySuperIndex

type ProxySuperIndex struct {
	Kind      string          `json:"__kind__"`
	IDFodder  Fodder          `json:"idFodder"`
	Index     Node            `json:"index"`
	DotFodder Fodder          `json:"dotFodder"`
	Id        *ast.Identifier `json:"id"`
	ProxyNodeBase
}

type ProxyUnary

type ProxyUnary struct {
	Kind string `json:"__kind__"`
	Expr Node   `json:"expr"`
	ProxyNodeBase
	Op ast.UnaryOp `json:"op"`
}

type ProxyVar

type ProxyVar struct {
	Kind string         `json:"__kind__"`
	Id   ast.Identifier `json:"id"`
	ProxyNodeBase
}

type Self

type Self ast.Self

func (Self) MarshalJSON

func (s Self) MarshalJSON() ([]byte, error)

func (*Self) UnmarshalJSON

func (s *Self) UnmarshalJSON(data []byte) error

type Slice

type Slice ast.Slice

func (Slice) MarshalJSON

func (s Slice) MarshalJSON() ([]byte, error)

func (*Slice) UnmarshalJSON

func (s *Slice) UnmarshalJSON(data []byte) error

type Source

type Source ast.Source

func NewSource

func NewSource(source ast.Source) Source

func (Source) MarshalJSON

func (s Source) MarshalJSON() ([]byte, error)

func (Source) Source

func (s Source) Source() ast.Source

func (*Source) UnmarshalJSON

func (s *Source) UnmarshalJSON(data []byte) error

type SuperIndex

type SuperIndex ast.SuperIndex

func (SuperIndex) MarshalJSON

func (s SuperIndex) MarshalJSON() ([]byte, error)

func (*SuperIndex) UnmarshalJSON

func (s *SuperIndex) UnmarshalJSON(data []byte) error

type Unary

type Unary ast.Unary

func (Unary) MarshalJSON

func (u Unary) MarshalJSON() ([]byte, error)

func (*Unary) UnmarshalJSON

func (u *Unary) UnmarshalJSON(data []byte) error

type Var

type Var ast.Var

func (Var) MarshalJSON

func (v Var) MarshalJSON() ([]byte, error)

func (*Var) UnmarshalJSON

func (v *Var) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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