Documentation
¶
Overview ¶
Package builder implements a simple way to generate arbitrary Jsonnet directly from Go, using a functional API inspired by how Jsonnet is written itself.
Index ¶
- Constants
- type ArithType
- type BoolType
- type CallType
- type CommentType
- type ConditionType
- type Doc
- type FloatType
- type FuncType
- type HiddenType
- type ImportType
- type IntType
- type ListType
- type LocalType
- type MergeType
- type NullType
- type ObjectType
- type RefType
- type RequiredArgType
- type SprintfType
- type StringType
- type Type
Constants ¶
View Source
const ( SeparatorLong = ",\n" SeparatorConcise = ", " )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallType ¶
type CallType struct {
// contains filtered or unexported fields
}
function call
type CommentType ¶
type CommentType struct {
// contains filtered or unexported fields
}
func Comment ¶
func Comment(value Type, comment string) CommentType
func (CommentType) Comment ¶
func (t CommentType) Comment() string
func (CommentType) Name ¶
func (t CommentType) Name() string
func (CommentType) String ¶
func (t CommentType) String() string
type ConditionType ¶
func IfThenElse ¶
func IfThenElse(name string, If, Then, Else Type) ConditionType
func (ConditionType) Name ¶
func (c ConditionType) Name() string
func (ConditionType) String ¶
func (c ConditionType) String() string
type FuncType ¶
type FuncType struct {
// contains filtered or unexported fields
}
function definition
type HiddenType ¶
type HiddenType struct {
// contains filtered or unexported fields
}
hidden field (::)
func Hidden ¶
func Hidden(value Type) HiddenType
func (HiddenType) Name ¶
func (h HiddenType) Name() string
func (HiddenType) String ¶
func (h HiddenType) String() string
type ImportType ¶
type ImportType struct {
// contains filtered or unexported fields
}
func Import ¶
func Import(name, pkg string) ImportType
func ImportStr ¶
func ImportStr(name, pkg string) ImportType
func (ImportType) String ¶
func (i ImportType) String() string
type ObjectType ¶
type ObjectType struct {
// contains filtered or unexported fields
}
Objects (dicts)
func ConciseObject ¶
func ConciseObject(name string, children ...Type) ObjectType
func Object ¶
func Object(name string, children ...Type) ObjectType
func (ObjectType) ConciseString ¶
func (o ObjectType) ConciseString() string
func (ObjectType) String ¶
func (o ObjectType) String() string
type RequiredArgType ¶
type RequiredArgType struct {
// contains filtered or unexported fields
}
required arguments (no default value)
func Required ¶
func Required(t Type) RequiredArgType
func (RequiredArgType) Name ¶
func (r RequiredArgType) Name() string
func (RequiredArgType) String ¶
func (r RequiredArgType) String() string
type SprintfType ¶
type SprintfType struct {
// contains filtered or unexported fields
}
string formatting
func Sprintf ¶
func Sprintf(name, format string, values ...Type) SprintfType
type StringType ¶
type StringType struct {
// contains filtered or unexported fields
}
strings
func String ¶
func String(name, value string) StringType
func (StringType) String ¶
func (s StringType) String() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.