Documentation ¶
Index ¶
- func IsImmTmplAst(ts *ast.TypeSpec) (string, bool)
- type ImmType
- type ImmTypeAst
- type ImmTypeAstBasic
- type ImmTypeAstExtIntf
- type ImmTypeAstImplsIntf
- type ImmTypeAstMap
- type ImmTypeAstSlice
- type ImmTypeAstSpecial
- type ImmTypeAstStruct
- type ImmTypeMap
- type ImmTypeSlice
- type ImmTypeStruct
- type ImmTypeUnknown
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ImmType ¶
type ImmType interface {
// contains filtered or unexported methods
}
func IsImmType ¶
IsImmType determines whether the supplied type is an immutable type. In case a type is immutable, a value of type ImmTypeStruct, ImmTypeSlice or ImmTypeMap is returned. In case the type is immutable but neither of the aforementioned instances, ImmTypeUnknown is returned. If a type is not immutable then nil is returned
type ImmTypeAst ¶
type ImmTypeAst interface {
// contains filtered or unexported methods
}
func IsImmTypeAst ¶
func IsImmTypeAst(ts ast.Expr, imps []*ast.ImportSpec, pkg string) (ImmTypeAst, error)
IsImmTypeAst determines by syntax tree analysis alone whether the supplied ast.Expr represents an immutable type. In case a type is immutable, a value of type ImmTypeAstStruct, ImmTypeAstSlice or ImmTypeAstMap. In case the type is "implements" the full immutable "interface" but neither of the aforementioned instances, ImmTypeAstImplsInt is returned. For special types like time.Time, ImmTypeAstSpecial is returned. For basic types, ImmTypeAstBasic is returned. If a type is a reference to an interface type that extends immutable.Immutable then ImmTypeAstExtIntf is returned. If a type is not immutable then nil is returned. For now this is not thread safe....
type ImmTypeAstBasic ¶
type ImmTypeAstBasic struct{}
type ImmTypeAstExtIntf ¶
type ImmTypeAstExtIntf struct{}
type ImmTypeAstImplsIntf ¶
type ImmTypeAstImplsIntf struct{}
type ImmTypeAstSlice ¶
type ImmTypeAstSpecial ¶
type ImmTypeAstSpecial struct{}
type ImmTypeAstStruct ¶
type ImmTypeAstStruct struct{}
type ImmTypeSlice ¶
type ImmTypeStruct ¶
type ImmTypeStruct struct{}
type ImmTypeUnknown ¶
type ImmTypeUnknown struct{}