support

package
v3.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Dbg = false
View Source
var ShowContextInfo = false
View Source
var Verbose = false

Functions

func CreateContext

func CreateContext(templateFile FileMeta, outputFile string, types Tuples, others Pairs, appVersion string) map[string]interface{}

func Debug

func Debug(msg string, args ...interface{})

func Fail

func Fail(args ...interface{})

func FindTemplateArg

func FindTemplateArg(tpl string, args []string) (string, []string)

func Progress

func Progress(msg string, args ...interface{})

func SplitKeyValArgs

func SplitKeyValArgs(args []string) (Tuples, Pairs, []string)

Types

type FileMeta

type FileMeta struct {
	Path     string
	Name     string
	ModTime  time.Time
	Embedded string
}

func EmbeddedFileMeta

func EmbeddedFileMeta(path, name string, content string) FileMeta

func NewFileMeta

func NewFileMeta(includeEmpties bool, paths ...string) []FileMeta

func SingleFileMeta

func SingleFileMeta(path, name string) FileMeta

func YoungestFile

func YoungestFile(files ...FileMeta) FileMeta

func (FileMeta) Exists

func (file FileMeta) Exists() bool

func (FileMeta) Younger

func (file FileMeta) Younger(other FileMeta) FileMeta

type OS

type OS interface {
	Stat(name string) (os.FileInfo, error)
}

OS is a seam for testing

type Pair

type Pair struct {
	Key string
	Val RichString
}

func NewPair

func NewPair(a string) Pair

func (Pair) Valid

func (p Pair) Valid() bool

type Pairs

type Pairs []Pair

type RichString

type RichString string

func (RichString) DivideLastOr0

func (rs RichString) DivideLastOr0(c byte) (RichString, RichString)

func (RichString) DivideLastOr1

func (rs RichString) DivideLastOr1(c byte) (RichString, RichString)

func (RichString) FirstLower

func (rs RichString) FirstLower() RichString

FirstLower returns a copy of the string rs with the first letter mapped to lower case.

func (RichString) FirstUpper

func (rs RichString) FirstUpper() RichString

FirstUpper returns a copy of the string rs with the first letter mapped to upper case.

func (RichString) IndexByte

func (rs RichString) IndexByte(b byte) int

IndexByte returns the index of the first instance of c in rs, or -1 if c is not present in rs.

func (RichString) L

func (rs RichString) L() RichString

L is an alias for FirstLower

func (RichString) LastIndexByte

func (rs RichString) LastIndexByte(b byte) int

LastIndexByte returns the index of the last instance of c in rs, or -1 if c is not present in rs.

func (RichString) NoDots

func (rs RichString) NoDots() RichString

NoDots returns a copy of rs in which all dots have been removed.

func (RichString) RemoveBeforeLast

func (rs RichString) RemoveBeforeLast(c byte) RichString

RemoveBeforeLast finds the last occurrence of byte c and retains everything after it.

func (RichString) String

func (rs RichString) String() string

func (RichString) ToLower

func (rs RichString) ToLower() RichString

ToLower returns a copy of the string rs with all Unicode letters mapped to their lower case.

func (RichString) ToTitle

func (rs RichString) ToTitle() RichString

ToTitle returns a copy of the string rs with all Unicode letters mapped to their title case.

func (RichString) ToUpper

func (rs RichString) ToUpper() RichString

ToUpper returns a copy of the string rs with all Unicode letters mapped to their upper case.

func (RichString) U

func (rs RichString) U() RichString

U is an alias for FirstUpper.

type Strings

type Strings []RichString

func (Strings) Slice

func (ss Strings) Slice() []string

func (Strings) String

func (ss Strings) String() string

type Tuple

type Tuple struct {
	Key string
	Type
}

func NewTuple

func NewTuple(a string) Tuple

func (Tuple) Valid

func (t Tuple) Valid() bool

type Tuples

type Tuples []Tuple

func (Tuples) TValues

func (triples Tuples) TValues() []string

type Type

type Type struct {
	// contains filtered or unexported fields
}

func NewType

func NewType(s string) Type

func (Type) Amp

func (t Type) Amp() string

func (Type) Ident

func (t Type) Ident() RichString

func (Type) IsPtr

func (t Type) IsPtr() bool

func (Type) L

func (t Type) L() RichString

func (Type) Name

func (t Type) Name() string

func (Type) NonBlank

func (t Type) NonBlank() bool

func (Type) Star

func (t Type) Star() string

func (Type) String

func (t Type) String() string

func (Type) U

func (t Type) U() RichString

func (Type) Zero

func (t Type) Zero() string

Jump to

Keyboard shortcuts

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