Documentation ¶
Index ¶
- Constants
- func Capitalize(s string) string
- func ExprTypeStr(expr ast.Expr) string
- func IsBaseType(typ string) bool
- func IsComparableSimpleType(typ string) bool
- func IsComparableType(expr ast.Expr) bool
- func IsExported(ident string) bool
- func IsLocalPath(path string) bool
- func IsSelectorExpr(expr string) bool
- func IsSortableType(typ string) bool
- func PkgNameFromPath(path string) string
- func SelectorExprString(se *ast.SelectorExpr) string
- func SplitSelectorExpr(expr string) (string, string)
- func ToExported(ident string) string
- func ToUnexported(ident string) string
- func ValidateIdentName(name string) bool
- type ArgEmptyValueError
- type ArgNotSingleValueError
- type ConflictingOptionError
- type DeriveComment
- type InvalidIdentError
- type NameWithPkg
- type NotExistedError
- type OnlySupportError
- type Str
- type Str2
- type StrOrderSet
- func NewAscendingStrOrderSet(capacity int) *StrOrderSet
- func NewAscendingStrOrderSetFromSlice(items []string) *StrOrderSet
- func NewDescendingStrOrderSet(capacity int) *StrOrderSet
- func NewDescendingStrOrderSetFromSlice(items []string) *StrOrderSet
- func NewStrOrderSet(capacity int, cmp func(i, j string) bool) *StrOrderSet
- func NewStrOrderSetFromSlice(items []string, cmp func(i, j string) bool) *StrOrderSet
- func (set *StrOrderSet) All(f func(string) bool) bool
- func (set *StrOrderSet) Any(f func(string) bool) bool
- func (set *StrOrderSet) Append(keys ...string)
- func (set *StrOrderSet) Clear()
- func (set *StrOrderSet) Clone() *StrOrderSet
- func (set *StrOrderSet) Contains(key string) bool
- func (set *StrOrderSet) ContainsAll(keys ...string) bool
- func (set *StrOrderSet) ContainsAny(keys ...string) bool
- func (set *StrOrderSet) CountBy(f func(string) bool) int
- func (set *StrOrderSet) Difference(another *StrOrderSet) *StrOrderSet
- func (set *StrOrderSet) DoUntil(f func(string) bool) int
- func (set *StrOrderSet) DoUntilError(f func(string) error) error
- func (set *StrOrderSet) DoWhile(f func(string) bool) int
- func (set *StrOrderSet) Equal(another *StrOrderSet) bool
- func (set *StrOrderSet) Filter(f func(string) bool) *StrOrderSet
- func (set *StrOrderSet) FilterMap(f interface{}) interface{}
- func (set *StrOrderSet) FindBy(f func(string) bool) *string
- func (set *StrOrderSet) FindLastBy(f func(string) bool) *string
- func (set *StrOrderSet) Fold(init string, f func(string, string) string) string
- func (set *StrOrderSet) ForEach(f func(string))
- func (set *StrOrderSet) ForEachWithIndex(f func(int, string))
- func (set *StrOrderSet) GroupBy(f func(string) interface{}) map[interface{}]*StrOrderSet
- func (set *StrOrderSet) GroupByBool(f func(string) bool) (trueGroup *StrOrderSet, falseGroup *StrOrderSet)
- func (set *StrOrderSet) GroupByInt(f func(string) int) map[int]*StrOrderSet
- func (set *StrOrderSet) GroupByStr(f func(string) string) map[string]*StrOrderSet
- func (set *StrOrderSet) InPlaceUnion(another *StrOrderSet)
- func (set *StrOrderSet) Intersect(another *StrOrderSet) *StrOrderSet
- func (set *StrOrderSet) IsEmpty() bool
- func (set *StrOrderSet) IsProperSubsetOf(another *StrOrderSet) bool
- func (set *StrOrderSet) IsProperSupersetOf(another *StrOrderSet) bool
- func (set *StrOrderSet) IsSubsetOf(another *StrOrderSet) bool
- func (set *StrOrderSet) IsSupersetOf(another *StrOrderSet) bool
- func (set *StrOrderSet) Len() int
- func (set *StrOrderSet) Map(f interface{}) interface{}
- func (set StrOrderSet) MarshalJSON() ([]byte, error)
- func (set *StrOrderSet) Reduce(f func(string, string) string) string
- func (set *StrOrderSet) Remove(key string)
- func (set *StrOrderSet) String() string
- func (set *StrOrderSet) ToSlice() []string
- func (set *StrOrderSet) ToSliceRef() []string
- func (set *StrOrderSet) Union(another *StrOrderSet) *StrOrderSet
- func (set *StrOrderSet) UnmarshalJSON(b []byte) error
- type StrSet
- func (set *StrSet) All(f func(string) bool) bool
- func (set *StrSet) Any(f func(string) bool) bool
- func (set *StrSet) Append(keys ...string)
- func (set *StrSet) Clear()
- func (set *StrSet) Clone() *StrSet
- func (set *StrSet) Contains(key string) bool
- func (set *StrSet) ContainsAll(keys ...string) bool
- func (set *StrSet) ContainsAny(keys ...string) bool
- func (set *StrSet) CountBy(f func(string) bool) int
- func (set *StrSet) Difference(another *StrSet) *StrSet
- func (set *StrSet) DoUntil(f func(string) bool) int
- func (set *StrSet) DoUntilError(f func(string) error) error
- func (set *StrSet) DoWhile(f func(string) bool) int
- func (set *StrSet) Equal(another *StrSet) bool
- func (set *StrSet) Filter(f func(string) bool) *StrSet
- func (set *StrSet) FilterMap(f interface{}) interface{}
- func (set *StrSet) FindBy(f func(string) bool) *string
- func (set *StrSet) FindLastBy(f func(string) bool) *string
- func (set *StrSet) Fold(init string, f func(string, string) string) string
- func (set *StrSet) ForEach(f func(string))
- func (set *StrSet) ForEachWithIndex(f func(int, string))
- func (set *StrSet) GroupBy(f func(string) interface{}) map[interface{}]*StrSet
- func (set *StrSet) GroupByBool(f func(string) bool) (trueGroup *StrSet, falseGroup *StrSet)
- func (set *StrSet) GroupByInt(f func(string) int) map[int]*StrSet
- func (set *StrSet) GroupByStr(f func(string) string) map[string]*StrSet
- func (set *StrSet) InPlaceUnion(another *StrSet)
- func (set *StrSet) Intersect(another *StrSet) *StrSet
- func (set *StrSet) IsEmpty() bool
- func (set *StrSet) IsProperSubsetOf(another *StrSet) bool
- func (set *StrSet) IsProperSupersetOf(another *StrSet) bool
- func (set *StrSet) IsSubsetOf(another *StrSet) bool
- func (set *StrSet) IsSupersetOf(another *StrSet) bool
- func (set *StrSet) Len() int
- func (set *StrSet) Map(f interface{}) interface{}
- func (set StrSet) MarshalJSON() ([]byte, error)
- func (set *StrSet) Reduce(f func(string, string) string) string
- func (set *StrSet) Remove(key string)
- func (set *StrSet) String() string
- func (set *StrSet) ToSlice() []string
- func (set *StrSet) ToSliceRef() []string
- func (set *StrSet) Union(another *StrSet) *StrSet
- func (set *StrSet) UnmarshalJSON(b []byte) error
- type TableWriter
- type TriBool
- type UnexpectedError
- type UnmatchedError
- type UnsupportedError
Constants ¶
View Source
const HeaderComment = "// Code generated by https://github.com/nextzhou/goderive. DO NOT EDIT.\n\n"
Variables ¶
This section is empty.
Functions ¶
func Capitalize ¶
func ExprTypeStr ¶
func IsBaseType ¶
func IsComparableSimpleType ¶
func IsComparableType ¶
check if operator == is defined on this type
func IsExported ¶
func IsLocalPath ¶
func IsSelectorExpr ¶
func IsSortableType ¶
func SelectorExprString ¶
func SelectorExprString(se *ast.SelectorExpr) string
func SplitSelectorExpr ¶
time.Time => (time, Time)
func ToExported ¶
func ToUnexported ¶
func ValidateIdentName ¶
Types ¶
type ArgEmptyValueError ¶
type ArgEmptyValueError struct {
ArgKey string
}
func (*ArgEmptyValueError) Error ¶
func (e *ArgEmptyValueError) Error() string
type ArgNotSingleValueError ¶
type ArgNotSingleValueError struct {
ArgKey string
}
func (*ArgNotSingleValueError) Error ¶
func (e *ArgNotSingleValueError) Error() string
type ConflictingOptionError ¶
func (*ConflictingOptionError) Error ¶
func (e *ConflictingOptionError) Error() string
type DeriveComment ¶
func MatchDeriveComment ¶
func MatchDeriveComment(cmt string) (*DeriveComment, error)
func MatchPluginComment ¶
func MatchPluginComment(cmt string) (*DeriveComment, error)
type InvalidIdentError ¶
func (*InvalidIdentError) Error ¶
func (e *InvalidIdentError) Error() string
type NameWithPkg ¶
func FuncTypeNameWithPkg ¶
func FuncTypeNameWithPkg(e ast.FuncType) *NameWithPkg
func NewNameWithPkg ¶
func NewNameWithPkg(name string) *NameWithPkg
func TypeNameWithPkg ¶
func TypeNameWithPkg(expr ast.Expr) *NameWithPkg
type NotExistedError ¶
func (*NotExistedError) Error ¶
func (e *NotExistedError) Error() string
type OnlySupportError ¶
func (*OnlySupportError) Error ¶
func (e *OnlySupportError) Error() string
type StrOrderSet ¶
type StrOrderSet struct {
// contains filtered or unexported fields
}
func NewAscendingStrOrderSet ¶
func NewAscendingStrOrderSet(capacity int) *StrOrderSet
func NewAscendingStrOrderSetFromSlice ¶
func NewAscendingStrOrderSetFromSlice(items []string) *StrOrderSet
func NewDescendingStrOrderSet ¶
func NewDescendingStrOrderSet(capacity int) *StrOrderSet
func NewDescendingStrOrderSetFromSlice ¶
func NewDescendingStrOrderSetFromSlice(items []string) *StrOrderSet
func NewStrOrderSet ¶
func NewStrOrderSet(capacity int, cmp func(i, j string) bool) *StrOrderSet
func NewStrOrderSetFromSlice ¶
func NewStrOrderSetFromSlice(items []string, cmp func(i, j string) bool) *StrOrderSet
func (*StrOrderSet) Append ¶
func (set *StrOrderSet) Append(keys ...string)
func (*StrOrderSet) Clear ¶
func (set *StrOrderSet) Clear()
func (*StrOrderSet) Clone ¶
func (set *StrOrderSet) Clone() *StrOrderSet
func (*StrOrderSet) Contains ¶
func (set *StrOrderSet) Contains(key string) bool
func (*StrOrderSet) ContainsAll ¶
func (set *StrOrderSet) ContainsAll(keys ...string) bool
func (*StrOrderSet) ContainsAny ¶
func (set *StrOrderSet) ContainsAny(keys ...string) bool
func (*StrOrderSet) Difference ¶
func (set *StrOrderSet) Difference(another *StrOrderSet) *StrOrderSet
func (*StrOrderSet) DoUntilError ¶
func (set *StrOrderSet) DoUntilError(f func(string) error) error
func (*StrOrderSet) Equal ¶
func (set *StrOrderSet) Equal(another *StrOrderSet) bool
func (*StrOrderSet) Filter ¶
func (set *StrOrderSet) Filter(f func(string) bool) *StrOrderSet
func (*StrOrderSet) FilterMap ¶
func (set *StrOrderSet) FilterMap(f interface{}) interface{}
f: func(string) *T
func(string) (T, bool) func(string) (T, error)
return: []T
func (*StrOrderSet) FindLastBy ¶
func (set *StrOrderSet) FindLastBy(f func(string) bool) *string
func (*StrOrderSet) ForEach ¶
func (set *StrOrderSet) ForEach(f func(string))
func (*StrOrderSet) ForEachWithIndex ¶
func (set *StrOrderSet) ForEachWithIndex(f func(int, string))
func (*StrOrderSet) GroupBy ¶
func (set *StrOrderSet) GroupBy(f func(string) interface{}) map[interface{}]*StrOrderSet
func (*StrOrderSet) GroupByBool ¶
func (set *StrOrderSet) GroupByBool(f func(string) bool) (trueGroup *StrOrderSet, falseGroup *StrOrderSet)
func (*StrOrderSet) GroupByInt ¶
func (set *StrOrderSet) GroupByInt(f func(string) int) map[int]*StrOrderSet
func (*StrOrderSet) GroupByStr ¶
func (set *StrOrderSet) GroupByStr(f func(string) string) map[string]*StrOrderSet
func (*StrOrderSet) InPlaceUnion ¶
func (set *StrOrderSet) InPlaceUnion(another *StrOrderSet)
func (*StrOrderSet) Intersect ¶
func (set *StrOrderSet) Intersect(another *StrOrderSet) *StrOrderSet
func (*StrOrderSet) IsEmpty ¶
func (set *StrOrderSet) IsEmpty() bool
func (*StrOrderSet) IsProperSubsetOf ¶
func (set *StrOrderSet) IsProperSubsetOf(another *StrOrderSet) bool
func (*StrOrderSet) IsProperSupersetOf ¶
func (set *StrOrderSet) IsProperSupersetOf(another *StrOrderSet) bool
func (*StrOrderSet) IsSubsetOf ¶
func (set *StrOrderSet) IsSubsetOf(another *StrOrderSet) bool
func (*StrOrderSet) IsSupersetOf ¶
func (set *StrOrderSet) IsSupersetOf(another *StrOrderSet) bool
func (*StrOrderSet) Len ¶
func (set *StrOrderSet) Len() int
func (*StrOrderSet) Map ¶
func (set *StrOrderSet) Map(f interface{}) interface{}
f: func(string) T return: []T
func (StrOrderSet) MarshalJSON ¶
func (set StrOrderSet) MarshalJSON() ([]byte, error)
func (*StrOrderSet) Remove ¶
func (set *StrOrderSet) Remove(key string)
func (*StrOrderSet) String ¶
func (set *StrOrderSet) String() string
func (*StrOrderSet) ToSlice ¶
func (set *StrOrderSet) ToSlice() []string
func (*StrOrderSet) ToSliceRef ¶
func (set *StrOrderSet) ToSliceRef() []string
NOTICE: efficient but unsafe
func (*StrOrderSet) Union ¶
func (set *StrOrderSet) Union(another *StrOrderSet) *StrOrderSet
func (*StrOrderSet) UnmarshalJSON ¶
func (set *StrOrderSet) UnmarshalJSON(b []byte) error
type StrSet ¶
type StrSet struct {
// contains filtered or unexported fields
}
func NewStrSetFromSlice ¶
func (*StrSet) ContainsAll ¶
func (*StrSet) ContainsAny ¶
func (*StrSet) Difference ¶
func (*StrSet) FilterMap ¶
func (set *StrSet) FilterMap(f interface{}) interface{}
f: func(string) *T
func(string) (T, bool) func(string) (T, error)
return: []T
func (*StrSet) ForEachWithIndex ¶
func (*StrSet) GroupByBool ¶
func (*StrSet) InPlaceUnion ¶
func (*StrSet) IsProperSubsetOf ¶
func (*StrSet) IsProperSupersetOf ¶
func (*StrSet) IsSubsetOf ¶
func (*StrSet) IsSupersetOf ¶
func (*StrSet) Map ¶
func (set *StrSet) Map(f interface{}) interface{}
f: func(string) T return: []T
func (StrSet) MarshalJSON ¶
func (*StrSet) UnmarshalJSON ¶
type TableWriter ¶
type TableWriter struct {
// contains filtered or unexported fields
}
func NewTableWriter ¶
func NewTableWriter(w io.Writer) *TableWriter
func (*TableWriter) Append ¶
func (tw *TableWriter) Append(row []string)
func (*TableWriter) Render ¶
func (tw *TableWriter) Render()
type UnexpectedError ¶
func (*UnexpectedError) Error ¶
func (e *UnexpectedError) Error() string
type UnmatchedError ¶
func (*UnmatchedError) Error ¶
func (e *UnmatchedError) Error() string
type UnsupportedError ¶
func (*UnsupportedError) Error ¶
func (e *UnsupportedError) Error() string
Click to show internal directories.
Click to hide internal directories.