Documentation ¶
Index ¶
- func CountRunes(input string, r rune) (result int)
- func DowncastSlice(ss []string) (result []interface{})
- func FirstDuplicate(input []string) (result string, ok bool)
- func MakeOneLine(s, repl string) (result string)
- func SliceContains(ss []string, findStr string) bool
- func SlicesAreEqual(a, b []interface{}) bool
- func StringValuesEqualAfterSort(a, b []string) bool
- func Truncate(s string, i int) string
- type BasicSet
- func (s *BasicSet) Add(value interface{})
- func (s *BasicSet) AddSliceValues(values []interface{})
- func (s *BasicSet) Contains(value interface{}) (result bool)
- func (s *BasicSet) IsEmpty() (result bool)
- func (s *BasicSet) Len() (result int)
- func (s *BasicSet) Remove(value interface{})
- func (s *BasicSet) StringValues() (result []string)
- func (s *BasicSet) Values() (result []interface{})
- type FileRange
- type Filter
- type LineRange
- func CodeContext(contents string, codeRange, contextRangeInput *LineRange, limit int) (before, after *LineRange)
- func CreateCodeContext(contents string, codeRange *LineRange, limit int) (result *LineRange)
- func FindLineRange(val, sub string) (result *LineRange)
- func NewLineRange(startIndex, endIndex int) (result *LineRange)
- func NewLineRangeFromFileRange(fileRange *FileRange, content string) (result *LineRange)
- func (r *LineRange) Equals(other *LineRange) bool
- func (r *LineRange) ExtractValue(input string) (result *LineRangeValue)
- func (r *LineRange) HasContent() bool
- func (r *LineRange) Len() int
- func (r *LineRange) NewValue(valueString string) (result *LineRangeValue)
- func (r *LineRange) Overlaps(other *LineRange) bool
- func (r *LineRange) Shifted(by int) (result *LineRange)
- type LineRangeValue
- type Named
- type Param
- func (p *Param) LeafField() (result reflect.Value)
- func (p *Param) LeafFieldValue() (result interface{})
- func (p *Param) LeafStructField() (result reflect.StructField)
- func (p *Param) PathName() (result string)
- func (p *Param) PathNamePieces() (result []string)
- func (p *Param) SetLeafFieldValueFromString(value interface{}) (err error)
- func (p *Param) String() (result string)
- type RegexpFilter
- func (f *RegexpFilter) CanProvideExactValues() bool
- func (f *RegexpFilter) ExactValues() Set
- func (f *RegexpFilter) FilterSet(items Set)
- func (f *RegexpFilter) Includes(value interface{}) bool
- func (f *RegexpFilter) IncludesAllOf(items Set) bool
- func (f *RegexpFilter) IncludesAnyOf(items Set) bool
- func (f *RegexpFilter) IncludesAnything() bool
- type RegexpSet
- func (r *RegexpSet) Add(i interface{})
- func (r *RegexpSet) AddSliceValues(values []interface{})
- func (r *RegexpSet) Contains(i interface{}) bool
- func (r *RegexpSet) FindStringSubmatchAny(input string) (result []string)
- func (r *RegexpSet) FindStringSubmatchIndex(line string) (result []int, re *regexp.Regexp)
- func (r *RegexpSet) FirstMatchingRe(input string) (result *regexp.Regexp)
- func (r *RegexpSet) IsEmpty() (result bool)
- func (r *RegexpSet) Len() int
- func (r *RegexpSet) MatchAny(input string) (result bool)
- func (r *RegexpSet) ReValues() (result []*regexp.Regexp)
- func (r *RegexpSet) Remove(item interface{})
- func (r *RegexpSet) Res() Set
- func (r *RegexpSet) StringValues() []string
- func (r *RegexpSet) Values() []interface{}
- type Set
- type SliceFilter
- func (i *SliceFilter) CanProvideExactValues() (result bool)
- func (i *SliceFilter) ExactValues() (result Set)
- func (i *SliceFilter) FilterSet(items Set)
- func (i *SliceFilter) Includes(value interface{}) bool
- func (i *SliceFilter) IncludesAllOf(items Set) bool
- func (i *SliceFilter) IncludesAnyOf(items Set) bool
- func (i *SliceFilter) IncludesAnything() bool
- type StructParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountRunes ¶
func DowncastSlice ¶
func DowncastSlice(ss []string) (result []interface{})
func FirstDuplicate ¶
func MakeOneLine ¶
func SliceContains ¶
func SlicesAreEqual ¶
func SlicesAreEqual(a, b []interface{}) bool
Types ¶
type BasicSet ¶
type BasicSet struct {
// contains filtered or unexported fields
}
func NewBasicSet ¶
func NewBasicSet(values []interface{}) (result *BasicSet)
func NewEmptyBasicSet ¶
func NewEmptyBasicSet() (result *BasicSet)
func (*BasicSet) AddSliceValues ¶
func (s *BasicSet) AddSliceValues(values []interface{})
func (*BasicSet) StringValues ¶
type FileRange ¶
func NewFileRange ¶
func (*FileRange) DoLinesOverlap ¶
type LineRange ¶
func CodeContext ¶
func CreateCodeContext ¶
func FindLineRange ¶
func NewLineRange ¶
func (*LineRange) ExtractValue ¶
func (r *LineRange) ExtractValue(input string) (result *LineRangeValue)
func (*LineRange) HasContent ¶
func (*LineRange) NewValue ¶
func (r *LineRange) NewValue(valueString string) (result *LineRangeValue)
type LineRangeValue ¶
type Param ¶
type Param struct {
// contains filtered or unexported fields
}
A param is a struct, and a field that exists on that struct, or on a nested struct.
Usage:
type (
base struct{ inner inner } inner struct{ innerer innerer } innerer struct{ foo int }
)
func main() { a := base{inner{innerer{foo: 1}}} fmt.Print(NewBasicParam(&a, &a.inner.innerer.foo).PathName()) // prints "inner.innerer.foo" fmt.Print(NewBasicParam(&a, &a.foo).PathName()) // prints "inner.innerer.foo" }
func NewBasicParam ¶
func NewBasicParam(structPtr, leafFieldPtr interface{}) (result *Param)
func (*Param) LeafField ¶
Returns a pointer to the field that was originally passed into the constructor
func (*Param) LeafFieldValue ¶
func (p *Param) LeafFieldValue() (result interface{})
func (*Param) LeafStructField ¶
func (p *Param) LeafStructField() (result reflect.StructField)
Returns the value of the field that was passed into the constructor
func (*Param) PathNamePieces ¶
func (*Param) SetLeafFieldValueFromString ¶
type RegexpFilter ¶
type RegexpFilter struct {
// contains filtered or unexported fields
}
func NewRegexpExcludeFilter ¶
func NewRegexpExcludeFilter(exclude []string) *RegexpFilter
func NewRegexpFilter ¶
func NewRegexpFilter(included, exclude *RegexpSet) *RegexpFilter
func NewRegexpIncludeFilter ¶
func NewRegexpIncludeFilter(include []string) *RegexpFilter
func NewStringRegexpFilter ¶
func NewStringRegexpFilter(include, exclude []string) *RegexpFilter
Create from string slices
func (*RegexpFilter) CanProvideExactValues ¶
func (f *RegexpFilter) CanProvideExactValues() bool
func (*RegexpFilter) ExactValues ¶
func (f *RegexpFilter) ExactValues() Set
func (*RegexpFilter) FilterSet ¶
func (f *RegexpFilter) FilterSet(items Set)
Returns only included items in a BasicSet object
func (*RegexpFilter) Includes ¶
func (f *RegexpFilter) Includes(value interface{}) bool
Returns true if an item is included
func (*RegexpFilter) IncludesAllOf ¶
func (f *RegexpFilter) IncludesAllOf(items Set) bool
func (*RegexpFilter) IncludesAnyOf ¶
func (f *RegexpFilter) IncludesAnyOf(items Set) bool
func (*RegexpFilter) IncludesAnything ¶
func (f *RegexpFilter) IncludesAnything() bool
Returns true if any string is included
type RegexpSet ¶
type RegexpSet struct {
// contains filtered or unexported fields
}
func NewRegexpSet ¶
func (*RegexpSet) AddSliceValues ¶
func (r *RegexpSet) AddSliceValues(values []interface{})
func (*RegexpSet) FindStringSubmatchAny ¶
func (*RegexpSet) FindStringSubmatchIndex ¶
func (*RegexpSet) FirstMatchingRe ¶
func (*RegexpSet) StringValues ¶
type SliceFilter ¶
type SliceFilter struct {
// contains filtered or unexported fields
}
func ExcludeFilter ¶
func ExcludeFilter(exclude []string) *SliceFilter
func IncludeFilter ¶
func IncludeFilter(include []string) *SliceFilter
func NewSliceFilter ¶
func NewSliceFilter(include, exclude Set) *SliceFilter
func StringFilter ¶
func StringFilter(include, exclude []string) *SliceFilter
Create from string slices
func (*SliceFilter) CanProvideExactValues ¶
func (i *SliceFilter) CanProvideExactValues() (result bool)
Returns true if an exact list of values that are included is available
func (*SliceFilter) ExactValues ¶
func (i *SliceFilter) ExactValues() (result Set)
Exact list of values that are included
func (*SliceFilter) FilterSet ¶
func (i *SliceFilter) FilterSet(items Set)
Returns only included items in a BasicSet object
func (*SliceFilter) Includes ¶
func (i *SliceFilter) Includes(value interface{}) bool
Returns true if an item is included
func (*SliceFilter) IncludesAllOf ¶
func (i *SliceFilter) IncludesAllOf(items Set) bool
Returns only included items in a BasicSet object
func (*SliceFilter) IncludesAnyOf ¶
func (i *SliceFilter) IncludesAnyOf(items Set) bool
func (*SliceFilter) IncludesAnything ¶
func (i *SliceFilter) IncludesAnything() bool
Returns true if any string is included
type StructParams ¶
type StructParams struct {
Params []*Param
}
func NewStructParams ¶
func NewStructParams(structPtr interface{}, tagName string, structFilter structFilterFunc) (result *StructParams)