Documentation ¶
Index ¶
- Variables
- func Annotations(names ...string) io.WriterTo
- func Fmt(txt string, fm ...interface{}) io.WriterTo
- func IsDrainError(err error) bool
- func IsNoError(err error) bool
- func IsNotDrainError(err error) bool
- func ToTemplate(name string, templ string, mx template.FuncMap) (*template.Template, error)
- func ToTemplateFuncs(funcs ...map[string]interface{}) template.FuncMap
- type AnnotationDeclr
- type BlockDeclr
- type BoolDeclr
- type ByteBlockDeclr
- type CaseDeclr
- type CommentDeclr
- type ConditionDeclr
- type ConstantWriter
- type ConstructorDeclr
- type CustomReturnDeclr
- type DefaultCaseDeclr
- type FieldTypeDeclr
- type Float32Declr
- type Float64Declr
- type FloatBaseDeclr
- type FromReader
- type FunctionDeclr
- type FunctionTypeDeclr
- type IfDeclr
- type ImportDeclr
- type ImportItemDeclr
- type Int32Declr
- type Int64Declr
- type IntBaseDeclr
- type IntDeclr
- type JSONBlock
- type JSONDeclr
- type MapAny
- type MapAnyWriter
- type MapDeclr
- type MapOut
- type MultiCommentDeclr
- type NameDeclr
- type NoBOMWriter
- type OperatorDeclr
- type PackageDeclr
- type PrefixDeclr
- type ReturnDeclr
- type RuneASCIIDeclr
- type RuneDeclr
- type RuneGraphicsDeclr
- type SingleBlockDeclr
- type SingleByteBlockDeclr
- type SliceDeclr
- type SliceTypeDeclr
- type SourceDeclr
- type StringASCIIDeclr
- type StringDeclr
- type StructDeclr
- type StructTypeDeclr
- type SuffixDeclr
- type SwitchDeclr
- type TagDeclr
- type TextBlockDeclr
- type TextDeclr
- type TypeDeclr
- func CustomMapType(mapdefType, mapType string, mapValue string) TypeDeclr
- func CustomMapValueVar(mapdefType, mapType string, mapValue string) TypeDeclr
- func MapType(maptype string, mapvalue string) TypeDeclr
- func MapValueVar(mapType string, mapValue string) TypeDeclr
- func Type(name string) TypeDeclr
- type UInt32Declr
- type UInt64Declr
- type UIntBaseDeclr
- type ValueAssignmentDeclr
- type ValueDeclr
- type VariableAssignmentDeclr
- type VariableNameDeclr
- type VariableShortAssignmentDeclr
- type VariableTypeDeclr
- type WriteCounter
- type WriteDirective
- type WriterToMap
- type WritersTo
Constants ¶
This section is empty.
Variables ¶
var ( // CommaWriter defines the a writer that consistently writes a ','. CommaWriter = NewConstantWriter([]byte(",")) // NewlineWriter defines the a writer that consistently writes a \n. NewlineWriter = NewConstantWriter([]byte("\n")) // CommaSpacedWriter defines the a writer that consistently writes a ', '. CommaSpacedWriter = NewConstantWriter([]byte(", ")) // PeriodWriter defines the a writer that consistently writes a '.'. PeriodWriter = NewConstantWriter([]byte(".")) )
var ( PlusOperator = OperatorDeclr{Operation: "+"} MinusOperator = OperatorDeclr{Operation: "-"} ModeOperator = OperatorDeclr{Operation: "%"} DivideOperator = OperatorDeclr{Operation: "/"} MultiplicationOperator = OperatorDeclr{Operation: "*"} EqualOperator = OperatorDeclr{Operation: "=="} LessThanOperator = OperatorDeclr{Operation: "<"} MoreThanOperator = OperatorDeclr{Operation: ">"} LessThanEqualOperator = OperatorDeclr{Operation: "<="} MoreThanEqualOperator = OperatorDeclr{Operation: ">="} NotEqualOperator = OperatorDeclr{Operation: "!="} ANDOperator = OperatorDeclr{Operation: "&&"} OROperator = OperatorDeclr{Operation: "||"} BinaryANDOperator = OperatorDeclr{Operation: "&"} BinaryOROperator = OperatorDeclr{Operation: "|"} DecrementOperator = OperatorDeclr{Operation: "--"} IncrementOperator = OperatorDeclr{Operation: "++"} )
Contains different sets of operator declarations.
var CommaMapper = MapAny{MapFn: func(to io.Writer, declrs ...io.WriterTo) (int64, error) { wc := NewWriteCounter(to) total := len(declrs) - 1 for index, declr := range declrs { if _, err := declr.WriteTo(wc); err != nil && err != io.EOF { return 0, err } if index < total { CommaWriter.WriteTo(wc) } } return wc.Written(), nil }}
CommaMapper defines a struct which implements the DeclarationMap which maps a set of items by seperating their output with a coma ',', but execludes before the first and after the last item.
var CommaSpacedMapper = MapAny{MapFn: func(to io.Writer, declrs ...io.WriterTo) (int64, error) { wc := NewWriteCounter(to) total := len(declrs) - 1 for index, declr := range declrs { if _, err := declr.WriteTo(wc); err != nil && err != io.EOF { return 0, err } if index < total { CommaSpacedWriter.WriteTo(wc) } } return wc.Written(), nil }}
CommaSpacedMapper defines a struct which implements the DeclarationMap which maps a set of items by seperating their output with a coma ', ', but execludes before the first and after the last item.
var DotMapper = MapAny{MapFn: func(to io.Writer, declrs ...io.WriterTo) (int64, error) { wc := NewWriteCounter(to) total := len(declrs) - 1 for index, declr := range declrs { if _, err := declr.WriteTo(wc); err != nil && err != io.EOF { return 0, err } if index < total { PeriodWriter.WriteTo(wc) } } return wc.Written(), nil }}
DotMapper defines a struct which implements the DeclarationMap which maps a set of items by seperating their output with a period '.', but execludes before the first and after the last item.
var NewlineMapper = MapAny{MapFn: func(to io.Writer, declrs ...io.WriterTo) (int64, error) { wc := NewWriteCounter(to) total := len(declrs) - 1 for index, declr := range declrs { if _, err := declr.WriteTo(wc); err != nil && err != io.EOF { return 0, err } if index < total { NewlineWriter.WriteTo(wc) } } return wc.Written(), nil }}
NewlineMapper defines a struct which implements the DeclarationMap which maps a set of items by seperating their output with a period '.', but execludes before the first and after the last item.
Functions ¶
func Annotations ¶
Annotations returns a slice instance of io.WriterTo.
func IsDrainError ¶
IsDrainError is used to check if a error value matches io.EOF.
func IsNotDrainError ¶
IsNotDrainError is used to check if a error value matches io.EOF.
func ToTemplate ¶
ToTemplate returns a template instance with the giving templ string and functions.
func ToTemplateFuncs ¶
ToTemplateFuncs returns a template.FuncMap which is a union of all key and values from the provided map. It does not check for function type and will override any previos key values.
Types ¶
type AnnotationDeclr ¶
type AnnotationDeclr struct {
Value string `json:"value"`
}
AnnotationDeclr defines a struct for generating a annotation.
func Annotation ¶
func Annotation(name string) AnnotationDeclr
Annotation returns a new instance of a AnnotationDeclr.
func (AnnotationDeclr) String ¶
func (n AnnotationDeclr) String() string
String returns the internal name associated with the NameDeclr.
type BlockDeclr ¶
type BlockDeclr struct { Block io.WriterTo `json:"block"` RuneBegin rune `json:"begin"` RuneEnd rune `json:"end"` }
BlockDeclr defines a declaration which produces a block cover which wraps any other declaration writer into it's block char. eg. A BlockDeclr with Char '{”}'
Will produce '{DataFROMWriter}' output.
func Block ¶
func Block(elems ...io.WriterTo) BlockDeclr
Block returns a new instance of a BlockDeclr with no prefix and suffix.
type BoolDeclr ¶
type BoolDeclr struct {
Value bool `json:"value"`
}
BoolDeclr defines a declaration struct for representing a giving value.
type ByteBlockDeclr ¶
type ByteBlockDeclr struct { Block io.WriterTo `json:"block"` BlockBegin []byte `json:"begin"` BlockEnd []byte `json:"end"` }
ByteBlockDeclr defines a declaration which produces a block cover which wraps any other declaration writer into it's block char. eg. A BlockDeclr with Char '{”}'
Will produce '{{DataFROMWriter}}' output.
func ByteWrapBlock ¶
func ByteWrapBlock(begin, end []byte, elems ...io.WriterTo) ByteBlockDeclr
ByteWrapBlock returns a new instance of a ByteBlockDeclr.
type CaseDeclr ¶
CaseDeclr defines a structure which generates switch case declarations.
type CommentDeclr ¶
type CommentDeclr struct { MainBlock io.WriterTo `json:"mainBlock"` Blocks WritersTo `json:"blocks"` }
CommentDeclr defines a declaration struct for representing a single comment.
func Commentary ¶
func Commentary(mainblock io.WriterTo, elems ...io.WriterTo) CommentDeclr
Commentary returns a new instance of a CommentDeclr.
type ConditionDeclr ¶
type ConditionDeclr struct { PreVar VariableNameDeclr `json:"prevar"` PostVar VariableNameDeclr `json:"postvar"` Operator OperatorDeclr `json:"operator"` }
ConditionDeclr defines a declaration which produces a variable declaration.
func Condition ¶
func Condition(pre VariableNameDeclr, op OperatorDeclr, post VariableNameDeclr) ConditionDeclr
Condition returns a new instance of a ConditionDeclr.
type ConstantWriter ¶
type ConstantWriter struct {
// contains filtered or unexported fields
}
ConstantWriter defines a writer that consistently writes a provided output.
func NewConstantWriter ¶
func NewConstantWriter(d []byte) ConstantWriter
NewConstantWriter returns a new instance of ConstantWriter.
type ConstructorDeclr ¶
type ConstructorDeclr struct {
Arguments []VariableTypeDeclr `json:"constructor"`
}
ConstructorDeclr defines a declaration which produces argument based output of it's giving internals.
func Constructor ¶
func Constructor(args ...VariableTypeDeclr) ConstructorDeclr
Constructor returns a new instance of a ConstructorDeclr.
type CustomReturnDeclr ¶
type CustomReturnDeclr struct {
Returns WritersTo `json:"returns"`
}
CustomReturnDeclr defines a declaration which produces argument based output of it's giving internals.
func CustomReturns ¶
func CustomReturns(returns ...io.WriterTo) CustomReturnDeclr
CustomReturns returns a new instance of a CustomReturnDeclr.
type DefaultCaseDeclr ¶
DefaultCaseDeclr defines a structure which generates switch default case declarations.
func DefaultCase ¶
func DefaultCase(action io.WriterTo) DefaultCaseDeclr
DefaultCase returns a new instance of a DefaultCaseDeclr.
type FieldTypeDeclr ¶
FieldTypeDeclr defines a declaration which produces a variable declaration.
func FieldType ¶
func FieldType(name NameDeclr, ntype TypeDeclr) FieldTypeDeclr
FieldType returns a new instance of a VariableTypeDeclr.
type Float32Declr ¶
type Float32Declr struct {
Value float32 `json:"value"`
}
Float32Declr defines a declaration struct for representing a giving value.
func (Float32Declr) String ¶
func (n Float32Declr) String() string
String returns the internal data associated with the structure.
type Float64Declr ¶
type Float64Declr struct {
Value float64 `json:"value"`
}
Float64Declr defines a declaration struct for representing a giving value.
func (Float64Declr) String ¶
func (n Float64Declr) String() string
String returns the internal data associated with the structure.
type FloatBaseDeclr ¶
type FloatBaseDeclr struct { Value float64 `json:"value"` Bitsize int `json:"base"` Precision int `json:"precision"` }
FloatBaseDeclr defines a declaration struct for representing a giving value.
func FloatBase ¶
func FloatBase(rn float64, bit, prec int) FloatBaseDeclr
FloatBase returns a new instance of a FloatBaseDeclr.
func (FloatBaseDeclr) String ¶
func (n FloatBaseDeclr) String() string
String returns the internal data associated with the structure.
type FromReader ¶
FromReader implements io.WriterTo by wrapping a provided io.Reader.
type FunctionDeclr ¶
type FunctionDeclr struct { Name NameDeclr `json:"name"` Constructor ConstructorDeclr `json:"constructor"` Returns io.WriterTo `json:"returns"` Body WritersTo `json:"body"` }
FunctionDeclr defines a declaration which produces function about based on the giving constructor and body.
func Function ¶
func Function(name NameDeclr, constr ConstructorDeclr, returns io.WriterTo, body ...io.WriterTo) FunctionDeclr
Function returns a new instance of a FunctionDeclr.
type FunctionTypeDeclr ¶
type FunctionTypeDeclr struct { Name NameDeclr `json:"name"` Constructor ConstructorDeclr `json:"constructor"` Returns io.WriterTo `json:"returns"` }
FunctionTypeDeclr defines a declaration which produces function about based on the giving constructor and body.
func FunctionType ¶
func FunctionType(name NameDeclr, constr ConstructorDeclr, returns io.WriterTo) FunctionTypeDeclr
FunctionType returns a new instance of a FunctionTypeDeclr.
type ImportDeclr ¶
type ImportDeclr struct {
Packages []ImportItemDeclr `json:"packages"`
}
ImportDeclr defines a type to represent a import statement.
func Imports ¶
func Imports(ims ...ImportItemDeclr) ImportDeclr
Imports returns a new instance of a ImportDeclr.
type ImportItemDeclr ¶
ImportItemDeclr defines a type to represent a import statement.
func Import ¶
func Import(path string, namespace string) ImportItemDeclr
Import returns a new instance of a ImportItemDeclr.
type Int32Declr ¶
type Int32Declr struct {
Value int32 `json:"value"`
}
Int32Declr defines a declaration struct for representing a giving value.
func (Int32Declr) String ¶
func (n Int32Declr) String() string
String returns the internal data associated with the structure.
type Int64Declr ¶
type Int64Declr struct {
Value int64 `json:"value"`
}
Int64Declr defines a declaration struct for representing a giving value.
func (Int64Declr) String ¶
func (n Int64Declr) String() string
String returns the internal data associated with the structure.
type IntBaseDeclr ¶
IntBaseDeclr defines a declaration struct for representing a giving value.
func IntBase ¶
func IntBase(rn int64, base int) IntBaseDeclr
IntBase returns a new instance of a UIntBaseDeclr.
func (IntBaseDeclr) String ¶
func (n IntBaseDeclr) String() string
String returns the internal data associated with the structure.
type IntDeclr ¶
type IntDeclr struct {
Value int `json:"value"`
}
IntDeclr defines a declaration struct for representing a giving value.
type JSONBlock ¶
JSONBlock defines a block area which is encycled by braces.
{ ... }
func JSONDocument ¶
JSONDocument returns a JSONBlock and uses the contents for the JSON document.
type JSONDeclr ¶
JSONDeclr defines a block area contains other JSONBlocks.
{ { ... } }
type MapAny ¶
type MapAny struct {
MapFn MapOut
}
MapAny defines a struct which implements a structure which uses the provided int64ernal MapOut function to apply the necessary business logic of copying giving data space by a giving series of readers.
type MapAnyWriter ¶
MapAnyWriter applies a giving set of MapOut functions with the provided int64ernal declarations writes to the provided io.Writer.
type MapDeclr ¶
type MapDeclr struct { Type NameDeclr Value NameDeclr MapType io.WriterTo Values map[string]io.WriterTo }
MapDeclr defines a type for a map declaration.
func Map ¶
Map returns a MapDeclr for creating a map definition with values for the specific key-value pairs
type MapOut ¶
MapOut defines an function type which maps giving data retrieved from a series of readers int64o the provided byte slice, returning the total number of data written and any error encountered.
type MultiCommentDeclr ¶
type MultiCommentDeclr struct { MainBlock io.WriterTo `json:"mainBlock"` Blocks WritersTo `json:"blocks"` }
MultiCommentDeclr defines a declaration struct for representing a single comment.
func MultiComments ¶
func MultiComments(mainblock io.WriterTo, elems ...io.WriterTo) MultiCommentDeclr
MultiComments returns a new instance of a MultiCommentDeclr.
type NameDeclr ¶
type NameDeclr struct {
Name string `json:"name"`
}
NameDeclr defines a declaration struct for representing a giving value.
func FmtName ¶
FmtName returns a new instance of a NameDeclr aftering passing the string with the values using fmt.
type NoBOMWriter ¶
NoBOMWriter removes any unwanted characters like \x00 found in possible code.
func NewNoBOM ¶
func NewNoBOM(w io.Writer) *NoBOMWriter
NewNoBOM returns a new instance of the NoBOMWriter
type OperatorDeclr ¶
type OperatorDeclr struct {
Operation string `json:"operation"`
}
OperatorDeclr defines a declaration which produces a variable declaration.
func (OperatorDeclr) String ¶
func (n OperatorDeclr) String() string
String returns the internal name associated with the struct.
type PackageDeclr ¶
PackageDeclr defines a declaration which generates a go package source.
type PrefixDeclr ¶
PrefixDeclr defines a declaration which produces a block with the provided prefix.
func Prefix ¶
func Prefix(prefix, val io.WriterTo) PrefixDeclr
Prefix returns a new instance of a PrefixDeclr.
type ReturnDeclr ¶
type ReturnDeclr struct {
Returns []TypeDeclr `json:"returns"`
}
ReturnDeclr defines a declaration which produces argument based output of it's giving internals.
func Returns ¶
func Returns(returns ...TypeDeclr) ReturnDeclr
Returns returns a new instance of a ReturnDeclr.
type RuneASCIIDeclr ¶
type RuneASCIIDeclr struct {
Value rune `json:"value"`
}
RuneASCIIDeclr defines a declaration struct for representing a giving value.
func RuneASCII ¶
func RuneASCII(rn rune) RuneASCIIDeclr
RuneASCII returns a new instance of a RuneASCIIDeclr.
func (RuneASCIIDeclr) String ¶
func (n RuneASCIIDeclr) String() string
String returns the internal data associated with the structure.
type RuneDeclr ¶
type RuneDeclr struct {
Value rune `json:"value"`
}
RuneDeclr defines a declaration struct for representing a giving value.
type RuneGraphicsDeclr ¶
type RuneGraphicsDeclr struct {
Value rune `json:"value"`
}
RuneGraphicsDeclr defines a declaration struct for representing a giving value.
func RuneGraphics ¶
func RuneGraphics(rn rune) RuneGraphicsDeclr
RuneGraphics returns a new instance of a RuneGraphicsDeclr.
func (RuneGraphicsDeclr) String ¶
func (n RuneGraphicsDeclr) String() string
String returns the internal data associated with the structure.
type SingleBlockDeclr ¶
type SingleBlockDeclr struct {
Rune rune `json:"rune"`
}
SingleBlockDeclr defines a declaration which produces a block char which is written to a writer. eg. A BlockDeclr with Char '{'
Will produce '{' output.
func PrefixRune ¶
func PrefixRune(start rune) SingleBlockDeclr
PrefixRune returns a new instance of a SingleBlockDeclr.
func SuffixRune ¶
func SuffixRune(end rune) SingleBlockDeclr
SuffixRune returns a new instance of a SingleBlockDeclr.
type SingleByteBlockDeclr ¶
type SingleByteBlockDeclr struct {
Block []byte `json:"block"`
}
SingleByteBlockDeclr defines a declaration which produces a block byte slice which is written to a writer. declaration writer into it's block char. eg. A BlockDeclr with Char '{{'
Will produce '{{DataFROMWriter' output.
func PrefixByte ¶
func PrefixByte(start []byte) SingleByteBlockDeclr
PrefixByte returns a new instance of a SingleByteBlockDeclr.
func SuffixByte ¶
func SuffixByte(end []byte) SingleByteBlockDeclr
SuffixByte returns a new instance of a SingleByteBlockDeclr.
type SliceDeclr ¶
SliceDeclr defines a declaration struct for representing a go slice.
type SliceTypeDeclr ¶
type SliceTypeDeclr struct {
Type TypeDeclr `json:"type"`
}
SliceTypeDeclr defines a declaration struct for representing a go slice.
func SliceType ¶
func SliceType(ty string) SliceTypeDeclr
SliceType returns a new instance of a SliceTypeDeclr.
type SourceDeclr ¶
SourceDeclr defines a declaration type which takes a giving source template and providing binding and will execute the template to generate it's output
func Source ¶
func Source(tml *template.Template, binding interface{}) SourceDeclr
Source returns a new instance of a SourceDeclr.
func SourceWith ¶
func SourceWith(tml *template.Template, dfns template.FuncMap, binding interface{}) SourceDeclr
SourceWith returns a new instance of a SourceDeclr.
type StringASCIIDeclr ¶
type StringASCIIDeclr struct {
Value string `json:"value"`
}
StringASCIIDeclr defines a declaration struct for representing a giving value.
func StringASCII ¶
func StringASCII(rn string) StringASCIIDeclr
StringASCII returns a new instance of a StringASCIIDeclr.
func (StringASCIIDeclr) String ¶
func (n StringASCIIDeclr) String() string
String returns the internal data associated with the structure.
type StringDeclr ¶
type StringDeclr struct {
Value string `json:"value"`
}
StringDeclr defines a declaration struct for representing a giving value.
func (StringDeclr) String ¶
func (n StringDeclr) String() string
String returns the internal data associated with the structure.
type StructDeclr ¶
type StructDeclr struct { Name NameDeclr `json:"name"` Type TypeDeclr `json:"type"` Comments io.WriterTo `json:"comments"` Annotations io.WriterTo `json:"annotations"` Fields WritersTo `json:"fields"` }
StructDeclr defines a declaration struct for representing a single comment.
func Interface ¶
func Interface(name NameDeclr, comments io.WriterTo, annotations io.WriterTo, fields ...io.WriterTo) StructDeclr
Interface returns a new instance of a StructDeclr to generate a go struct.
type StructTypeDeclr ¶
type StructTypeDeclr struct { Name NameDeclr `json:"name"` Type TypeDeclr `json:"typename"` Tags WritersTo `json:"tags"` }
StructTypeDeclr defines a declaration which produces a variable declaration.
type SuffixDeclr ¶
SuffixDeclr defines a declaration which produces a block with the provided prefix.
func Suffix ¶
func Suffix(suffix, val io.WriterTo) SuffixDeclr
Suffix returns a new instance of a SuffixDelcr.
type SwitchDeclr ¶
type SwitchDeclr struct { Condition io.WriterTo Cases []CaseDeclr Default DefaultCaseDeclr }
SwitchDeclr defines a structure which generates switch declarations.
func Switch ¶
func Switch(condition io.WriterTo, def DefaultCaseDeclr, cases ...CaseDeclr) SwitchDeclr
Switch returns a new instance of a SwitchDeclr.
type TextBlockDeclr ¶
type TextBlockDeclr struct {
Text string `json:"text"`
}
TextBlockDeclr defines a declaration struct for representing a single comment.
func (TextBlockDeclr) String ¶
func (n TextBlockDeclr) String() string
String returns the internal name associated with the NameDeclr.
type TextDeclr ¶
TextDeclr defines a declaration type which takes a giving source text and generate text.Template for it and providing binding and will execute the template to generate it's output
func SourceText ¶
SourceText returns a new instance of a TextDeclr.
func SourceTextWith ¶
SourceTextWith returns a new instance of a TextDeclr.
type TypeDeclr ¶
type TypeDeclr struct {
TypeName string `json:"typeName"`
}
TypeDeclr defines a declaration struct for representing a giving type.
func CustomMapType ¶
CustomMapType returns a combination of types that represent a map type.
func CustomMapValueVar ¶
CustomMapValueVar returns a combination of types that represent a map type with its key and value.
func MapValueVar ¶
MapValueVar returns a combination of types that represent a map type.
type UInt32Declr ¶
type UInt32Declr struct {
Value uint32 `json:"value"`
}
UInt32Declr defines a declaration struct for representing a giving value.
func (UInt32Declr) String ¶
func (n UInt32Declr) String() string
String returns the internal data associated with the structure.
type UInt64Declr ¶
type UInt64Declr struct {
Value uint64 `json:"value"`
}
UInt64Declr defines a declaration struct for representing a giving value.
func (UInt64Declr) String ¶
func (n UInt64Declr) String() string
String returns the internal data associated with the structure.
type UIntBaseDeclr ¶
UIntBaseDeclr defines a declaration struct for representing a giving value.
func UIntBase ¶
func UIntBase(rn uint64, base int) UIntBaseDeclr
UIntBase returns a new instance of a UIntBaseDeclr.
func (UIntBaseDeclr) String ¶
func (n UIntBaseDeclr) String() string
String returns the internal data associated with the structure.
type ValueAssignmentDeclr ¶
ValueAssignmentDeclr defines a declaration which produces a variable declaration.
func AssignValue ¶
func AssignValue(name NameDeclr, value io.WriterTo) ValueAssignmentDeclr
AssignValue returns a new instance of a ValueAssignmentDeclr.
func MapAssignValue ¶
func MapAssignValue(mapname string, key string, value string) ValueAssignmentDeclr
MapAssignValue returns a new instance of a ValueAssignmentDeclr.
type ValueDeclr ¶
type ValueDeclr struct { Value interface{} `json:"value"` ValueConverter func(interface{}) string `json:"-"` }
ValueDeclr defines a declaration struct for representing a giving value.
func Value ¶
func Value(rn interface{}, converter func(interface{}) string) ValueDeclr
Value returns a new instance of a ValueDeclr.
func (ValueDeclr) String ¶
func (n ValueDeclr) String() string
String returns the internal data associated with the structure.
type VariableAssignmentDeclr ¶
type VariableAssignmentDeclr struct { Name NameDeclr `json:"name"` Value io.WriterTo `json:"value"` }
VariableAssignmentDeclr defines a declaration which produces a variable declaration.
type VariableNameDeclr ¶
type VariableNameDeclr struct {
Name NameDeclr `json:"name"`
}
VariableNameDeclr defines a declaration which produces a variable declaration.
func VarName ¶
func VarName(name NameDeclr) VariableNameDeclr
VarName returns a new instance of a VariableNameDeclr.
type VariableShortAssignmentDeclr ¶
type VariableShortAssignmentDeclr struct { Name NameDeclr `json:"name"` Value io.WriterTo `json:"value"` }
VariableShortAssignmentDeclr defines a declaration which produces a variable declaration.
func AssignMap ¶
func AssignMap(name string, maptype string, mapvalue string) VariableShortAssignmentDeclr
AssignMap returns a combination of types that represent a map type.
type VariableTypeDeclr ¶
VariableTypeDeclr defines a declaration which produces a variable declaration.
func MapVar ¶
func MapVar(name string, maptype string, mapvalue string) VariableTypeDeclr
MapVar returns a combination of types that represent a map type.
func VarType ¶
func VarType(name NameDeclr, ntype TypeDeclr) VariableTypeDeclr
VarType returns a new instance of a VariableTypeDeclr.
type WriteCounter ¶
WriteCounter defines a struct which collects write counts of a giving io.Writer
func NewWriteCounter ¶
func NewWriteCounter(w io.Writer) *WriteCounter
NewWriteCounter returns a new instance of the WriteCounter.
func (*WriteCounter) Write ¶
func (w *WriteCounter) Write(data []byte) (int, error)
Write calls the internal io.Writer.Write method and adds up the write counts.
func (*WriteCounter) Written ¶
func (w *WriteCounter) Written() int64
Written returns the total number of data writer to the underline writer.
type WriteDirective ¶
type WriteDirective struct { Writer io.WriterTo `ast:"-,!optional"` // WriteTo which contains the complete content of the file to be written to. Dir string `ast:"dir,optional"` // Relative dir path written into it if not existing. FileName string `ast:"filename,optional"` // alternative fileName to use for new file. DontOverride bool `ast:"dont_override,optional"` Before func() error After func() error }
WriteDirective defines a struct which contains giving directives as to the file and the relative path within which it should be written to. Include are tags which give meta description of the optionality of each field.
type WriterToMap ¶
WriterToMap defines a int64erface which maps giving declaration values int64o appropriate form for final output. It allows us create custom wrappers to define specific output style for a giving set of declarations.