field

package
v0.0.0-...-720af6a Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: MIT Imports: 2 Imported by: 2

Documentation

Overview

Package field details field types used by the Claw format.

Index

Constants

This section is empty.

Variables

ListTypes is a list of field types that represent a list.

NumberTypes is a list of field types that represent a number.

NumericListTypes is a list of field types that represent a number.

Functions

func GoType

func GoType(t Type) string

GoType will return the Go string representation of a type. So a FTListUint64 will return "[]uint64". If the type isn't based on a basic Go type, this will panic. So you can't do FTListStruct.

func IsList

func IsList(ft Type) bool

IsList determines if a Type represents a list of entries.

func TypeToString

func TypeToString(t Type) string

TypeToString returns the type as a string WITHOUT the leading "FT".

Types

type Type

type Type uint8

Type represents the type of data that is held in a byte field.

const (
	FTUnknown Type = 0  // Unknown
	FTBool    Type = 1  // bool
	FTInt8    Type = 2  // int8
	FTInt16   Type = 3  // int16
	FTInt32   Type = 4  // int32
	FTInt64   Type = 5  // int64
	FTUint8   Type = 6  // uint8
	FTUint16  Type = 7  // uint16
	FTUint32  Type = 8  // uint32
	FTUint64  Type = 9  // uint64
	FTFloat32 Type = 10 // float32
	FTFloat64 Type = 11 // float64
	FTString  Type = 12 // string
	FTBytes   Type = 13 // bytes
	FTStruct  Type = 14 // struct
	// Reserve 15 to 40
	FTListBools   Type = 41 // []bool
	FTListInt8    Type = 42 // []int8
	FTListInt16   Type = 43 // []int16
	FTListInt32   Type = 44 // []int32
	FTListInt64   Type = 45 // []int64
	FTListUint8   Type = 46 // []uint8
	FTListUint16  Type = 47 // []uint16
	FTListUint32  Type = 48 // []uint32
	FTListUint64  Type = 49 // []uint64
	FTListFloat32 Type = 50 // []float32
	FTListFloat64 Type = 51 // []float64
	FTListBytes   Type = 52 // []bytes
	FTListStrings Type = 53 // []string
	FTListStructs Type = 54 // []structs

)

func (Type) String

func (i Type) String() string

Jump to

Keyboard shortcuts

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