Documentation
¶
Index ¶
Constants ¶
View Source
const ( ExampleInt = 1 ExampleFloat = 3.141516 ExampleString = "test" ExampleBool = true )
View Source
const ( // ExampleIntWithComment represents an integer with a comment line above it. ExampleIntWithComment = 2 // ExampleFloatWithComment represents a float with a comment line above it. ExampleFloatWithComment = 4.141516 // ExampleStringWithComment represents a string with a comment line above it. ExampleStringWithComment = "test2" // ExampleBoolWithComment represents a bool with a comment line above it. ExampleBoolWithComment = false )
View Source
const ( IotaExampleInt = iota IotaExampleFloat IotaExampleString IotaExampleBool )
View Source
const ( IotaExample = iota IotaExampleOne IotaExampleTwo )
Variables ¶
View Source
var AnySlice = []interface{}{ true, "test2", }
View Source
var BoolSlice = []bool{ true, false, }
View Source
var FloatSlice = []float32{
1.234,
2.345,
}
View Source
var IntIntMap = map[int]int{
0: 123,
1: 234,
}
View Source
var IntSlice = []int{
123,
234,
}
View Source
var IntStringMap = map[int]string{
0: "test",
1: "test1",
}
View Source
var StringAnyMap = map[string]interface{}{ "test a string": "test", "test a int": 123, "test a bool": false, }
View Source
var StringBoolMap = map[string]bool{ "godmt": true, "typex": false, }
View Source
var StringIntMap = map[string]int{
"test": 123,
"test1": 234,
}
View Source
var StringSlice = []string{
"test",
"test2",
}
View Source
var StringStringMap = map[string]string{
"test": "123",
"test2": "234",
}
Functions ¶
This section is empty.
Types ¶
type ComplicatedMaps ¶ added in v1.2.0
type ComplicatedMaps struct {
// StrangeMapOne is a complicated type
StrangeMapOne map[string]map[string]int `json:"strangeMapOne"`
// StrangeSliceOfMaps is also complicated type
StrangeSliceOfMaps []map[int]string `json:"strangeSliceOfMaps"`
SimpleMap map[string]int `json:"simpleMap"`
MapOfSlices map[string][]int `json:"tricky"`
Insane map[int][]map[string]int `json:"insane"`
}
ComplicatedMaps is a class that deserves a doc comment.
type EmbeddedType ¶ added in v1.1.0
type ExtendedScannedType ¶ added in v1.1.0
type ExtendedScannedType struct {
ScannedType
AnExtraField bool `json:"anExtraField"`
}
type InheritSlice ¶ added in v1.3.2
type InheritSlice struct {
Structs []ScannedStruct `json:"structs"`
PointerStructs *[]ScannedStruct `json:"pointerStructs"`
SliceOfPointers []*string `json:"sliceOfPointers"`
}
type ScanPointers ¶ added in v1.2.0
type ScanPointers struct {
// Doc deserves a comment
Doc *[]string `json:"doc" binding:"required" validation:"required"`
// Name also deserves a comment
Name *string `json:"name" binding:"required" validation:"required"`
Fields *bool `json:"fields" binding:"required" validation:"required"`
InternalType *int `xml:"internalType" binding:"required" validation:"required"`
Test *map[string]int `xml:"test"`
MapOfSlices *map[string][]int `json:"tricky"`
Insane *map[int][]map[string]int `json:"insane"`
MoreTest *[]map[string]int `xml:"moreTest"`
}
ScanPointers represents the details of a scanned struct.
type ScannedStruct ¶ added in v1.1.0
type ScannedStruct struct {
Doc []string `json:"doc" binding:"required" validation:"required"`
Name string `json:"name" binding:"required" validation:"required"`
Fields []bool `json:"fields_test" binding:"required" validation:"required"`
InternalType int `xml:"internal_type" binding:"required" validation:"required"`
}
ScannedStruct represents the details of a scanned struct.
type ScannedType ¶ added in v1.1.0
type ScannedType struct {
Name string `json:"name"`
Kind io.Closer `json:"kind"`
KindSlice []io.Closer `json:"kind_slice"`
Value interface{} `json:"value"`
Doc []string `json:"doc"`
InternalType int `uri:"internalType"`
Test string
}
ScannedType represents a basic entity to be translated. More specifically const and var items.
Click to show internal directories.
Click to hide internal directories.