Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDefaultApp ¶
CreateDefaultApp returns default flag configuration for bundled apps
func RunDefaultApp ¶
RunDefaultApp will automatically run the defaultly bundled application
Types ¶
type RawStructFieldType ¶
RawStructFieldType is returned by the RawFields as an array of key-value pairs (as map can't be indexed by full structure and reflect.StuctField is used without pointers across reflect)
func (*RawStructFieldType) Exported ¶
func (f *RawStructFieldType) Exported() bool
Exported returns true if the field is exported within the struct
type RunFunc ¶
type RunFunc func(StructSlice, *Writer, *packages.Package) error
RunFunc is a callback that will be called when the app bootstrap finishes
type Struct ¶
type Struct struct {
Ref interface{}
// OriginalPackage can be overridden by package copiers to set the original package path
// if the package has changed due to movement of the Ref
// This is mainly used by the CreateDefaultApp when it's copying the package over to the cache
OriginalPackage string
}
Struct is a wrapper for the runtime symbol Ref
func ReflectStruct ¶
func ReflectStruct(s interface{}) *Struct
ReflectStruct creates a mirror Struct that enables users to use mirror-enhanced reflections
func (*Struct) Fields ¶
Fields returns a map of Name:Type pairs which can be used directly when generating new code
func (*Struct) Name ¶
Name returns the name of an underlying type for a given reflection. Note that this does not return pointer type asterixes nor package names
func (*Struct) RawFields ¶
func (s *Struct) RawFields() []RawStructFieldType
RawFields returns all fields of a given reflection type
type StructSlice ¶
type StructSlice []*Struct
StructSlice is a slice of pointers to Struct, used to do multi-struct operations
func ReflectStructs ¶
func ReflectStructs(ss ...interface{}) StructSlice
ReflectStructs is a plural function for ReflectStruct
func (StructSlice) Each ¶
func (s StructSlice) Each(cb StructSliceEachFunc) StructSlice
Each loops over the StructSlice and calls the callback for each of its elements returning itself at the end
func (StructSlice) PkgPaths ¶
func (s StructSlice) PkgPaths() []string
PkgPath returns the import path for the current reflection
type StructSliceEachFunc ¶
type StructSliceEachFunc func(s *Struct)
StructSliceEachFunc is a type for Each method above StructSlice