Source File
tmap.go
Belonging Package
github.com/gotd/td/internal/tmap
// Package tmap provides type mapping facility that maps type id to type name.
package tmap
// Map is type mapping.
type Map struct {
types map[uint32]string
}
func ( *Map) ( map[uint32]string) {
for , := range {
.types[] =
}
}
// Get returns type string or blank.
func ( *Map) ( uint32) string {
if == nil || len(.types) == 0 {
return ""
}
return .types[]
}
// New creates new Map from mappings.
func ( ...map[uint32]string) *Map {
:= &Map{
types: map[uint32]string{},
}
for , := range {
.add()
}
return
}
The pages are generated with Golds v0.6.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |