types

package
v0.4.17 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Builtins

func Builtins() []string

Builtins return list of builtins

func Declarables added in v0.1.1

func Declarables() []string

Declarables return list of builtin declarables type except decX.Y, which should be handled separately

func IsBuiltin

func IsBuiltin(typeName string) bool

IsBuiltin checks if given name is builtin

func IsDecimal added in v0.1.1

func IsDecimal(typeName string) bool

IsDecimal check if this type name is one of decimals

func IsDeclarable added in v0.1.1

func IsDeclarable(typeName string) bool

IsDeclarable check if type name can be declared explicitly (dec32, dec64 and dec128 can't)

func IsNative added in v0.1.1

func IsNative(typeName string) bool

IsNative check if type name is native

func NeedCustomUnmarshaler added in v0.1.1

func NeedCustomUnmarshaler(typeName string) (ok bool, err error)

NeedCustomUnmarshaler checks if given typeName is a native type which needs custom unmarshaler, e.g. $int, $float64, etc

Types

type Bool added in v0.1.1

type Bool string

Bool represents field of type bool

func (Bool) GoName added in v0.1.1

func (i Bool) GoName() string

GoName returns Go's representation of this field's type

func (Bool) Name added in v0.1.1

func (i Bool) Name() string

Name returns field name

func (Bool) Register added in v0.1.1

func (i Bool) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Bool) TypeName added in v0.1.1

func (i Bool) TypeName() string

TypeName name of the type

type Dec128

type Dec128 string

Dec128 represents field of type dec128

func (Dec128) GoName added in v0.1.1

func (i Dec128) GoName() string

GoName returns Go's representation of this field's type

func (Dec128) Name

func (i Dec128) Name() string

Name returns field name

func (Dec128) Register

func (i Dec128) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Dec128) TypeName

func (i Dec128) TypeName() string

TypeName name of the type

type Dec32

type Dec32 string

Dec32 represents field of type dec32

func (Dec32) GoName added in v0.1.1

func (i Dec32) GoName() string

GoName returns Go's representation of this field's type

func (Dec32) Name

func (i Dec32) Name() string

Name returns field name

func (Dec32) Register

func (i Dec32) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Dec32) TypeName

func (i Dec32) TypeName() string

TypeName name of the type

type Dec64

type Dec64 string

Dec64 represents field of type dec64

func (Dec64) GoName added in v0.1.1

func (i Dec64) GoName() string

GoName returns Go's representation of this field's type

func (Dec64) Name

func (i Dec64) Name() string

Name returns field name

func (Dec64) Register

func (i Dec64) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Dec64) TypeName

func (i Dec64) TypeName() string

TypeName name of the type

type Field

type Field interface {
	Name() string
	TypeName() string
	Register(comment []string, registrator FieldRegistrator)
	GoName() string
}

Field represents a field of given type

func Builtin

func Builtin(fieldName, typeName string) Field

Builtin generates a field representation with given name and builtin type

type FieldCustom

type FieldCustom struct {
	FieldName string
	Type      TypeRegistration
}

FieldCustom represents a field of custom pre-registered type

func (FieldCustom) GoName added in v0.1.1

func (f FieldCustom) GoName() string

GoName name of registered type

func (FieldCustom) Name

func (f FieldCustom) Name() string

Name of a field with custom type

func (FieldCustom) Register

func (f FieldCustom) Register(comment []string, registrator FieldRegistrator)

Register registers custom type

func (FieldCustom) TypeName

func (f FieldCustom) TypeName() string

TypeName name of a custom type

type FieldRegistrator

type FieldRegistrator interface {
	AddInt(comment []string, name string)
	AddInt8(comment []string, name string)
	AddInt16(comment []string, name string)
	AddInt32(comment []string, name string)
	AddInt64(comment []string, name string)
	AddUint(comment []string, name string)
	AddUint8(comment []string, name string)
	AddUint16(comment []string, name string)
	AddUint32(comment []string, name string)
	AddUint64(comment []string, name string)
	AddDec128(comment []string, name string)
	AddFloat32(comment []string, name string)
	AddFloat64(comment []string, name string)
	AddString(comment []string, name string)
	AddStr(comment []string, name string)
	AddBool(comment []string, name string)
	AddCustomType(comment []string, name string, info TypeRegistration)
}

FieldRegistrator abstration for field of given type adder

type Float32

type Float32 string

Float32 represents field of type float32

func (Float32) GoName added in v0.1.1

func (i Float32) GoName() string

GoName returns Go's representation of this field's type

func (Float32) Name

func (i Float32) Name() string

Name returns field name

func (Float32) Register

func (i Float32) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Float32) TypeName

func (i Float32) TypeName() string

TypeName name of the type

type Float64

type Float64 string

Float64 represents field of type float64

func (Float64) GoName added in v0.1.1

func (i Float64) GoName() string

GoName returns Go's representation of this field's type

func (Float64) Name

func (i Float64) Name() string

Name returns field name

func (Float64) Register

func (i Float64) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Float64) TypeName

func (i Float64) TypeName() string

TypeName name of the type

type Hex

type Hex string

Hex represents field of type hex

func (Hex) GoName added in v0.1.1

func (i Hex) GoName() string

GoName returns Go's representation of this field's type

func (Hex) Name

func (i Hex) Name() string

Name returns field name

func (Hex) Register

func (i Hex) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Hex) TypeName

func (i Hex) TypeName() string

TypeName name of the type

type Hex16

type Hex16 string

Hex16 represents field of type hex16

func (Hex16) GoName added in v0.1.1

func (i Hex16) GoName() string

GoName returns Go's representation of this field's type

func (Hex16) Name

func (i Hex16) Name() string

Name returns field name

func (Hex16) Register

func (i Hex16) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Hex16) TypeName

func (i Hex16) TypeName() string

TypeName name of the type

type Hex32

type Hex32 string

Hex32 represents field of type hex32

func (Hex32) GoName added in v0.1.1

func (i Hex32) GoName() string

GoName returns Go's representation of this field's type

func (Hex32) Name

func (i Hex32) Name() string

Name returns field name

func (Hex32) Register

func (i Hex32) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Hex32) TypeName

func (i Hex32) TypeName() string

TypeName name of the type

type Hex64

type Hex64 string

Hex64 represents field of type hex64

func (Hex64) GoName added in v0.1.1

func (i Hex64) GoName() string

GoName returns Go's representation of this field's type

func (Hex64) Name

func (i Hex64) Name() string

Name returns field name

func (Hex64) Register

func (i Hex64) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Hex64) TypeName

func (i Hex64) TypeName() string

TypeName name of the type

type Hex8

type Hex8 string

Hex8 represents field of type hex8

func (Hex8) GoName added in v0.1.1

func (i Hex8) GoName() string

GoName returns Go's representation of this field's type

func (Hex8) Name

func (i Hex8) Name() string

Name returns field name

func (Hex8) Register

func (i Hex8) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Hex8) TypeName

func (i Hex8) TypeName() string

TypeName name of the type

type ImportedType

type ImportedType struct {
	Name       string
	ImportPath string
}

ImportedType imported type view

func (ImportedType) String

func (it ImportedType) String() string

type Int

type Int string

Int represents field of type int

func (Int) GoName added in v0.1.1

func (i Int) GoName() string

GoName returns Go's representation of this field's type

func (Int) Name

func (i Int) Name() string

Name returns field name

func (Int) Register

func (i Int) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Int) TypeName

func (i Int) TypeName() string

TypeName name of the type

type Int16

type Int16 string

Int16 represents field of type int16

func (Int16) GoName added in v0.1.1

func (i Int16) GoName() string

GoName returns Go's representation of this field's type

func (Int16) Name

func (i Int16) Name() string

Name returns field name

func (Int16) Register

func (i Int16) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Int16) TypeName

func (i Int16) TypeName() string

TypeName name of the type

type Int32

type Int32 string

Int32 represents field of type int32

func (Int32) GoName added in v0.1.1

func (i Int32) GoName() string

GoName returns Go's representation of this field's type

func (Int32) Name

func (i Int32) Name() string

Name returns field name

func (Int32) Register

func (i Int32) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Int32) TypeName

func (i Int32) TypeName() string

TypeName name of the type

type Int64

type Int64 string

Int64 represents field of type int64

func (Int64) GoName added in v0.1.1

func (i Int64) GoName() string

GoName returns Go's representation of this field's type

func (Int64) Name

func (i Int64) Name() string

Name returns field name

func (Int64) Register

func (i Int64) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Int64) TypeName

func (i Int64) TypeName() string

TypeName name of the type

type Int8

type Int8 string

Int8 represents field of type int8

func (Int8) GoName added in v0.1.1

func (i Int8) GoName() string

GoName returns Go's representation of this field's type

func (Int8) Name

func (i Int8) Name() string

Name returns field name

func (Int8) Register

func (i Int8) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Int8) TypeName

func (i Int8) TypeName() string

TypeName name of the type

type LocalType

type LocalType struct {
	Name string
}

LocalType local package type view

func (LocalType) String

func (t LocalType) String() string

type Oct

type Oct string

Oct represents field of type oct

func (Oct) GoName added in v0.1.1

func (i Oct) GoName() string

GoName returns Go's representation of this field's type

func (Oct) Name

func (i Oct) Name() string

Name returns field name

func (Oct) Register

func (i Oct) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Oct) TypeName

func (i Oct) TypeName() string

TypeName name of the type

type Oct16

type Oct16 string

Oct16 represents field of type oct16

func (Oct16) GoName added in v0.1.1

func (i Oct16) GoName() string

GoName returns Go's representation of this field's type

func (Oct16) Name

func (i Oct16) Name() string

Name returns field name

func (Oct16) Register

func (i Oct16) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Oct16) TypeName

func (i Oct16) TypeName() string

TypeName name of the type

type Oct32

type Oct32 string

Oct32 represents field of type oct32

func (Oct32) GoName added in v0.1.1

func (i Oct32) GoName() string

GoName returns Go's representation of this field's type

func (Oct32) Name

func (i Oct32) Name() string

Name returns field name

func (Oct32) Register

func (i Oct32) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Oct32) TypeName

func (i Oct32) TypeName() string

TypeName name of the type

type Oct64

type Oct64 string

Oct64 represents field of type oct64

func (Oct64) GoName added in v0.1.1

func (i Oct64) GoName() string

GoName returns Go's representation of this field's type

func (Oct64) Name

func (i Oct64) Name() string

Name returns field name

func (Oct64) Register

func (i Oct64) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Oct64) TypeName

func (i Oct64) TypeName() string

TypeName name of the type

type Oct8

type Oct8 string

Oct8 represents field of type oct8

func (Oct8) GoName added in v0.1.1

func (i Oct8) GoName() string

GoName returns Go's representation of this field's type

func (Oct8) Name

func (i Oct8) Name() string

Name returns field name

func (Oct8) Register

func (i Oct8) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Oct8) TypeName

func (i Oct8) TypeName() string

TypeName name of the type

type Source

type Source interface {
	Dump(w io.Writer) error
}

Source copy of srcobj.Source

type Str

type Str string

Str represents field of type str

func (Str) GoName added in v0.1.1

func (i Str) GoName() string

GoName returns Go's representation of this field's type

func (Str) Name

func (i Str) Name() string

Name returns field name

func (Str) Register

func (i Str) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Str) TypeName

func (i Str) TypeName() string

TypeName name of the type

type String

type String string

String represents field of type string

func (String) GoName added in v0.1.1

func (i String) GoName() string

GoName returns Go's representation of this field's type

func (String) Name

func (i String) Name() string

Name returns field name

func (String) Register

func (i String) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (String) TypeName

func (i String) TypeName() string

TypeName name of the type

type TypeRegistration

type TypeRegistration interface {
	String() string
	// contains filtered or unexported methods
}

TypeRegistration type registration view

type Uint

type Uint string

Uint represents field of type uint

func (Uint) GoName added in v0.1.1

func (i Uint) GoName() string

GoName returns Go's representation of this field's type

func (Uint) Name

func (i Uint) Name() string

Name returns field name

func (Uint) Register

func (i Uint) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Uint) TypeName

func (i Uint) TypeName() string

TypeName name of the type

type Uint16

type Uint16 string

Uint16 represents field of type uint16

func (Uint16) GoName added in v0.1.1

func (i Uint16) GoName() string

GoName returns Go's representation of this field's type

func (Uint16) Name

func (i Uint16) Name() string

Name returns field name

func (Uint16) Register

func (i Uint16) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Uint16) TypeName

func (i Uint16) TypeName() string

TypeName name of the type

type Uint32

type Uint32 string

Uint32 represents field of type uint32

func (Uint32) GoName added in v0.1.1

func (i Uint32) GoName() string

GoName returns Go's representation of this field's type

func (Uint32) Name

func (i Uint32) Name() string

Name returns field name

func (Uint32) Register

func (i Uint32) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Uint32) TypeName

func (i Uint32) TypeName() string

TypeName name of the type

type Uint64

type Uint64 string

Uint64 represents field of type uint64

func (Uint64) GoName added in v0.1.1

func (i Uint64) GoName() string

GoName returns Go's representation of this field's type

func (Uint64) Name

func (i Uint64) Name() string

Name returns field name

func (Uint64) Register

func (i Uint64) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Uint64) TypeName

func (i Uint64) TypeName() string

TypeName name of the type

type Uint8

type Uint8 string

Uint8 represents field of type uint8

func (Uint8) GoName added in v0.1.1

func (i Uint8) GoName() string

GoName returns Go's representation of this field's type

func (Uint8) Name

func (i Uint8) Name() string

Name returns field name

func (Uint8) Register

func (i Uint8) Register(comment []string, registrator FieldRegistrator)

Register registers a field

func (Uint8) TypeName

func (i Uint8) TypeName() string

TypeName name of the type

Directories

Path Synopsis
internal
gen-builtin command

Jump to

Keyboard shortcuts

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