typenative 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +2 -0
- package/CHANGELOG.md +201 -0
- package/CONTRIBUTION.md +1 -1
- package/bin/cli.js +1 -0
- package/bin/go/bridge.js +74 -14
- package/bin/go/convert.js +48 -0
- package/bin/go/metadata.js +13 -4
- package/bin/go/overrides.js +4 -6
- package/bin/go/stdlib.generated.js +2 -0
- package/bin/index.js +117 -0
- package/bin/main.js +1 -0
- package/bin/node/child_process.js +51 -3
- package/bin/node/cluster.js +41 -3
- package/bin/node/core.js +1 -1
- package/bin/node/crypto.js +205 -4
- package/bin/node/dgram.js +230 -6
- package/bin/node/dns.js +470 -7
- package/bin/node/errno_tables.js +445 -0
- package/bin/node/fs.js +21 -14
- package/bin/node/http.js +128 -30
- package/bin/node/http2.js +4 -1
- package/bin/node/module_v8.js +142 -0
- package/bin/node/net.js +9 -6
- package/bin/node/process.js +242 -0
- package/bin/node/readline.js +271 -0
- package/bin/node/registry.js +2 -1
- package/bin/node/sqlite.js +60 -12
- package/bin/node/stream.js +139 -7
- package/bin/node/test.js +311 -19
- package/bin/node/url.js +23 -5
- package/bin/node/util.js +18 -1
- package/bin/node/util_extra.js +6 -30
- package/bin/node/worker_threads.js +79 -19
- package/bin/transpiler.js +4019 -497
- package/bin/typecheck-node.js +1 -0
- package/bin/version.js +1 -1
- package/conformance.md +1025 -884
- package/examples/README.md +5 -5
- package/examples/json-server/README.md +31 -29
- package/examples/json-server/bench.mjs +130 -38
- package/package.json +1 -1
- package/types/typenative-go.d.ts +23 -0
- package/types/typenative-npm.d.ts +169 -5
- package/types/typenative.d.ts +185 -11
|
@@ -53,6 +53,7 @@ export const goStdlib = {
|
|
|
53
53
|
"debug/macho": "Pmacho\nFNewFatFile||r io.ReaderAt|*debug/macho.FatFile,error|false|\nFNewFile||r io.ReaderAt|*debug/macho.File,error|false|\nFOpen||name string|*debug/macho.File,error|false|\nFOpenFat||name string|*debug/macho.FatFile,error|false|\nTCpu|basic|uint32||true\nMCpu|GoString|false||string\nMCpu|String|false||string\nTDylib|struct|struct{debug/macho.LoadBytes; Name string; Time uint32; CurrentVersion uint32; CompatVersion uint32}||false\nfDylib|LoadBytes|debug/macho.LoadBytes\nfDylib|Name|string\nfDylib|Time|uint32\nfDylib|CurrentVersion|uint32\nfDylib|CompatVersion|uint32\nMDylib|Raw|false||[]byte\nTDylibCmd|struct|struct{Cmd debug/macho.LoadCmd; Len uint32; Name uint32; Time uint32; CurrentVersion uint32; CompatVersion uint32}||false\nfDylibCmd|Cmd|debug/macho.LoadCmd\nfDylibCmd|Len|uint32\nfDylibCmd|Name|uint32\nfDylibCmd|Time|uint32\nfDylibCmd|CurrentVersion|uint32\nfDylibCmd|CompatVersion|uint32\nTDysymtab|struct|struct{debug/macho.LoadBytes; debug/macho.DysymtabCmd; IndirectSyms []uint32}||false\nfDysymtab|LoadBytes|debug/macho.LoadBytes\nfDysymtab|DysymtabCmd|debug/macho.DysymtabCmd\nfDysymtab|IndirectSyms|[]uint32\nfDysymtab|Cmd|debug/macho.LoadCmd\nfDysymtab|Len|uint32\nfDysymtab|Ilocalsym|uint32\nfDysymtab|Nlocalsym|uint32\nfDysymtab|Iextdefsym|uint32\nfDysymtab|Nextdefsym|uint32\nfDysymtab|Iundefsym|uint32\nfDysymtab|Nundefsym|uint32\nfDysymtab|Tocoffset|uint32\nfDysymtab|Ntoc|uint32\nfDysymtab|Modtaboff|uint32\nfDysymtab|Nmodtab|uint32\nfDysymtab|Extrefsymoff|uint32\nfDysymtab|Nextrefsyms|uint32\nfDysymtab|Indirectsymoff|uint32\nfDysymtab|Nindirectsyms|uint32\nfDysymtab|Extreloff|uint32\nfDysymtab|Nextrel|uint32\nfDysymtab|Locreloff|uint32\nfDysymtab|Nlocrel|uint32\nMDysymtab|Raw|false||[]byte\nTDysymtabCmd|struct|struct{Cmd debug/macho.LoadCmd; Len uint32; Ilocalsym uint32; Nlocalsym uint32; Iextdefsym uint32; Nextdefsym uint32; Iundefsym uint32; Nundefsym uint32; Tocoffset uint32; Ntoc uint32; Modtaboff uint32; Nmodtab uint32; Extrefsymoff uint32; Nextrefsyms uint32; Indirectsymoff uint32; Nindirectsyms uint32; Extreloff uint32; Nextrel uint32; Locreloff uint32; Nlocrel uint32}||false\nfDysymtabCmd|Cmd|debug/macho.LoadCmd\nfDysymtabCmd|Len|uint32\nfDysymtabCmd|Ilocalsym|uint32\nfDysymtabCmd|Nlocalsym|uint32\nfDysymtabCmd|Iextdefsym|uint32\nfDysymtabCmd|Nextdefsym|uint32\nfDysymtabCmd|Iundefsym|uint32\nfDysymtabCmd|Nundefsym|uint32\nfDysymtabCmd|Tocoffset|uint32\nfDysymtabCmd|Ntoc|uint32\nfDysymtabCmd|Modtaboff|uint32\nfDysymtabCmd|Nmodtab|uint32\nfDysymtabCmd|Extrefsymoff|uint32\nfDysymtabCmd|Nextrefsyms|uint32\nfDysymtabCmd|Indirectsymoff|uint32\nfDysymtabCmd|Nindirectsyms|uint32\nfDysymtabCmd|Extreloff|uint32\nfDysymtabCmd|Nextrel|uint32\nfDysymtabCmd|Locreloff|uint32\nfDysymtabCmd|Nlocrel|uint32\nTFatArch|struct|struct{debug/macho.FatArchHeader; *debug/macho.File}||false\nfFatArch|FatArchHeader|debug/macho.FatArchHeader\nfFatArch|File|*debug/macho.File\nfFatArch|Cpu|debug/macho.Cpu\nfFatArch|SubCpu|uint32\nfFatArch|Offset|uint32\nfFatArch|Size|uint32\nfFatArch|Align|uint32\nfFatArch|FileHeader|debug/macho.FileHeader\nfFatArch|ByteOrder|encoding/binary.ByteOrder\nfFatArch|Loads|[]debug/macho.Load\nfFatArch|Sections|[]*debug/macho.Section\nfFatArch|Symtab|*debug/macho.Symtab\nfFatArch|Dysymtab|*debug/macho.Dysymtab\nMFatArch|Close|false||error\nMFatArch|DWARF|false||*debug/dwarf.Data,error\nMFatArch|ImportedLibraries|false||[]string,error\nMFatArch|ImportedSymbols|false||[]string,error\nMFatArch|Section|false|name string|*debug/macho.Section\nMFatArch|Segment|false|name string|*debug/macho.Segment\nTFatArchHeader|struct|struct{Cpu debug/macho.Cpu; SubCpu uint32; Offset uint32; Size uint32; Align uint32}||false\nfFatArchHeader|Cpu|debug/macho.Cpu\nfFatArchHeader|SubCpu|uint32\nfFatArchHeader|Offset|uint32\nfFatArchHeader|Size|uint32\nfFatArchHeader|Align|uint32\nTFatFile|struct|struct{Magic uint32; Arches []debug/macho.FatArch; closer io.Closer}||false\nfFatFile|Magic|uint32\nfFatFile|Arches|[]debug/macho.FatArch\nMFatFile|Close|true||error\nTFile|struct|struct{debug/macho.FileHeader; ByteOrder encoding/binary.ByteOrder; Loads []debug/macho.Load; Sections []*debug/macho.Section; Symtab *debug/macho.Symtab; Dysymtab *debug/macho.Dysymtab; closer io.Closer}||false\nfFile|FileHeader|debug/macho.FileHeader\nfFile|ByteOrder|encoding/binary.ByteOrder\nfFile|Loads|[]debug/macho.Load\nfFile|Sections|[]*debug/macho.Section\nfFile|Symtab|*debug/macho.Symtab\nfFile|Dysymtab|*debug/macho.Dysymtab\nfFile|Magic|uint32\nfFile|Cpu|debug/macho.Cpu\nfFile|SubCpu|uint32\nfFile|Type|debug/macho.Type\nfFile|Ncmd|uint32\nfFile|Cmdsz|uint32\nfFile|Flags|uint32\nMFile|Close|true||error\nMFile|DWARF|true||*debug/dwarf.Data,error\nMFile|ImportedLibraries|true||[]string,error\nMFile|ImportedSymbols|true||[]string,error\nMFile|Section|true|name string|*debug/macho.Section\nMFile|Segment|true|name string|*debug/macho.Segment\nTFileHeader|struct|struct{Magic uint32; Cpu debug/macho.Cpu; SubCpu uint32; Type debug/macho.Type; Ncmd uint32; Cmdsz uint32; Flags uint32}||false\nfFileHeader|Magic|uint32\nfFileHeader|Cpu|debug/macho.Cpu\nfFileHeader|SubCpu|uint32\nfFileHeader|Type|debug/macho.Type\nfFileHeader|Ncmd|uint32\nfFileHeader|Cmdsz|uint32\nfFileHeader|Flags|uint32\nTFormatError|struct|struct{off int64; msg string; val any}||false\nMFormatError|Error|true||string\nTLoad|interface|interface{Raw() []byte}||false\nMLoad|Raw|false||[]byte\nILoad|Raw||[]byte\nTLoadBytes|slice|[]byte||false\nMLoadBytes|Raw|false||[]byte\nTLoadCmd|basic|uint32||true\nMLoadCmd|GoString|false||string\nMLoadCmd|String|false||string\nTNlist32|struct|struct{Name uint32; Type uint8; Sect uint8; Desc uint16; Value uint32}||false\nfNlist32|Name|uint32\nfNlist32|Type|uint8\nfNlist32|Sect|uint8\nfNlist32|Desc|uint16\nfNlist32|Value|uint32\nTNlist64|struct|struct{Name uint32; Type uint8; Sect uint8; Desc uint16; Value uint64}||false\nfNlist64|Name|uint32\nfNlist64|Type|uint8\nfNlist64|Sect|uint8\nfNlist64|Desc|uint16\nfNlist64|Value|uint64\nTRegs386|struct|struct{AX uint32; BX uint32; CX uint32; DX uint32; DI uint32; SI uint32; BP uint32; SP uint32; SS uint32; FLAGS uint32; IP uint32; CS uint32; DS uint32; ES uint32; FS uint32; GS uint32}||false\nfRegs386|AX|uint32\nfRegs386|BX|uint32\nfRegs386|CX|uint32\nfRegs386|DX|uint32\nfRegs386|DI|uint32\nfRegs386|SI|uint32\nfRegs386|BP|uint32\nfRegs386|SP|uint32\nfRegs386|SS|uint32\nfRegs386|FLAGS|uint32\nfRegs386|IP|uint32\nfRegs386|CS|uint32\nfRegs386|DS|uint32\nfRegs386|ES|uint32\nfRegs386|FS|uint32\nfRegs386|GS|uint32\nTRegsAMD64|struct|struct{AX uint64; BX uint64; CX uint64; DX uint64; DI uint64; SI uint64; BP uint64; SP uint64; R8 uint64; R9 uint64; R10 uint64; R11 uint64; R12 uint64; R13 uint64; R14 uint64; R15 uint64; IP uint64; FLAGS uint64; CS uint64; FS uint64; GS uint64}||false\nfRegsAMD64|AX|uint64\nfRegsAMD64|BX|uint64\nfRegsAMD64|CX|uint64\nfRegsAMD64|DX|uint64\nfRegsAMD64|DI|uint64\nfRegsAMD64|SI|uint64\nfRegsAMD64|BP|uint64\nfRegsAMD64|SP|uint64\nfRegsAMD64|R8|uint64\nfRegsAMD64|R9|uint64\nfRegsAMD64|R10|uint64\nfRegsAMD64|R11|uint64\nfRegsAMD64|R12|uint64\nfRegsAMD64|R13|uint64\nfRegsAMD64|R14|uint64\nfRegsAMD64|R15|uint64\nfRegsAMD64|IP|uint64\nfRegsAMD64|FLAGS|uint64\nfRegsAMD64|CS|uint64\nfRegsAMD64|FS|uint64\nfRegsAMD64|GS|uint64\nTReloc|struct|struct{Addr uint32; Value uint32; Type uint8; Len uint8; Pcrel bool; Extern bool; Scattered bool}||false\nfReloc|Addr|uint32\nfReloc|Value|uint32\nfReloc|Type|uint8\nfReloc|Len|uint8\nfReloc|Pcrel|bool\nfReloc|Extern|bool\nfReloc|Scattered|bool\nTRelocTypeARM|basic|int||true\nMRelocTypeARM|GoString|false||string\nMRelocTypeARM|String|false||string\nTRelocTypeARM64|basic|int||true\nMRelocTypeARM64|GoString|false||string\nMRelocTypeARM64|String|false||string\nTRelocTypeGeneric|basic|int||true\nMRelocTypeGeneric|GoString|false||string\nMRelocTypeGeneric|String|false||string\nTRelocTypeX86_64|basic|int||true\nMRelocTypeX86_64|GoString|false||string\nMRelocTypeX86_64|String|false||string\nTRpath|struct|struct{debug/macho.LoadBytes; Path string}||false\nfRpath|LoadBytes|debug/macho.LoadBytes\nfRpath|Path|string\nMRpath|Raw|false||[]byte\nTRpathCmd|struct|struct{Cmd debug/macho.LoadCmd; Len uint32; Path uint32}||false\nfRpathCmd|Cmd|debug/macho.LoadCmd\nfRpathCmd|Len|uint32\nfRpathCmd|Path|uint32\nTSection|struct|struct{debug/macho.SectionHeader; Relocs []debug/macho.Reloc; io.ReaderAt; sr *io.SectionReader}||false\nfSection|SectionHeader|debug/macho.SectionHeader\nfSection|Relocs|[]debug/macho.Reloc\nfSection|ReaderAt|io.ReaderAt\nfSection|Name|string\nfSection|Seg|string\nfSection|Addr|uint64\nfSection|Size|uint64\nfSection|Offset|uint32\nfSection|Align|uint32\nfSection|Reloff|uint32\nfSection|Nreloc|uint32\nfSection|Flags|uint32\nMSection|Data|true||[]byte,error\nMSection|Open|true||io.ReadSeeker\nMSection|ReadAt|false|p []byte,off int64|int,error\nTSection32|struct|struct{Name [16]byte; Seg [16]byte; Addr uint32; Size uint32; Offset uint32; Align uint32; Reloff uint32; Nreloc uint32; Flags uint32; Reserve1 uint32; Reserve2 uint32}||false\nfSection32|Name|[16]byte\nfSection32|Seg|[16]byte\nfSection32|Addr|uint32\nfSection32|Size|uint32\nfSection32|Offset|uint32\nfSection32|Align|uint32\nfSection32|Reloff|uint32\nfSection32|Nreloc|uint32\nfSection32|Flags|uint32\nfSection32|Reserve1|uint32\nfSection32|Reserve2|uint32\nTSection64|struct|struct{Name [16]byte; Seg [16]byte; Addr uint64; Size uint64; Offset uint32; Align uint32; Reloff uint32; Nreloc uint32; Flags uint32; Reserve1 uint32; Reserve2 uint32; Reserve3 uint32}||false\nfSection64|Name|[16]byte\nfSection64|Seg|[16]byte\nfSection64|Addr|uint64\nfSection64|Size|uint64\nfSection64|Offset|uint32\nfSection64|Align|uint32\nfSection64|Reloff|uint32\nfSection64|Nreloc|uint32\nfSection64|Flags|uint32\nfSection64|Reserve1|uint32\nfSection64|Reserve2|uint32\nfSection64|Reserve3|uint32\nTSectionHeader|struct|struct{Name string; Seg string; Addr uint64; Size uint64; Offset uint32; Align uint32; Reloff uint32; Nreloc uint32; Flags uint32}||false\nfSectionHeader|Name|string\nfSectionHeader|Seg|string\nfSectionHeader|Addr|uint64\nfSectionHeader|Size|uint64\nfSectionHeader|Offset|uint32\nfSectionHeader|Align|uint32\nfSectionHeader|Reloff|uint32\nfSectionHeader|Nreloc|uint32\nfSectionHeader|Flags|uint32\nTSegment|struct|struct{debug/macho.LoadBytes; debug/macho.SegmentHeader; io.ReaderAt; sr *io.SectionReader}||false\nfSegment|LoadBytes|debug/macho.LoadBytes\nfSegment|SegmentHeader|debug/macho.SegmentHeader\nfSegment|ReaderAt|io.ReaderAt\nfSegment|Cmd|debug/macho.LoadCmd\nfSegment|Len|uint32\nfSegment|Name|string\nfSegment|Addr|uint64\nfSegment|Memsz|uint64\nfSegment|Offset|uint64\nfSegment|Filesz|uint64\nfSegment|Maxprot|uint32\nfSegment|Prot|uint32\nfSegment|Nsect|uint32\nfSegment|Flag|uint32\nMSegment|Data|true||[]byte,error\nMSegment|Open|true||io.ReadSeeker\nMSegment|Raw|false||[]byte\nMSegment|ReadAt|false|p []byte,off int64|int,error\nTSegment32|struct|struct{Cmd debug/macho.LoadCmd; Len uint32; Name [16]byte; Addr uint32; Memsz uint32; Offset uint32; Filesz uint32; Maxprot uint32; Prot uint32; Nsect uint32; Flag uint32}||false\nfSegment32|Cmd|debug/macho.LoadCmd\nfSegment32|Len|uint32\nfSegment32|Name|[16]byte\nfSegment32|Addr|uint32\nfSegment32|Memsz|uint32\nfSegment32|Offset|uint32\nfSegment32|Filesz|uint32\nfSegment32|Maxprot|uint32\nfSegment32|Prot|uint32\nfSegment32|Nsect|uint32\nfSegment32|Flag|uint32\nTSegment64|struct|struct{Cmd debug/macho.LoadCmd; Len uint32; Name [16]byte; Addr uint64; Memsz uint64; Offset uint64; Filesz uint64; Maxprot uint32; Prot uint32; Nsect uint32; Flag uint32}||false\nfSegment64|Cmd|debug/macho.LoadCmd\nfSegment64|Len|uint32\nfSegment64|Name|[16]byte\nfSegment64|Addr|uint64\nfSegment64|Memsz|uint64\nfSegment64|Offset|uint64\nfSegment64|Filesz|uint64\nfSegment64|Maxprot|uint32\nfSegment64|Prot|uint32\nfSegment64|Nsect|uint32\nfSegment64|Flag|uint32\nTSegmentHeader|struct|struct{Cmd debug/macho.LoadCmd; Len uint32; Name string; Addr uint64; Memsz uint64; Offset uint64; Filesz uint64; Maxprot uint32; Prot uint32; Nsect uint32; Flag uint32}||false\nfSegmentHeader|Cmd|debug/macho.LoadCmd\nfSegmentHeader|Len|uint32\nfSegmentHeader|Name|string\nfSegmentHeader|Addr|uint64\nfSegmentHeader|Memsz|uint64\nfSegmentHeader|Offset|uint64\nfSegmentHeader|Filesz|uint64\nfSegmentHeader|Maxprot|uint32\nfSegmentHeader|Prot|uint32\nfSegmentHeader|Nsect|uint32\nfSegmentHeader|Flag|uint32\nTSymbol|struct|struct{Name string; Type uint8; Sect uint8; Desc uint16; Value uint64}||false\nfSymbol|Name|string\nfSymbol|Type|uint8\nfSymbol|Sect|uint8\nfSymbol|Desc|uint16\nfSymbol|Value|uint64\nTSymtab|struct|struct{debug/macho.LoadBytes; debug/macho.SymtabCmd; Syms []debug/macho.Symbol}||false\nfSymtab|LoadBytes|debug/macho.LoadBytes\nfSymtab|SymtabCmd|debug/macho.SymtabCmd\nfSymtab|Syms|[]debug/macho.Symbol\nfSymtab|Cmd|debug/macho.LoadCmd\nfSymtab|Len|uint32\nfSymtab|Symoff|uint32\nfSymtab|Nsyms|uint32\nfSymtab|Stroff|uint32\nfSymtab|Strsize|uint32\nMSymtab|Raw|false||[]byte\nTSymtabCmd|struct|struct{Cmd debug/macho.LoadCmd; Len uint32; Symoff uint32; Nsyms uint32; Stroff uint32; Strsize uint32}||false\nfSymtabCmd|Cmd|debug/macho.LoadCmd\nfSymtabCmd|Len|uint32\nfSymtabCmd|Symoff|uint32\nfSymtabCmd|Nsyms|uint32\nfSymtabCmd|Stroff|uint32\nfSymtabCmd|Strsize|uint32\nTThread|struct|struct{Cmd debug/macho.LoadCmd; Len uint32; Type uint32; Data []uint32}||false\nfThread|Cmd|debug/macho.LoadCmd\nfThread|Len|uint32\nfThread|Type|uint32\nfThread|Data|[]uint32\nTType|basic|uint32||true\nMType|GoString|false||string\nMType|String|false||string\nCARM64_RELOC_ADDEND|typed|debug/macho.RelocTypeARM64\nCARM64_RELOC_BRANCH26|typed|debug/macho.RelocTypeARM64\nCARM64_RELOC_GOT_LOAD_PAGE21|typed|debug/macho.RelocTypeARM64\nCARM64_RELOC_GOT_LOAD_PAGEOFF12|typed|debug/macho.RelocTypeARM64\nCARM64_RELOC_PAGE21|typed|debug/macho.RelocTypeARM64\nCARM64_RELOC_PAGEOFF12|typed|debug/macho.RelocTypeARM64\nCARM64_RELOC_POINTER_TO_GOT|typed|debug/macho.RelocTypeARM64\nCARM64_RELOC_SUBTRACTOR|typed|debug/macho.RelocTypeARM64\nCARM64_RELOC_TLVP_LOAD_PAGE21|typed|debug/macho.RelocTypeARM64\nCARM64_RELOC_TLVP_LOAD_PAGEOFF12|typed|debug/macho.RelocTypeARM64\nCARM64_RELOC_UNSIGNED|typed|debug/macho.RelocTypeARM64\nCARM_RELOC_BR24|typed|debug/macho.RelocTypeARM\nCARM_RELOC_HALF|typed|debug/macho.RelocTypeARM\nCARM_RELOC_HALF_SECTDIFF|typed|debug/macho.RelocTypeARM\nCARM_RELOC_LOCAL_SECTDIFF|typed|debug/macho.RelocTypeARM\nCARM_RELOC_PAIR|typed|debug/macho.RelocTypeARM\nCARM_RELOC_PB_LA_PTR|typed|debug/macho.RelocTypeARM\nCARM_RELOC_SECTDIFF|typed|debug/macho.RelocTypeARM\nCARM_RELOC_VANILLA|typed|debug/macho.RelocTypeARM\nCARM_THUMB_32BIT_BRANCH|typed|debug/macho.RelocTypeARM\nCARM_THUMB_RELOC_BR22|typed|debug/macho.RelocTypeARM\nCCpu386|typed|debug/macho.Cpu\nCCpuAmd64|typed|debug/macho.Cpu\nCCpuArm|typed|debug/macho.Cpu\nCCpuArm64|typed|debug/macho.Cpu\nCCpuPpc|typed|debug/macho.Cpu\nCCpuPpc64|typed|debug/macho.Cpu\nCFlagAllModsBound|int|uint32\nCFlagAllowStackExecution|int|uint32\nCFlagAppExtensionSafe|int|uint32\nCFlagBindAtLoad|int|uint32\nCFlagBindsToWeak|int|uint32\nCFlagCanonical|int|uint32\nCFlagDeadStrippableDylib|int|uint32\nCFlagDyldLink|int|uint32\nCFlagForceFlat|int|uint32\nCFlagHasTLVDescriptors|int|uint32\nCFlagIncrLink|int|uint32\nCFlagLazyInit|int|uint32\nCFlagNoFixPrebinding|int|uint32\nCFlagNoHeapExecution|int|uint32\nCFlagNoMultiDefs|int|uint32\nCFlagNoReexportedDylibs|int|uint32\nCFlagNoUndefs|int|uint32\nCFlagPIE|int|uint32\nCFlagPrebindable|int|uint32\nCFlagPrebound|int|uint32\nCFlagRootSafe|int|uint32\nCFlagSetuidSafe|int|uint32\nCFlagSplitSegs|int|uint32\nCFlagSubsectionsViaSymbols|int|uint32\nCFlagTwoLevel|int|uint32\nCFlagWeakDefines|int|uint32\nCGENERIC_RELOC_LOCAL_SECTDIFF|typed|debug/macho.RelocTypeGeneric\nCGENERIC_RELOC_PAIR|typed|debug/macho.RelocTypeGeneric\nCGENERIC_RELOC_PB_LA_PTR|typed|debug/macho.RelocTypeGeneric\nCGENERIC_RELOC_SECTDIFF|typed|debug/macho.RelocTypeGeneric\nCGENERIC_RELOC_TLV|typed|debug/macho.RelocTypeGeneric\nCGENERIC_RELOC_VANILLA|typed|debug/macho.RelocTypeGeneric\nCLoadCmdDylib|typed|debug/macho.LoadCmd\nCLoadCmdDylinker|typed|debug/macho.LoadCmd\nCLoadCmdDysymtab|typed|debug/macho.LoadCmd\nCLoadCmdRpath|typed|debug/macho.LoadCmd\nCLoadCmdSegment|typed|debug/macho.LoadCmd\nCLoadCmdSegment64|typed|debug/macho.LoadCmd\nCLoadCmdSymtab|typed|debug/macho.LoadCmd\nCLoadCmdThread|typed|debug/macho.LoadCmd\nCLoadCmdUnixThread|typed|debug/macho.LoadCmd\nCMagic32|int|uint32\nCMagic64|int|uint32\nCMagicFat|int|uint32\nCTypeBundle|typed|debug/macho.Type\nCTypeDylib|typed|debug/macho.Type\nCTypeExec|typed|debug/macho.Type\nCTypeObj|typed|debug/macho.Type\nCX86_64_RELOC_BRANCH|typed|debug/macho.RelocTypeX86_64\nCX86_64_RELOC_GOT|typed|debug/macho.RelocTypeX86_64\nCX86_64_RELOC_GOT_LOAD|typed|debug/macho.RelocTypeX86_64\nCX86_64_RELOC_SIGNED|typed|debug/macho.RelocTypeX86_64\nCX86_64_RELOC_SIGNED_1|typed|debug/macho.RelocTypeX86_64\nCX86_64_RELOC_SIGNED_2|typed|debug/macho.RelocTypeX86_64\nCX86_64_RELOC_SIGNED_4|typed|debug/macho.RelocTypeX86_64\nCX86_64_RELOC_SUBTRACTOR|typed|debug/macho.RelocTypeX86_64\nCX86_64_RELOC_TLV|typed|debug/macho.RelocTypeX86_64\nCX86_64_RELOC_UNSIGNED|typed|debug/macho.RelocTypeX86_64\nVErrNotFat|*debug/macho.FormatError",
|
|
54
54
|
"debug/pe": "Ppe\nFNewFile||r io.ReaderAt|*debug/pe.File,error|false|\nFOpen||name string|*debug/pe.File,error|false|\nTCOFFSymbol|struct|struct{Name [8]uint8; Value uint32; SectionNumber int16; Type uint16; StorageClass uint8; NumberOfAuxSymbols uint8}||false\nfCOFFSymbol|Name|[8]uint8\nfCOFFSymbol|Value|uint32\nfCOFFSymbol|SectionNumber|int16\nfCOFFSymbol|Type|uint16\nfCOFFSymbol|StorageClass|uint8\nfCOFFSymbol|NumberOfAuxSymbols|uint8\nMCOFFSymbol|FullName|true|st debug/pe.StringTable|string,error\nTCOFFSymbolAuxFormat5|struct|struct{Size uint32; NumRelocs uint16; NumLineNumbers uint16; Checksum uint32; SecNum uint16; Selection uint8; _ [3]uint8}||false\nfCOFFSymbolAuxFormat5|Size|uint32\nfCOFFSymbolAuxFormat5|NumRelocs|uint16\nfCOFFSymbolAuxFormat5|NumLineNumbers|uint16\nfCOFFSymbolAuxFormat5|Checksum|uint32\nfCOFFSymbolAuxFormat5|SecNum|uint16\nfCOFFSymbolAuxFormat5|Selection|uint8\nTDataDirectory|struct|struct{VirtualAddress uint32; Size uint32}||false\nfDataDirectory|VirtualAddress|uint32\nfDataDirectory|Size|uint32\nTFile|struct|struct{debug/pe.FileHeader; OptionalHeader any; Sections []*debug/pe.Section; Symbols []*debug/pe.Symbol; COFFSymbols []debug/pe.COFFSymbol; StringTable debug/pe.StringTable; closer io.Closer}||false\nfFile|FileHeader|debug/pe.FileHeader\nfFile|OptionalHeader|any\nfFile|Sections|[]*debug/pe.Section\nfFile|Symbols|[]*debug/pe.Symbol\nfFile|COFFSymbols|[]debug/pe.COFFSymbol\nfFile|StringTable|debug/pe.StringTable\nfFile|Machine|uint16\nfFile|NumberOfSections|uint16\nfFile|TimeDateStamp|uint32\nfFile|PointerToSymbolTable|uint32\nfFile|NumberOfSymbols|uint32\nfFile|SizeOfOptionalHeader|uint16\nfFile|Characteristics|uint16\nMFile|COFFSymbolReadSectionDefAux|true|idx int|*debug/pe.COFFSymbolAuxFormat5,error\nMFile|Close|true||error\nMFile|DWARF|true||*debug/dwarf.Data,error\nMFile|ImportedLibraries|true||[]string,error\nMFile|ImportedSymbols|true||[]string,error\nMFile|Section|true|name string|*debug/pe.Section\nTFileHeader|struct|struct{Machine uint16; NumberOfSections uint16; TimeDateStamp uint32; PointerToSymbolTable uint32; NumberOfSymbols uint32; SizeOfOptionalHeader uint16; Characteristics uint16}||false\nfFileHeader|Machine|uint16\nfFileHeader|NumberOfSections|uint16\nfFileHeader|TimeDateStamp|uint32\nfFileHeader|PointerToSymbolTable|uint32\nfFileHeader|NumberOfSymbols|uint32\nfFileHeader|SizeOfOptionalHeader|uint16\nfFileHeader|Characteristics|uint16\nTFormatError|struct|struct{}||false\nMFormatError|Error|true||string\nTImportDirectory|struct|struct{OriginalFirstThunk uint32; TimeDateStamp uint32; ForwarderChain uint32; Name uint32; FirstThunk uint32; dll string}||false\nfImportDirectory|OriginalFirstThunk|uint32\nfImportDirectory|TimeDateStamp|uint32\nfImportDirectory|ForwarderChain|uint32\nfImportDirectory|Name|uint32\nfImportDirectory|FirstThunk|uint32\nTOptionalHeader32|struct|struct{Magic uint16; MajorLinkerVersion uint8; MinorLinkerVersion uint8; SizeOfCode uint32; SizeOfInitializedData uint32; SizeOfUninitializedData uint32; AddressOfEntryPoint uint32; BaseOfCode uint32; BaseOfData uint32; ImageBase uint32; SectionAlignment uint32; FileAlignment uint32; MajorOperatingSystemVersion uint16; MinorOperatingSystemVersion uint16; MajorImageVersion uint16; MinorImageVersion uint16; MajorSubsystemVersion uint16; MinorSubsystemVersion uint16; Win32VersionValue uint32; SizeOfImage uint32; SizeOfHeaders uint32; CheckSum uint32; Subsystem uint16; DllCharacteristics uint16; SizeOfStackReserve uint32; SizeOfStackCommit uint32; SizeOfHeapReserve uint32; SizeOfHeapCommit uint32; LoaderFlags uint32; NumberOfRvaAndSizes uint32; DataDirectory [16]debug/pe.DataDirectory}||false\nfOptionalHeader32|Magic|uint16\nfOptionalHeader32|MajorLinkerVersion|uint8\nfOptionalHeader32|MinorLinkerVersion|uint8\nfOptionalHeader32|SizeOfCode|uint32\nfOptionalHeader32|SizeOfInitializedData|uint32\nfOptionalHeader32|SizeOfUninitializedData|uint32\nfOptionalHeader32|AddressOfEntryPoint|uint32\nfOptionalHeader32|BaseOfCode|uint32\nfOptionalHeader32|BaseOfData|uint32\nfOptionalHeader32|ImageBase|uint32\nfOptionalHeader32|SectionAlignment|uint32\nfOptionalHeader32|FileAlignment|uint32\nfOptionalHeader32|MajorOperatingSystemVersion|uint16\nfOptionalHeader32|MinorOperatingSystemVersion|uint16\nfOptionalHeader32|MajorImageVersion|uint16\nfOptionalHeader32|MinorImageVersion|uint16\nfOptionalHeader32|MajorSubsystemVersion|uint16\nfOptionalHeader32|MinorSubsystemVersion|uint16\nfOptionalHeader32|Win32VersionValue|uint32\nfOptionalHeader32|SizeOfImage|uint32\nfOptionalHeader32|SizeOfHeaders|uint32\nfOptionalHeader32|CheckSum|uint32\nfOptionalHeader32|Subsystem|uint16\nfOptionalHeader32|DllCharacteristics|uint16\nfOptionalHeader32|SizeOfStackReserve|uint32\nfOptionalHeader32|SizeOfStackCommit|uint32\nfOptionalHeader32|SizeOfHeapReserve|uint32\nfOptionalHeader32|SizeOfHeapCommit|uint32\nfOptionalHeader32|LoaderFlags|uint32\nfOptionalHeader32|NumberOfRvaAndSizes|uint32\nfOptionalHeader32|DataDirectory|[16]debug/pe.DataDirectory\nTOptionalHeader64|struct|struct{Magic uint16; MajorLinkerVersion uint8; MinorLinkerVersion uint8; SizeOfCode uint32; SizeOfInitializedData uint32; SizeOfUninitializedData uint32; AddressOfEntryPoint uint32; BaseOfCode uint32; ImageBase uint64; SectionAlignment uint32; FileAlignment uint32; MajorOperatingSystemVersion uint16; MinorOperatingSystemVersion uint16; MajorImageVersion uint16; MinorImageVersion uint16; MajorSubsystemVersion uint16; MinorSubsystemVersion uint16; Win32VersionValue uint32; SizeOfImage uint32; SizeOfHeaders uint32; CheckSum uint32; Subsystem uint16; DllCharacteristics uint16; SizeOfStackReserve uint64; SizeOfStackCommit uint64; SizeOfHeapReserve uint64; SizeOfHeapCommit uint64; LoaderFlags uint32; NumberOfRvaAndSizes uint32; DataDirectory [16]debug/pe.DataDirectory}||false\nfOptionalHeader64|Magic|uint16\nfOptionalHeader64|MajorLinkerVersion|uint8\nfOptionalHeader64|MinorLinkerVersion|uint8\nfOptionalHeader64|SizeOfCode|uint32\nfOptionalHeader64|SizeOfInitializedData|uint32\nfOptionalHeader64|SizeOfUninitializedData|uint32\nfOptionalHeader64|AddressOfEntryPoint|uint32\nfOptionalHeader64|BaseOfCode|uint32\nfOptionalHeader64|ImageBase|uint64\nfOptionalHeader64|SectionAlignment|uint32\nfOptionalHeader64|FileAlignment|uint32\nfOptionalHeader64|MajorOperatingSystemVersion|uint16\nfOptionalHeader64|MinorOperatingSystemVersion|uint16\nfOptionalHeader64|MajorImageVersion|uint16\nfOptionalHeader64|MinorImageVersion|uint16\nfOptionalHeader64|MajorSubsystemVersion|uint16\nfOptionalHeader64|MinorSubsystemVersion|uint16\nfOptionalHeader64|Win32VersionValue|uint32\nfOptionalHeader64|SizeOfImage|uint32\nfOptionalHeader64|SizeOfHeaders|uint32\nfOptionalHeader64|CheckSum|uint32\nfOptionalHeader64|Subsystem|uint16\nfOptionalHeader64|DllCharacteristics|uint16\nfOptionalHeader64|SizeOfStackReserve|uint64\nfOptionalHeader64|SizeOfStackCommit|uint64\nfOptionalHeader64|SizeOfHeapReserve|uint64\nfOptionalHeader64|SizeOfHeapCommit|uint64\nfOptionalHeader64|LoaderFlags|uint32\nfOptionalHeader64|NumberOfRvaAndSizes|uint32\nfOptionalHeader64|DataDirectory|[16]debug/pe.DataDirectory\nTReloc|struct|struct{VirtualAddress uint32; SymbolTableIndex uint32; Type uint16}||false\nfReloc|VirtualAddress|uint32\nfReloc|SymbolTableIndex|uint32\nfReloc|Type|uint16\nTSection|struct|struct{debug/pe.SectionHeader; Relocs []debug/pe.Reloc; io.ReaderAt; sr *io.SectionReader}||false\nfSection|SectionHeader|debug/pe.SectionHeader\nfSection|Relocs|[]debug/pe.Reloc\nfSection|ReaderAt|io.ReaderAt\nfSection|Name|string\nfSection|VirtualSize|uint32\nfSection|VirtualAddress|uint32\nfSection|Size|uint32\nfSection|Offset|uint32\nfSection|PointerToRelocations|uint32\nfSection|PointerToLineNumbers|uint32\nfSection|NumberOfRelocations|uint16\nfSection|NumberOfLineNumbers|uint16\nfSection|Characteristics|uint32\nMSection|Data|true||[]byte,error\nMSection|Open|true||io.ReadSeeker\nMSection|ReadAt|false|p []byte,off int64|int,error\nTSectionHeader|struct|struct{Name string; VirtualSize uint32; VirtualAddress uint32; Size uint32; Offset uint32; PointerToRelocations uint32; PointerToLineNumbers uint32; NumberOfRelocations uint16; NumberOfLineNumbers uint16; Characteristics uint32}||false\nfSectionHeader|Name|string\nfSectionHeader|VirtualSize|uint32\nfSectionHeader|VirtualAddress|uint32\nfSectionHeader|Size|uint32\nfSectionHeader|Offset|uint32\nfSectionHeader|PointerToRelocations|uint32\nfSectionHeader|PointerToLineNumbers|uint32\nfSectionHeader|NumberOfRelocations|uint16\nfSectionHeader|NumberOfLineNumbers|uint16\nfSectionHeader|Characteristics|uint32\nTSectionHeader32|struct|struct{Name [8]uint8; VirtualSize uint32; VirtualAddress uint32; SizeOfRawData uint32; PointerToRawData uint32; PointerToRelocations uint32; PointerToLineNumbers uint32; NumberOfRelocations uint16; NumberOfLineNumbers uint16; Characteristics uint32}||false\nfSectionHeader32|Name|[8]uint8\nfSectionHeader32|VirtualSize|uint32\nfSectionHeader32|VirtualAddress|uint32\nfSectionHeader32|SizeOfRawData|uint32\nfSectionHeader32|PointerToRawData|uint32\nfSectionHeader32|PointerToRelocations|uint32\nfSectionHeader32|PointerToLineNumbers|uint32\nfSectionHeader32|NumberOfRelocations|uint16\nfSectionHeader32|NumberOfLineNumbers|uint16\nfSectionHeader32|Characteristics|uint32\nTStringTable|slice|[]byte||false\nMStringTable|String|false|start uint32|string,error\nTSymbol|struct|struct{Name string; Value uint32; SectionNumber int16; Type uint16; StorageClass uint8}||false\nfSymbol|Name|string\nfSymbol|Value|uint32\nfSymbol|SectionNumber|int16\nfSymbol|Type|uint16\nfSymbol|StorageClass|uint8\nCCOFFSymbolSize|int|untyped int\nCIMAGE_COMDAT_SELECT_ANY|int|untyped int\nCIMAGE_COMDAT_SELECT_ASSOCIATIVE|int|untyped int\nCIMAGE_COMDAT_SELECT_EXACT_MATCH|int|untyped int\nCIMAGE_COMDAT_SELECT_LARGEST|int|untyped int\nCIMAGE_COMDAT_SELECT_NODUPLICATES|int|untyped int\nCIMAGE_COMDAT_SELECT_SAME_SIZE|int|untyped int\nCIMAGE_DIRECTORY_ENTRY_ARCHITECTURE|int|untyped int\nCIMAGE_DIRECTORY_ENTRY_BASERELOC|int|untyped int\nCIMAGE_DIRECTORY_ENTRY_BOUND_IMPORT|int|untyped int\nCIMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR|int|untyped int\nCIMAGE_DIRECTORY_ENTRY_DEBUG|int|untyped int\nCIMAGE_DIRECTORY_ENTRY_DELAY_IMPORT|int|untyped int\nCIMAGE_DIRECTORY_ENTRY_EXCEPTION|int|untyped int\nCIMAGE_DIRECTORY_ENTRY_EXPORT|int|untyped int\nCIMAGE_DIRECTORY_ENTRY_GLOBALPTR|int|untyped int\nCIMAGE_DIRECTORY_ENTRY_IAT|int|untyped int\nCIMAGE_DIRECTORY_ENTRY_IMPORT|int|untyped int\nCIMAGE_DIRECTORY_ENTRY_LOAD_CONFIG|int|untyped int\nCIMAGE_DIRECTORY_ENTRY_RESOURCE|int|untyped int\nCIMAGE_DIRECTORY_ENTRY_SECURITY|int|untyped int\nCIMAGE_DIRECTORY_ENTRY_TLS|int|untyped int\nCIMAGE_DLLCHARACTERISTICS_APPCONTAINER|int|untyped int\nCIMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE|int|untyped int\nCIMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY|int|untyped int\nCIMAGE_DLLCHARACTERISTICS_GUARD_CF|int|untyped int\nCIMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA|int|untyped int\nCIMAGE_DLLCHARACTERISTICS_NO_BIND|int|untyped int\nCIMAGE_DLLCHARACTERISTICS_NO_ISOLATION|int|untyped int\nCIMAGE_DLLCHARACTERISTICS_NO_SEH|int|untyped int\nCIMAGE_DLLCHARACTERISTICS_NX_COMPAT|int|untyped int\nCIMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE|int|untyped int\nCIMAGE_DLLCHARACTERISTICS_WDM_DRIVER|int|untyped int\nCIMAGE_FILE_32BIT_MACHINE|int|untyped int\nCIMAGE_FILE_AGGRESIVE_WS_TRIM|int|untyped int\nCIMAGE_FILE_BYTES_REVERSED_HI|int|untyped int\nCIMAGE_FILE_BYTES_REVERSED_LO|int|untyped int\nCIMAGE_FILE_DEBUG_STRIPPED|int|untyped int\nCIMAGE_FILE_DLL|int|untyped int\nCIMAGE_FILE_EXECUTABLE_IMAGE|int|untyped int\nCIMAGE_FILE_LARGE_ADDRESS_AWARE|int|untyped int\nCIMAGE_FILE_LINE_NUMS_STRIPPED|int|untyped int\nCIMAGE_FILE_LOCAL_SYMS_STRIPPED|int|untyped int\nCIMAGE_FILE_MACHINE_AM33|int|untyped int\nCIMAGE_FILE_MACHINE_AMD64|int|untyped int\nCIMAGE_FILE_MACHINE_ARM|int|untyped int\nCIMAGE_FILE_MACHINE_ARM64|int|untyped int\nCIMAGE_FILE_MACHINE_ARMNT|int|untyped int\nCIMAGE_FILE_MACHINE_EBC|int|untyped int\nCIMAGE_FILE_MACHINE_I386|int|untyped int\nCIMAGE_FILE_MACHINE_IA64|int|untyped int\nCIMAGE_FILE_MACHINE_LOONGARCH32|int|untyped int\nCIMAGE_FILE_MACHINE_LOONGARCH64|int|untyped int\nCIMAGE_FILE_MACHINE_M32R|int|untyped int\nCIMAGE_FILE_MACHINE_MIPS16|int|untyped int\nCIMAGE_FILE_MACHINE_MIPSFPU|int|untyped int\nCIMAGE_FILE_MACHINE_MIPSFPU16|int|untyped int\nCIMAGE_FILE_MACHINE_POWERPC|int|untyped int\nCIMAGE_FILE_MACHINE_POWERPCFP|int|untyped int\nCIMAGE_FILE_MACHINE_R4000|int|untyped int\nCIMAGE_FILE_MACHINE_RISCV128|int|untyped int\nCIMAGE_FILE_MACHINE_RISCV32|int|untyped int\nCIMAGE_FILE_MACHINE_RISCV64|int|untyped int\nCIMAGE_FILE_MACHINE_SH3|int|untyped int\nCIMAGE_FILE_MACHINE_SH3DSP|int|untyped int\nCIMAGE_FILE_MACHINE_SH4|int|untyped int\nCIMAGE_FILE_MACHINE_SH5|int|untyped int\nCIMAGE_FILE_MACHINE_THUMB|int|untyped int\nCIMAGE_FILE_MACHINE_UNKNOWN|int|untyped int\nCIMAGE_FILE_MACHINE_WCEMIPSV2|int|untyped int\nCIMAGE_FILE_NET_RUN_FROM_SWAP|int|untyped int\nCIMAGE_FILE_RELOCS_STRIPPED|int|untyped int\nCIMAGE_FILE_REMOVABLE_RUN_FROM_SWAP|int|untyped int\nCIMAGE_FILE_SYSTEM|int|untyped int\nCIMAGE_FILE_UP_SYSTEM_ONLY|int|untyped int\nCIMAGE_SCN_CNT_CODE|int|untyped int\nCIMAGE_SCN_CNT_INITIALIZED_DATA|int|untyped int\nCIMAGE_SCN_CNT_UNINITIALIZED_DATA|int|untyped int\nCIMAGE_SCN_LNK_COMDAT|int|untyped int\nCIMAGE_SCN_MEM_DISCARDABLE|int|untyped int\nCIMAGE_SCN_MEM_EXECUTE|int|untyped int\nCIMAGE_SCN_MEM_READ|int|untyped int\nCIMAGE_SCN_MEM_WRITE|int|untyped int\nCIMAGE_SUBSYSTEM_EFI_APPLICATION|int|untyped int\nCIMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER|int|untyped int\nCIMAGE_SUBSYSTEM_EFI_ROM|int|untyped int\nCIMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER|int|untyped int\nCIMAGE_SUBSYSTEM_NATIVE|int|untyped int\nCIMAGE_SUBSYSTEM_NATIVE_WINDOWS|int|untyped int\nCIMAGE_SUBSYSTEM_OS2_CUI|int|untyped int\nCIMAGE_SUBSYSTEM_POSIX_CUI|int|untyped int\nCIMAGE_SUBSYSTEM_UNKNOWN|int|untyped int\nCIMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION|int|untyped int\nCIMAGE_SUBSYSTEM_WINDOWS_CE_GUI|int|untyped int\nCIMAGE_SUBSYSTEM_WINDOWS_CUI|int|untyped int\nCIMAGE_SUBSYSTEM_WINDOWS_GUI|int|untyped int\nCIMAGE_SUBSYSTEM_XBOX|int|untyped int",
|
|
55
55
|
"debug/plan9obj": "Pplan9obj\nFNewFile||r io.ReaderAt|*debug/plan9obj.File,error|false|\nFOpen||name string|*debug/plan9obj.File,error|false|\nTFile|struct|struct{debug/plan9obj.FileHeader; Sections []*debug/plan9obj.Section; closer io.Closer}||false\nfFile|FileHeader|debug/plan9obj.FileHeader\nfFile|Sections|[]*debug/plan9obj.Section\nfFile|Magic|uint32\nfFile|Bss|uint32\nfFile|Entry|uint64\nfFile|PtrSize|int\nfFile|LoadAddress|uint64\nfFile|HdrSize|uint64\nMFile|Close|true||error\nMFile|Section|true|name string|*debug/plan9obj.Section\nMFile|Symbols|true||[]debug/plan9obj.Sym,error\nTFileHeader|struct|struct{Magic uint32; Bss uint32; Entry uint64; PtrSize int; LoadAddress uint64; HdrSize uint64}||false\nfFileHeader|Magic|uint32\nfFileHeader|Bss|uint32\nfFileHeader|Entry|uint64\nfFileHeader|PtrSize|int\nfFileHeader|LoadAddress|uint64\nfFileHeader|HdrSize|uint64\nTSection|struct|struct{debug/plan9obj.SectionHeader; io.ReaderAt; sr *io.SectionReader}||false\nfSection|SectionHeader|debug/plan9obj.SectionHeader\nfSection|ReaderAt|io.ReaderAt\nfSection|Name|string\nfSection|Size|uint32\nfSection|Offset|uint32\nMSection|Data|true||[]byte,error\nMSection|Open|true||io.ReadSeeker\nMSection|ReadAt|false|p []byte,off int64|int,error\nTSectionHeader|struct|struct{Name string; Size uint32; Offset uint32}||false\nfSectionHeader|Name|string\nfSectionHeader|Size|uint32\nfSectionHeader|Offset|uint32\nTSym|struct|struct{Value uint64; Type rune; Name string}||false\nfSym|Value|uint64\nfSym|Type|rune\nfSym|Name|string\nCMagic386|int|untyped int\nCMagic64|int|untyped int\nCMagicAMD64|int|untyped int\nCMagicARM|int|untyped int\nVErrNoSymbols|error",
|
|
56
|
+
"embed": "Pembed\nTFS|struct|struct{files *[]embed.file}||false\nMFS|Open|false|name string|io/fs.File,error\nMFS|ReadDir|false|name string|[]io/fs.DirEntry,error\nMFS|ReadFile|false|name string|[]byte,error",
|
|
56
57
|
"encoding": "Pencoding\nTBinaryAppender|interface|interface{AppendBinary(b []byte) ([]byte, error)}||false\nMBinaryAppender|AppendBinary|false|b []byte|[]byte,error\nIBinaryAppender|AppendBinary|b []byte|[]byte,error\nTBinaryMarshaler|interface|interface{MarshalBinary() (data []byte, err error)}||false\nMBinaryMarshaler|MarshalBinary|false||[]byte,error\nIBinaryMarshaler|MarshalBinary||[]byte,error\nTBinaryUnmarshaler|interface|interface{UnmarshalBinary(data []byte) error}||false\nMBinaryUnmarshaler|UnmarshalBinary|false|data []byte|error\nIBinaryUnmarshaler|UnmarshalBinary|data []byte|error\nTTextAppender|interface|interface{AppendText(b []byte) ([]byte, error)}||false\nMTextAppender|AppendText|false|b []byte|[]byte,error\nITextAppender|AppendText|b []byte|[]byte,error\nTTextMarshaler|interface|interface{MarshalText() (text []byte, err error)}||false\nMTextMarshaler|MarshalText|false||[]byte,error\nITextMarshaler|MarshalText||[]byte,error\nTTextUnmarshaler|interface|interface{UnmarshalText(text []byte) error}||false\nMTextUnmarshaler|UnmarshalText|false|text []byte|error\nITextUnmarshaler|UnmarshalText|text []byte|error",
|
|
57
58
|
"encoding/ascii85": "Pascii85\nFDecode||dst []byte,src []byte,flush bool|int,int,error|false|\nFEncode||dst []byte,src []byte|int|false|\nFMaxEncodedLen||n int|int|false|\nFNewDecoder||r io.Reader|io.Reader|false|\nFNewEncoder||w io.Writer|io.WriteCloser|false|\nTCorruptInputError|basic|int64||true\nMCorruptInputError|Error|false||string",
|
|
58
59
|
"encoding/asn1": "Pasn1\nFMarshal||val any|[]byte,error|false|\nFMarshalWithParams||val any,params string|[]byte,error|false|\nFUnmarshal||b []byte,val any|[]byte,error|false|\nFUnmarshalWithParams||b []byte,val any,params string|[]byte,error|false|\nTBitString|struct|struct{Bytes []byte; BitLength int}||false\nfBitString|Bytes|[]byte\nfBitString|BitLength|int\nMBitString|At|false|i int|int\nMBitString|RightAlign|false||[]byte\nTEnumerated|basic|int||true\nTFlag|basic|bool||false\nTObjectIdentifier|slice|[]int||false\nMObjectIdentifier|Equal|false|other encoding/asn1.ObjectIdentifier|bool\nMObjectIdentifier|String|false||string\nTRawContent|slice|[]byte||false\nTRawValue|struct|struct{Class int; Tag int; IsCompound bool; Bytes []byte; FullBytes []byte}||false\nfRawValue|Class|int\nfRawValue|Tag|int\nfRawValue|IsCompound|bool\nfRawValue|Bytes|[]byte\nfRawValue|FullBytes|[]byte\nTStructuralError|struct|struct{Msg string}||false\nfStructuralError|Msg|string\nMStructuralError|Error|false||string\nTSyntaxError|struct|struct{Msg string}||false\nfSyntaxError|Msg|string\nMSyntaxError|Error|false||string\nCClassApplication|int|untyped int\nCClassContextSpecific|int|untyped int\nCClassPrivate|int|untyped int\nCClassUniversal|int|untyped int\nCTagBMPString|int|untyped int\nCTagBitString|int|untyped int\nCTagBoolean|int|untyped int\nCTagEnum|int|untyped int\nCTagGeneralString|int|untyped int\nCTagGeneralizedTime|int|untyped int\nCTagIA5String|int|untyped int\nCTagInteger|int|untyped int\nCTagNull|int|untyped int\nCTagNumericString|int|untyped int\nCTagOID|int|untyped int\nCTagOctetString|int|untyped int\nCTagPrintableString|int|untyped int\nCTagSequence|int|untyped int\nCTagSet|int|untyped int\nCTagT61String|int|untyped int\nCTagUTCTime|int|untyped int\nCTagUTF8String|int|untyped int\nVNullBytes|[]byte\nVNullRawValue|encoding/asn1.RawValue",
|
|
@@ -142,6 +143,7 @@ export const goStdlib = {
|
|
|
142
143
|
"regexp": "Pregexp\nFCompile||expr string|*regexp.Regexp,error|false|\nFCompilePOSIX||expr string|*regexp.Regexp,error|false|\nFMatch||pattern string,b []byte|bool,error|false|\nFMatchReader||pattern string,r io.RuneReader|bool,error|false|\nFMatchString||pattern string,s string|bool,error|false|\nFMustCompile||str string|*regexp.Regexp|false|\nFMustCompilePOSIX||str string|*regexp.Regexp|false|\nFQuoteMeta||s string|string|false|\nTRegexp|struct|struct{expr string; prog *regexp/syntax.Prog; onepass *regexp.onePassProg; numSubexp int; maxBitStateLen int; subexpNames []string; prefix string; prefixBytes []byte; prefixRune rune; prefixEnd uint32; mpool int; matchcap int; prefixComplete bool; cond regexp/syntax.EmptyOp; minInputLen int; longest bool}||false\nMRegexp|AppendText|true|b []byte|[]byte,error\nMRegexp|Copy|true||*regexp.Regexp\nMRegexp|Expand|true|dst []byte,template []byte,src []byte,match []int|[]byte\nMRegexp|ExpandString|true|dst []byte,template string,src string,match []int|[]byte\nMRegexp|Find|true|b []byte|[]byte\nMRegexp|FindAll|true|b []byte,n int|[][]byte\nMRegexp|FindAllIndex|true|b []byte,n int|[][]int\nMRegexp|FindAllString|true|s string,n int|[]string\nMRegexp|FindAllStringIndex|true|s string,n int|[][]int\nMRegexp|FindAllStringSubmatch|true|s string,n int|[][]string\nMRegexp|FindAllStringSubmatchIndex|true|s string,n int|[][]int\nMRegexp|FindAllSubmatch|true|b []byte,n int|[][][]byte\nMRegexp|FindAllSubmatchIndex|true|b []byte,n int|[][]int\nMRegexp|FindIndex|true|b []byte|[]int\nMRegexp|FindReaderIndex|true|r io.RuneReader|[]int\nMRegexp|FindReaderSubmatchIndex|true|r io.RuneReader|[]int\nMRegexp|FindString|true|s string|string\nMRegexp|FindStringIndex|true|s string|[]int\nMRegexp|FindStringSubmatch|true|s string|[]string\nMRegexp|FindStringSubmatchIndex|true|s string|[]int\nMRegexp|FindSubmatch|true|b []byte|[][]byte\nMRegexp|FindSubmatchIndex|true|b []byte|[]int\nMRegexp|LiteralPrefix|true||string,bool\nMRegexp|Longest|true||\nMRegexp|MarshalText|true||[]byte,error\nMRegexp|Match|true|b []byte|bool\nMRegexp|MatchReader|true|r io.RuneReader|bool\nMRegexp|MatchString|true|s string|bool\nMRegexp|NumSubexp|true||int\nMRegexp|ReplaceAll|true|src []byte,repl []byte|[]byte\nMRegexp|ReplaceAllFunc|true|src []byte,repl func([]byte) []byte|[]byte\nMRegexp|ReplaceAllLiteral|true|src []byte,repl []byte|[]byte\nMRegexp|ReplaceAllLiteralString|true|src string,repl string|string\nMRegexp|ReplaceAllString|true|src string,repl string|string\nMRegexp|ReplaceAllStringFunc|true|src string,repl func(string) string|string\nMRegexp|Split|true|s string,n int|[]string\nMRegexp|String|true||string\nMRegexp|SubexpIndex|true|name string|int\nMRegexp|SubexpNames|true||[]string\nMRegexp|UnmarshalText|true|text []byte|error",
|
|
143
144
|
"regexp/syntax": "Psyntax\nFCompile||re *regexp/syntax.Regexp|*regexp/syntax.Prog,error|false|\nFEmptyOpContext||r1 rune,r2 rune|regexp/syntax.EmptyOp|false|\nFIsWordChar||r rune|bool|false|\nFParse||s string,flags regexp/syntax.Flags|*regexp/syntax.Regexp,error|false|\nTEmptyOp|basic|uint8||true\nTError|struct|struct{Code regexp/syntax.ErrorCode; Expr string}||false\nfError|Code|regexp/syntax.ErrorCode\nfError|Expr|string\nMError|Error|true||string\nTErrorCode|basic|string||false\nMErrorCode|String|false||string\nTFlags|basic|uint16||true\nTInst|struct|struct{Op regexp/syntax.InstOp; Out uint32; Arg uint32; Rune []rune}||false\nfInst|Op|regexp/syntax.InstOp\nfInst|Out|uint32\nfInst|Arg|uint32\nfInst|Rune|[]rune\nMInst|MatchEmptyWidth|true|before rune,after rune|bool\nMInst|MatchRune|true|r rune|bool\nMInst|MatchRunePos|true|r rune|int\nMInst|String|true||string\nTInstOp|basic|uint8||true\nMInstOp|String|false||string\nTOp|basic|uint8||true\nMOp|String|false||string\nTProg|struct|struct{Inst []regexp/syntax.Inst; Start int; NumCap int}||false\nfProg|Inst|[]regexp/syntax.Inst\nfProg|Start|int\nfProg|NumCap|int\nMProg|Prefix|true||string,bool\nMProg|StartCond|true||regexp/syntax.EmptyOp\nMProg|String|true||string\nTRegexp|struct|struct{Op regexp/syntax.Op; Flags regexp/syntax.Flags; Sub []*regexp/syntax.Regexp; Sub0 [1]*regexp/syntax.Regexp; Rune []rune; Rune0 [2]rune; Min int; Max int; Cap int; Name string}||false\nfRegexp|Op|regexp/syntax.Op\nfRegexp|Flags|regexp/syntax.Flags\nfRegexp|Sub|[]*regexp/syntax.Regexp\nfRegexp|Sub0|[1]*regexp/syntax.Regexp\nfRegexp|Rune|[]rune\nfRegexp|Rune0|[2]rune\nfRegexp|Min|int\nfRegexp|Max|int\nfRegexp|Cap|int\nfRegexp|Name|string\nMRegexp|CapNames|true||[]string\nMRegexp|Equal|true|y *regexp/syntax.Regexp|bool\nMRegexp|MaxCap|true||int\nMRegexp|Simplify|true||*regexp/syntax.Regexp\nMRegexp|String|true||string\nCClassNL|typed|regexp/syntax.Flags\nCDotNL|typed|regexp/syntax.Flags\nCEmptyBeginLine|typed|regexp/syntax.EmptyOp\nCEmptyBeginText|typed|regexp/syntax.EmptyOp\nCEmptyEndLine|typed|regexp/syntax.EmptyOp\nCEmptyEndText|typed|regexp/syntax.EmptyOp\nCEmptyNoWordBoundary|typed|regexp/syntax.EmptyOp\nCEmptyWordBoundary|typed|regexp/syntax.EmptyOp\nCErrInternalError|typed|regexp/syntax.ErrorCode\nCErrInvalidCharClass|typed|regexp/syntax.ErrorCode\nCErrInvalidCharRange|typed|regexp/syntax.ErrorCode\nCErrInvalidEscape|typed|regexp/syntax.ErrorCode\nCErrInvalidNamedCapture|typed|regexp/syntax.ErrorCode\nCErrInvalidPerlOp|typed|regexp/syntax.ErrorCode\nCErrInvalidRepeatOp|typed|regexp/syntax.ErrorCode\nCErrInvalidRepeatSize|typed|regexp/syntax.ErrorCode\nCErrInvalidUTF8|typed|regexp/syntax.ErrorCode\nCErrLarge|typed|regexp/syntax.ErrorCode\nCErrMissingBracket|typed|regexp/syntax.ErrorCode\nCErrMissingParen|typed|regexp/syntax.ErrorCode\nCErrMissingRepeatArgument|typed|regexp/syntax.ErrorCode\nCErrNestingDepth|typed|regexp/syntax.ErrorCode\nCErrTrailingBackslash|typed|regexp/syntax.ErrorCode\nCErrUnexpectedParen|typed|regexp/syntax.ErrorCode\nCFoldCase|typed|regexp/syntax.Flags\nCInstAlt|typed|regexp/syntax.InstOp\nCInstAltMatch|typed|regexp/syntax.InstOp\nCInstCapture|typed|regexp/syntax.InstOp\nCInstEmptyWidth|typed|regexp/syntax.InstOp\nCInstFail|typed|regexp/syntax.InstOp\nCInstMatch|typed|regexp/syntax.InstOp\nCInstNop|typed|regexp/syntax.InstOp\nCInstRune|typed|regexp/syntax.InstOp\nCInstRune1|typed|regexp/syntax.InstOp\nCInstRuneAny|typed|regexp/syntax.InstOp\nCInstRuneAnyNotNL|typed|regexp/syntax.InstOp\nCLiteral|typed|regexp/syntax.Flags\nCMatchNL|typed|regexp/syntax.Flags\nCNonGreedy|typed|regexp/syntax.Flags\nCOneLine|typed|regexp/syntax.Flags\nCOpAlternate|typed|regexp/syntax.Op\nCOpAnyChar|typed|regexp/syntax.Op\nCOpAnyCharNotNL|typed|regexp/syntax.Op\nCOpBeginLine|typed|regexp/syntax.Op\nCOpBeginText|typed|regexp/syntax.Op\nCOpCapture|typed|regexp/syntax.Op\nCOpCharClass|typed|regexp/syntax.Op\nCOpConcat|typed|regexp/syntax.Op\nCOpEmptyMatch|typed|regexp/syntax.Op\nCOpEndLine|typed|regexp/syntax.Op\nCOpEndText|typed|regexp/syntax.Op\nCOpLiteral|typed|regexp/syntax.Op\nCOpNoMatch|typed|regexp/syntax.Op\nCOpNoWordBoundary|typed|regexp/syntax.Op\nCOpPlus|typed|regexp/syntax.Op\nCOpQuest|typed|regexp/syntax.Op\nCOpRepeat|typed|regexp/syntax.Op\nCOpStar|typed|regexp/syntax.Op\nCOpWordBoundary|typed|regexp/syntax.Op\nCPOSIX|typed|regexp/syntax.Flags\nCPerl|typed|regexp/syntax.Flags\nCPerlX|typed|regexp/syntax.Flags\nCSimple|typed|regexp/syntax.Flags\nCUnicodeGroups|typed|regexp/syntax.Flags\nCWasDollar|typed|regexp/syntax.Flags",
|
|
144
145
|
"runtime": "Pruntime\nFAddCleanup|T,S|ptr *T,cleanup func(S),arg S|runtime.Cleanup|false|;\nFBlockProfile||p []runtime.BlockProfileRecord|int,bool|false|\nFBreakpoint||||false|\nFCPUProfile|||[]byte|false|\nFCaller||skip int|uintptr,string,int,bool|false|\nFCallers||skip int,pc []uintptr|int|false|\nFCallersFrames||callers []uintptr|*runtime.Frames|false|\nFFuncForPC||pc uintptr|*runtime.Func|false|\nFGC||||false|\nFGOMAXPROCS||n int|int|false|\nFGOROOT|||string|false|\nFGoexit||||false|\nFGoroutineProfile||p []runtime.StackRecord|int,bool|false|\nFGosched||||false|\nFKeepAlive||x any||false|\nFLockOSThread||||false|\nFMemProfile||p []runtime.MemProfileRecord,inuseZero bool|int,bool|false|\nFMutexProfile||p []runtime.BlockProfileRecord|int,bool|false|\nFNumCPU|||int|false|\nFNumCgoCall|||int64|false|\nFNumGoroutine|||int|false|\nFReadMemStats||m *runtime.MemStats||false|\nFReadTrace|||[]byte|false|\nFSetBlockProfileRate||rate int||false|\nFSetCPUProfileRate||hz int||false|\nFSetCgoTraceback||version int,traceback unsafe.Pointer,context unsafe.Pointer,symbolizer unsafe.Pointer||false|\nFSetDefaultGOMAXPROCS||||false|\nFSetFinalizer||obj any,finalizer any||false|\nFSetMutexProfileFraction||rate int|int|false|\nFStack||buf []byte,all bool|int|false|\nFStartTrace|||error|false|\nFStopTrace||||false|\nFThreadCreateProfile||p []runtime.StackRecord|int,bool|false|\nFUnlockOSThread||||false|\nFVersion|||string|false|\nTBlockProfileRecord|struct|struct{Count int64; Cycles int64; runtime.StackRecord}||false\nfBlockProfileRecord|Count|int64\nfBlockProfileRecord|Cycles|int64\nfBlockProfileRecord|StackRecord|runtime.StackRecord\nfBlockProfileRecord|Stack0|[32]uintptr\nMBlockProfileRecord|Stack|true||[]uintptr\nTCleanup|struct|struct{id uint64; ptr uintptr}||false\nMCleanup|Stop|false||\nTError|interface|interface{RuntimeError(); error}||false\nMError|Error|false||string\nMError|RuntimeError|false||\nIError|Error||string\nIError|RuntimeError||\nTFrame|struct|struct{PC uintptr; Func *runtime.Func; Function string; File string; Line int; startLine int; Entry uintptr; funcInfo runtime.funcInfo}||false\nfFrame|PC|uintptr\nfFrame|Func|*runtime.Func\nfFrame|Function|string\nfFrame|File|string\nfFrame|Line|int\nfFrame|Entry|uintptr\nTFrames|struct|struct{callers []uintptr; nextPC uintptr; frames []runtime.Frame; frameStore [2]runtime.Frame}||false\nMFrames|Next|true||runtime.Frame,bool\nTFunc|struct|struct{opaque struct{}}||false\nMFunc|Entry|true||uintptr\nMFunc|FileLine|true|pc uintptr|string,int\nMFunc|Name|true||string\nTMemProfileRecord|struct|struct{AllocBytes int64; FreeBytes int64; AllocObjects int64; FreeObjects int64; Stack0 [32]uintptr}||false\nfMemProfileRecord|AllocBytes|int64\nfMemProfileRecord|FreeBytes|int64\nfMemProfileRecord|AllocObjects|int64\nfMemProfileRecord|FreeObjects|int64\nfMemProfileRecord|Stack0|[32]uintptr\nMMemProfileRecord|InUseBytes|true||int64\nMMemProfileRecord|InUseObjects|true||int64\nMMemProfileRecord|Stack|true||[]uintptr\nTMemStats|struct|struct{Alloc uint64; TotalAlloc uint64; Sys uint64; Lookups uint64; Mallocs uint64; Frees uint64; HeapAlloc uint64; HeapSys uint64; HeapIdle uint64; HeapInuse uint64; HeapReleased uint64; HeapObjects uint64; StackInuse uint64; StackSys uint64; MSpanInuse uint64; MSpanSys uint64; MCacheInuse uint64; MCacheSys uint64; BuckHashSys uint64; GCSys uint64; OtherSys uint64; NextGC uint64; LastGC uint64; PauseTotalNs uint64; PauseNs [256]uint64; PauseEnd [256]uint64; NumGC uint32; NumForcedGC uint32; GCCPUFraction float64; EnableGC bool; DebugGC bool; BySize [61]struct{Size uint32; Mallocs uint64; Frees uint64}}||false\nfMemStats|Alloc|uint64\nfMemStats|TotalAlloc|uint64\nfMemStats|Sys|uint64\nfMemStats|Lookups|uint64\nfMemStats|Mallocs|uint64\nfMemStats|Frees|uint64\nfMemStats|HeapAlloc|uint64\nfMemStats|HeapSys|uint64\nfMemStats|HeapIdle|uint64\nfMemStats|HeapInuse|uint64\nfMemStats|HeapReleased|uint64\nfMemStats|HeapObjects|uint64\nfMemStats|StackInuse|uint64\nfMemStats|StackSys|uint64\nfMemStats|MSpanInuse|uint64\nfMemStats|MSpanSys|uint64\nfMemStats|MCacheInuse|uint64\nfMemStats|MCacheSys|uint64\nfMemStats|BuckHashSys|uint64\nfMemStats|GCSys|uint64\nfMemStats|OtherSys|uint64\nfMemStats|NextGC|uint64\nfMemStats|LastGC|uint64\nfMemStats|PauseTotalNs|uint64\nfMemStats|PauseNs|[256]uint64\nfMemStats|PauseEnd|[256]uint64\nfMemStats|NumGC|uint32\nfMemStats|NumForcedGC|uint32\nfMemStats|GCCPUFraction|float64\nfMemStats|EnableGC|bool\nfMemStats|DebugGC|bool\nfMemStats|BySize|[61]struct{Size uint32; Mallocs uint64; Frees uint64}\nTPanicNilError|struct|struct{_ [0]*runtime.PanicNilError}||false\nMPanicNilError|Error|true||string\nMPanicNilError|RuntimeError|true||\nTPinner|struct|struct{*runtime.pinner}||false\nMPinner|Pin|true|pointer any|\nMPinner|Unpin|true||\nTStackRecord|struct|struct{Stack0 [32]uintptr}||false\nfStackRecord|Stack0|[32]uintptr\nMStackRecord|Stack|true||[]uintptr\nTTypeAssertionError|struct|struct{_interface *runtime._type; concrete *runtime._type; asserted *runtime._type; missingMethod string}||false\nMTypeAssertionError|Error|true||string\nMTypeAssertionError|RuntimeError|true||\nCCompiler|string|untyped string\nCGOARCH|string|string\nCGOOS|string|string\nVMemProfileRate|int",
|
|
146
|
+
"runtime/coverage": "Pcoverage\nFClearCounters|||error|false|\nFWriteCounters||w io.Writer|error|false|\nFWriteCountersDir||dir string|error|false|\nFWriteMeta||w io.Writer|error|false|\nFWriteMetaDir||dir string|error|false|",
|
|
145
147
|
"runtime/debug": "Pdebug\nFFreeOSMemory||||false|\nFParseBuildInfo||data string|*runtime/debug.BuildInfo,error|false|\nFPrintStack||||false|\nFReadBuildInfo|||*runtime/debug.BuildInfo,bool|false|\nFReadGCStats||stats *runtime/debug.GCStats||false|\nFSetCrashOutput||f *os.File,opts runtime/debug.CrashOptions|error|false|\nFSetGCPercent||percent int|int|false|\nFSetMaxStack||bytes int|int|false|\nFSetMaxThreads||threads int|int|false|\nFSetMemoryLimit||limit int64|int64|false|\nFSetPanicOnFault||enabled bool|bool|false|\nFSetTraceback||level string||false|\nFStack|||[]byte|false|\nFWriteHeapDump||fd uintptr||false|\nTBuildInfo|struct|struct{GoVersion string \"json:\\\\\",omitempty\\\\\"\"; Path string \"json:\\\\\",omitempty\\\\\"\"; Main runtime/debug.Module \"json:\\\\\"\\\\\"\"; Deps []*runtime/debug.Module \"json:\\\\\",omitempty\\\\\"\"; Settings []runtime/debug.BuildSetting \"json:\\\\\",omitempty\\\\\"\"}||false\nfBuildInfo|GoVersion|string\nfBuildInfo|Path|string\nfBuildInfo|Main|runtime/debug.Module\nfBuildInfo|Deps|[]*runtime/debug.Module\nfBuildInfo|Settings|[]runtime/debug.BuildSetting\nMBuildInfo|String|true||string\nTBuildSetting|struct|struct{Key string \"json:\\\\\",omitempty\\\\\"\"; Value string \"json:\\\\\",omitempty\\\\\"\"}||false\nfBuildSetting|Key|string\nfBuildSetting|Value|string\nTCrashOptions|struct|struct{}||false\nTGCStats|struct|struct{LastGC time.Time; NumGC int64; PauseTotal time.Duration; Pause []time.Duration; PauseEnd []time.Time; PauseQuantiles []time.Duration}||false\nfGCStats|LastGC|time.Time\nfGCStats|NumGC|int64\nfGCStats|PauseTotal|time.Duration\nfGCStats|Pause|[]time.Duration\nfGCStats|PauseEnd|[]time.Time\nfGCStats|PauseQuantiles|[]time.Duration\nTModule|struct|struct{Path string \"json:\\\\\",omitempty\\\\\"\"; Version string \"json:\\\\\",omitempty\\\\\"\"; Sum string \"json:\\\\\",omitempty\\\\\"\"; Replace *runtime/debug.Module \"json:\\\\\",omitempty\\\\\"\"}||false\nfModule|Path|string\nfModule|Version|string\nfModule|Sum|string\nfModule|Replace|*runtime/debug.Module",
|
|
146
148
|
"runtime/metrics": "Pmetrics\nFAll|||[]runtime/metrics.Description|false|\nFRead||m []runtime/metrics.Sample||false|\nTDescription|struct|struct{Name string; Description string; Kind runtime/metrics.ValueKind; Cumulative bool}||false\nfDescription|Name|string\nfDescription|Description|string\nfDescription|Kind|runtime/metrics.ValueKind\nfDescription|Cumulative|bool\nTFloat64Histogram|struct|struct{Counts []uint64; Buckets []float64}||false\nfFloat64Histogram|Counts|[]uint64\nfFloat64Histogram|Buckets|[]float64\nTSample|struct|struct{Name string; Value runtime/metrics.Value}||false\nfSample|Name|string\nfSample|Value|runtime/metrics.Value\nTValue|struct|struct{kind runtime/metrics.ValueKind; scalar uint64; pointer unsafe.Pointer}||false\nMValue|Float64|false||float64\nMValue|Float64Histogram|false||*runtime/metrics.Float64Histogram\nMValue|Kind|false||runtime/metrics.ValueKind\nMValue|Uint64|false||uint64\nTValueKind|basic|int||true\nCKindBad|typed|runtime/metrics.ValueKind\nCKindFloat64|typed|runtime/metrics.ValueKind\nCKindFloat64Histogram|typed|runtime/metrics.ValueKind\nCKindUint64|typed|runtime/metrics.ValueKind",
|
|
147
149
|
"runtime/pprof": "Ppprof\nFDo||ctx context.Context,labels runtime/pprof.LabelSet,f func(context.Context)||false|\nFForLabels||ctx context.Context,f func(key string, value string) bool||false|\nFLabel||ctx context.Context,key string|string,bool|false|\nFLabels||args ...string|runtime/pprof.LabelSet|true|\nFLookup||name string|*runtime/pprof.Profile|false|\nFNewProfile||name string|*runtime/pprof.Profile|false|\nFProfiles|||[]*runtime/pprof.Profile|false|\nFSetGoroutineLabels||ctx context.Context||false|\nFStartCPUProfile||w io.Writer|error|false|\nFStopCPUProfile||||false|\nFWithLabels||ctx context.Context,labels runtime/pprof.LabelSet|context.Context|false|\nFWriteHeapProfile||w io.Writer|error|false|\nTLabelSet|struct|struct{list []internal/runtime/pprof/label.Label}||false\nTProfile|struct|struct{name string; mu sync.Mutex; m map[any][]uintptr; count func() int; write func(io.Writer, int) error}||false\nMProfile|Add|true|value any,skip int|\nMProfile|Count|true||int\nMProfile|Name|true||string\nMProfile|Remove|true|value any|\nMProfile|WriteTo|true|w io.Writer,debug int|error",
|
package/bin/index.js
CHANGED
|
@@ -27,6 +27,8 @@ Options:
|
|
|
27
27
|
--target <os/arch> Cross-compile, e.g. linux/amd64, linux/arm64, darwin/arm64,
|
|
28
28
|
windows/amd64 ('go tool dist list' shows every pair)
|
|
29
29
|
--release Smaller binary: drop symbols and file paths
|
|
30
|
+
--cover Build with coverage counters, for go:runtime/coverage
|
|
31
|
+
(set GOCOVERDIR to also write a profile at exit)
|
|
30
32
|
--emit-go <dir> Write the generated Go (and go.mod) to <dir> instead of building
|
|
31
33
|
--no-typecheck Skip type-checking
|
|
32
34
|
-h, --help Show this help
|
|
@@ -47,6 +49,7 @@ export function parseCliArgs(argv) {
|
|
|
47
49
|
script: false,
|
|
48
50
|
noTypeCheck: false,
|
|
49
51
|
release: false,
|
|
52
|
+
cover: false,
|
|
50
53
|
source: null,
|
|
51
54
|
output: null,
|
|
52
55
|
target: null,
|
|
@@ -73,6 +76,8 @@ export function parseCliArgs(argv) {
|
|
|
73
76
|
args.noTypeCheck = true;
|
|
74
77
|
else if (arg === '--release')
|
|
75
78
|
args.release = true;
|
|
79
|
+
else if (arg === '--cover')
|
|
80
|
+
args.cover = true;
|
|
76
81
|
else if (arg === '--source' || arg === '--output' || arg === '--target' || arg === '--emit-go') {
|
|
77
82
|
if (value === null) {
|
|
78
83
|
if (i + 1 >= argv.length || argv[i + 1].startsWith('--')) {
|
|
@@ -171,6 +176,22 @@ function vendorXText(outDir) {
|
|
|
171
176
|
fs.writeFileSync(path.join(outDir, 'tnvendor', 'x-text', 'go.mod'), 'module golang.org/x/text\n\ngo 1.23\n');
|
|
172
177
|
return { path: 'golang.org/x/text', version: 'v0.0.0', dir: './tnvendor/x-text' };
|
|
173
178
|
}
|
|
179
|
+
// golang.org/x/net's dns/dnsmessage (node:dns record queries), copied from
|
|
180
|
+
// GOROOT/src/vendor
|
|
181
|
+
function vendorXNet(outDir) {
|
|
182
|
+
const goroot = runCommand('go', ['env', 'GOROOT']).stdout.trim();
|
|
183
|
+
const pkg = path.join('dns', 'dnsmessage');
|
|
184
|
+
const source = path.join(goroot, 'src', 'vendor', 'golang.org', 'x', 'net', pkg);
|
|
185
|
+
const target = path.join(outDir, 'tnvendor', 'x-net', pkg);
|
|
186
|
+
fs.mkdirSync(target, { recursive: true });
|
|
187
|
+
for (const file of fs.readdirSync(source)) {
|
|
188
|
+
if (file.endsWith('.go') && !file.endsWith('_test.go')) {
|
|
189
|
+
fs.writeFileSync(path.join(target, file), fs.readFileSync(path.join(source, file), 'utf-8'));
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
fs.writeFileSync(path.join(outDir, 'tnvendor', 'x-net', 'go.mod'), 'module golang.org/x/net\n\ngo 1.23\n');
|
|
193
|
+
return { path: 'golang.org/x/net', version: 'v0.0.0', dir: './tnvendor/x-net' };
|
|
194
|
+
}
|
|
174
195
|
// node:sqlite's driver, the Brotli codec, fsnotify and their dependencies,
|
|
175
196
|
// copied from the package's govendor/ (listed in govendor/manifest.txt); the
|
|
176
197
|
// copy is skipped while dist/tnvendor already holds the same version. Returns
|
|
@@ -258,6 +279,92 @@ export function createProject(projectName, installDependencies) {
|
|
|
258
279
|
console.log('Dependencies installed successfully!');
|
|
259
280
|
}
|
|
260
281
|
}
|
|
282
|
+
// go:embed files are copied next to the Go sources at their paths relative
|
|
283
|
+
// to the entry file; this manifest lists the copies for the next build to remove
|
|
284
|
+
const EMBED_MANIFEST = '.tnembed';
|
|
285
|
+
// A go:embed path from a source file's directory → the pattern relative to
|
|
286
|
+
// rootDir (the entry file's directory), or null when nothing matches or it
|
|
287
|
+
// leaves rootDir. An `all:` prefix (dotfiles too) is kept.
|
|
288
|
+
function resolveEmbedPattern(pattern, fromDir, rootDir) {
|
|
289
|
+
const all = pattern.startsWith('all:');
|
|
290
|
+
const spec = all ? pattern.slice(4) : pattern;
|
|
291
|
+
const rel = path.relative(rootDir, path.resolve(fromDir, spec)).split(path.sep).join('/');
|
|
292
|
+
if (!rel || rel === '..' || rel.startsWith('../') || path.isAbsolute(rel))
|
|
293
|
+
return null;
|
|
294
|
+
if (embedMatches(rootDir, rel).length === 0)
|
|
295
|
+
return null;
|
|
296
|
+
return all ? `all:${rel}` : rel;
|
|
297
|
+
}
|
|
298
|
+
// The paths under rootDir an embed pattern names: itself, or for a glob
|
|
299
|
+
// (* ? [...], in the last element) the matching entries of its directory
|
|
300
|
+
function embedMatches(rootDir, rel) {
|
|
301
|
+
const slash = rel.lastIndexOf('/');
|
|
302
|
+
const dir = slash < 0 ? '' : rel.slice(0, slash);
|
|
303
|
+
const base = rel.slice(slash + 1);
|
|
304
|
+
if (!/[*?[]/.test(base))
|
|
305
|
+
return fs.existsSync(path.join(rootDir, rel)) ? [rel] : [];
|
|
306
|
+
if (/[*?[]/.test(dir))
|
|
307
|
+
return [];
|
|
308
|
+
const glob = globRegExp(base);
|
|
309
|
+
let names = [];
|
|
310
|
+
try {
|
|
311
|
+
names = fs.readdirSync(path.join(rootDir, dir));
|
|
312
|
+
}
|
|
313
|
+
catch {
|
|
314
|
+
return [];
|
|
315
|
+
}
|
|
316
|
+
return names.filter((name) => glob.test(name)).map((name) => (dir ? `${dir}/${name}` : name));
|
|
317
|
+
}
|
|
318
|
+
// Go path.Match syntax for one path element: * ? and [...] ([^...] negates)
|
|
319
|
+
function globRegExp(glob) {
|
|
320
|
+
let source = '';
|
|
321
|
+
for (let i = 0; i < glob.length; i++) {
|
|
322
|
+
const c = glob[i];
|
|
323
|
+
const close = c === '[' ? glob.indexOf(']', i + 1) : -1;
|
|
324
|
+
if (c === '*')
|
|
325
|
+
source += '.*';
|
|
326
|
+
else if (c === '?')
|
|
327
|
+
source += '.';
|
|
328
|
+
else if (close > i) {
|
|
329
|
+
source += `[${glob.slice(i + 1, close)}]`;
|
|
330
|
+
i = close;
|
|
331
|
+
}
|
|
332
|
+
else
|
|
333
|
+
source += /[\\^$.|+(){}[\]]/.test(c) ? `\\${c}` : c;
|
|
334
|
+
}
|
|
335
|
+
return new RegExp(`^${source}$`);
|
|
336
|
+
}
|
|
337
|
+
// Removes the go:embed copies the previous build listed
|
|
338
|
+
function removeEmbedCopies(outDir) {
|
|
339
|
+
const manifest = path.join(outDir, EMBED_MANIFEST);
|
|
340
|
+
if (!fs.existsSync(manifest))
|
|
341
|
+
return;
|
|
342
|
+
for (const line of fs.readFileSync(manifest, 'utf-8').split('\n')) {
|
|
343
|
+
if (line.trim())
|
|
344
|
+
fs.rmSync(path.join(outDir, line.trim()), { recursive: true, force: true });
|
|
345
|
+
}
|
|
346
|
+
fs.rmSync(manifest);
|
|
347
|
+
}
|
|
348
|
+
// Copies the go:embed files into outDir, where go build resolves the
|
|
349
|
+
// directives (embed paths can't leave the package directory)
|
|
350
|
+
function copyEmbeds(rootDir, patterns, outDir) {
|
|
351
|
+
const copied = [];
|
|
352
|
+
for (const pattern of patterns) {
|
|
353
|
+
const rel = pattern.startsWith('all:') ? pattern.slice(4) : pattern;
|
|
354
|
+
for (const match of embedMatches(rootDir, rel)) {
|
|
355
|
+
const top = match.split('/')[0];
|
|
356
|
+
if ((top === match && match.endsWith('.go')) || ['go.mod', 'go.sum', 'tnvendor', EMBED_MANIFEST].includes(top)) {
|
|
357
|
+
console.error(`error: can't embed '${match}': the generated Go files use that name`);
|
|
358
|
+
process.exit(1);
|
|
359
|
+
}
|
|
360
|
+
fs.cpSync(path.join(rootDir, match), path.join(outDir, match), { recursive: true });
|
|
361
|
+
if (!copied.includes(top))
|
|
362
|
+
copied.push(top);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
if (copied.length > 0)
|
|
366
|
+
fs.writeFileSync(path.join(outDir, EMBED_MANIFEST), `${copied.join('\n')}\n`);
|
|
367
|
+
}
|
|
261
368
|
export function run(opts) {
|
|
262
369
|
const goError = checkGo(opts.target);
|
|
263
370
|
if (goError) {
|
|
@@ -343,6 +450,7 @@ export function run(opts) {
|
|
|
343
450
|
content = typed;
|
|
344
451
|
return { content, dir, path: displayPath(resolved.path) };
|
|
345
452
|
};
|
|
453
|
+
transpileOptions.resolveEmbed = (pattern, fromDir) => resolveEmbedPattern(pattern, fromDir ?? sourceDir, sourceDir);
|
|
346
454
|
}
|
|
347
455
|
const transpileResult = transpileToNative(tsCode, transpileOptions);
|
|
348
456
|
if (transpileResult.diagnostics.length > 0) {
|
|
@@ -363,6 +471,7 @@ export function run(opts) {
|
|
|
363
471
|
}
|
|
364
472
|
// Clean up stale Go files from previous runs before writing new ones (in an
|
|
365
473
|
// --emit-go directory, only files TypeNative generated)
|
|
474
|
+
removeEmbedCopies(outDir);
|
|
366
475
|
for (const existing of fs.readdirSync(outDir)) {
|
|
367
476
|
const file = path.join(outDir, existing);
|
|
368
477
|
if (existing === 'go.mod' || existing === 'go.sum')
|
|
@@ -376,6 +485,8 @@ export function run(opts) {
|
|
|
376
485
|
fs.writeFileSync(path.join(outDir, filename), content);
|
|
377
486
|
goFiles.push(filename);
|
|
378
487
|
}
|
|
488
|
+
if (sourceDir)
|
|
489
|
+
copyEmbeds(sourceDir, transpileResult.embeds, outDir);
|
|
379
490
|
// Third-party Go modules the program imports (see vendorXText / vendorGoModules)
|
|
380
491
|
const generated = [transpileResult.main];
|
|
381
492
|
for (const content of transpileResult.files.values())
|
|
@@ -385,6 +496,9 @@ export function run(opts) {
|
|
|
385
496
|
let goVersion = `${MIN_GO_MAJOR}.${MIN_GO_MINOR}`;
|
|
386
497
|
if (generated.some((content) => xTextImport.test(content)))
|
|
387
498
|
modules.push(vendorXText(outDir));
|
|
499
|
+
const xNetImport = /^import (\w+ )?"golang\.org\/x\/net\//m;
|
|
500
|
+
if (generated.some((content) => xNetImport.test(content)))
|
|
501
|
+
modules.push(vendorXNet(outDir));
|
|
388
502
|
if (generated.some((content) => importsVendoredModule(content, opts.vendorDir))) {
|
|
389
503
|
const vendored = vendorGoModules(opts.vendorDir, outDir);
|
|
390
504
|
for (const mod of vendored.modules)
|
|
@@ -412,6 +526,9 @@ export function run(opts) {
|
|
|
412
526
|
buildArgs.push('-trimpath');
|
|
413
527
|
if (opts.release)
|
|
414
528
|
buildArgs.push('-ldflags=-s -w');
|
|
529
|
+
// atomic counters: coverage.ClearCounters refuses the default 'set' mode
|
|
530
|
+
if (opts.cover)
|
|
531
|
+
buildArgs.push('-cover', '-covermode=atomic');
|
|
415
532
|
for (const file of goFiles)
|
|
416
533
|
buildArgs.push(file);
|
|
417
534
|
const buildResult = runCommand('go', buildArgs);
|
package/bin/main.js
CHANGED
|
@@ -10,6 +10,7 @@ type tnSpawnOptions struct {
|
|
|
10
10
|
input []byte
|
|
11
11
|
stdio string
|
|
12
12
|
encoding string
|
|
13
|
+
detached bool
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
// Environment entries from an env option (records, objects, process.env)
|
|
@@ -83,6 +84,9 @@ func tnSpawnOpts(options []interface{}) tnSpawnOptions {
|
|
|
83
84
|
if e, ok := TnGet(opts, "encoding").(string); ok {
|
|
84
85
|
o.encoding = e
|
|
85
86
|
}
|
|
87
|
+
if d, ok := TnGet(opts, "detached").(bool); ok {
|
|
88
|
+
o.detached = d
|
|
89
|
+
}
|
|
86
90
|
return o
|
|
87
91
|
}
|
|
88
92
|
|
|
@@ -102,6 +106,9 @@ func tnCommand(file string, args []string, o tnSpawnOptions) *exec.Cmd {
|
|
|
102
106
|
if o.env != nil {
|
|
103
107
|
cmd.Env = o.env
|
|
104
108
|
}
|
|
109
|
+
if o.detached {
|
|
110
|
+
tnDetach(cmd)
|
|
111
|
+
}
|
|
105
112
|
return cmd
|
|
106
113
|
}
|
|
107
114
|
|
|
@@ -249,6 +256,8 @@ type TnChildProcess struct {
|
|
|
249
256
|
spawnfile string
|
|
250
257
|
// IPC state of forked children (node:cluster / fork)
|
|
251
258
|
ipc interface{}
|
|
259
|
+
// whether the child keeps the event loop alive (unref() drops it)
|
|
260
|
+
refHeld bool
|
|
252
261
|
}
|
|
253
262
|
|
|
254
263
|
func (cp *TnChildProcess) Get_stdin() *TnStream { return cp.stdin }
|
|
@@ -260,6 +269,21 @@ func (cp *TnChildProcess) Get_signalCode() interface{} { return cp.signalCode }
|
|
|
260
269
|
func (cp *TnChildProcess) Get_killed() bool { return cp.killed }
|
|
261
270
|
func (cp *TnChildProcess) Get_spawnfile() string { return cp.spawnfile }
|
|
262
271
|
|
|
272
|
+
// unref(): the parent can exit while the child runs; ref() undoes it
|
|
273
|
+
func (cp *TnChildProcess) unref() {
|
|
274
|
+
if cp.refHeld {
|
|
275
|
+
cp.refHeld = false
|
|
276
|
+
TnLoopUnref()
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
func (cp *TnChildProcess) ref() {
|
|
281
|
+
if !cp.refHeld && cp.exitCode == nil && cp.cmd != nil && cp.cmd.Process != nil {
|
|
282
|
+
cp.refHeld = true
|
|
283
|
+
TnLoopRef()
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
263
287
|
func (cp *TnChildProcess) kill(signal ...interface{}) bool {
|
|
264
288
|
if cp.cmd == nil || cp.cmd.Process == nil || cp.exitCode != nil {
|
|
265
289
|
return false
|
|
@@ -330,14 +354,18 @@ func TnSpawn(file string, args []string, options ...interface{}) *TnChildProcess
|
|
|
330
354
|
return cp
|
|
331
355
|
}
|
|
332
356
|
cp.pid = float64(cmd.Process.Pid)
|
|
357
|
+
cp.refHeld = true
|
|
333
358
|
TnLoopRef()
|
|
334
359
|
TnLoopPost(func() { cp.emit("spawn") })
|
|
335
360
|
go func() {
|
|
336
361
|
streams.Wait()
|
|
337
362
|
err := cmd.Wait()
|
|
338
363
|
status, _ := tnExitStatus(err)
|
|
364
|
+
if ipc, ok := cp.ipc.(interface{ waitDrained() }); ok {
|
|
365
|
+
ipc.waitDrained()
|
|
366
|
+
}
|
|
339
367
|
TnLoopPost(func() {
|
|
340
|
-
defer
|
|
368
|
+
defer cp.unref()
|
|
341
369
|
var code interface{} = status
|
|
342
370
|
var signal interface{}
|
|
343
371
|
if cp.killed {
|
|
@@ -484,10 +512,30 @@ function stringArray(arg) {
|
|
|
484
512
|
function isFunctionArg(node, type) {
|
|
485
513
|
return !!node && (node.kind === 'ArrowFunction' || node.kind === 'FunctionExpression' || type.startsWith('func('));
|
|
486
514
|
}
|
|
515
|
+
// detached: a new session on Unix (setsid, as libuv does), a detached process
|
|
516
|
+
// in a new process group on Windows
|
|
517
|
+
const unixDetachHelper = `func tnDetach(cmd *exec.Cmd) {
|
|
518
|
+
if cmd.SysProcAttr == nil {
|
|
519
|
+
cmd.SysProcAttr = &syscall.SysProcAttr{}
|
|
520
|
+
}
|
|
521
|
+
cmd.SysProcAttr.Setsid = true
|
|
522
|
+
}`;
|
|
523
|
+
const windowsDetachHelper = `func tnDetach(cmd *exec.Cmd) {
|
|
524
|
+
if cmd.SysProcAttr == nil {
|
|
525
|
+
cmd.SysProcAttr = &syscall.SysProcAttr{}
|
|
526
|
+
}
|
|
527
|
+
// DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP
|
|
528
|
+
cmd.SysProcAttr.CreationFlags |= 0x8 | 0x200
|
|
529
|
+
}`;
|
|
487
530
|
export function registerChildProcess(r) {
|
|
488
531
|
defineModule(r, 'child_process');
|
|
489
|
-
|
|
490
|
-
|
|
532
|
+
for (const goos of ['linux', 'darwin', 'freebsd', 'openbsd', 'netbsd', 'dragonfly', 'solaris', 'illumos', 'aix']) {
|
|
533
|
+
defineHelper(r, `nodeChildOS@${goos}`, ['os/exec', 'syscall'], [], unixDetachHelper);
|
|
534
|
+
}
|
|
535
|
+
defineHelper(r, 'nodeChildOS@windows', ['os/exec', 'syscall'], [], windowsDetachHelper);
|
|
536
|
+
defineHelper(r, 'nodeChildOS@other', ['os/exec'], [], 'func tnDetach(cmd *exec.Cmd) {}');
|
|
537
|
+
defineHelper(r, 'nodeChild', ['bytes', 'errors', 'fmt', 'io', 'io/fs', 'os', 'os/exec', 'reflect', 'runtime', 'strings', 'sync', 'unsafe'], ['nodeStream', 'fsErrors', 'buffer', 'dynamic', 'nodeInvoke', 'eventLoop', 'promise', 'nodeChildOS@os'], childHelper);
|
|
538
|
+
defineClass(r, 'child_process.ChildProcess', '*TnChildProcess', 'class', 'on=*TnEventEmitter; once=*TnEventEmitter; off=*TnEventEmitter; emit=bool; kill=bool; ref=; unref=', '', 'stdin=*TnStream; stdout=*TnStream; stderr=*TnStream; pid=float64; exitCode=interface{}; signalCode=interface{}; killed=bool; spawnfile=string', '');
|
|
491
539
|
defineClass(r, 'child_process.SpawnSyncReturns', '*TnSpawnSyncResult', 'class', '', 'pid=float64; stdout=string; stderr=string; status=float64; signal=*string; output=[]interface{}; error=*TnError', '', '');
|
|
492
540
|
defineClass(r, 'child_process.SpawnSyncBytes', '*TnSpawnSyncBytes', 'class', '', 'pid=float64; stdout=[]byte; stderr=[]byte; status=float64; signal=*string; output=[]interface{}; error=*TnError', '', '');
|
|
493
541
|
defineClass(r, 'child_process.ExecOutput', '*TnExecOutput', 'class', '', 'stdout=string; stderr=string', '', '');
|
package/bin/node/cluster.js
CHANGED
|
@@ -58,6 +58,7 @@ type tnIpcLink struct {
|
|
|
58
58
|
onControl func(ctl map[string]interface{})
|
|
59
59
|
directControl func(ctl map[string]interface{}) bool
|
|
60
60
|
onClose func()
|
|
61
|
+
done chan struct{}
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
func (l *tnIpcLink) write(kind byte, data []byte) bool {
|
|
@@ -95,6 +96,9 @@ func (l *tnIpcLink) start() {
|
|
|
95
96
|
l.onClose()
|
|
96
97
|
}
|
|
97
98
|
})
|
|
99
|
+
if l.done != nil {
|
|
100
|
+
close(l.done)
|
|
101
|
+
}
|
|
98
102
|
return
|
|
99
103
|
}
|
|
100
104
|
switch kind {
|
|
@@ -138,6 +142,16 @@ type tnChildIpc struct {
|
|
|
138
142
|
connected bool
|
|
139
143
|
onConnect func()
|
|
140
144
|
onControl func(ctl map[string]interface{})
|
|
145
|
+
drained chan struct{}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Holds the child's 'exit' until everything it sent (and the channel's close)
|
|
149
|
+
// is delivered, so 'message' and 'disconnect' come first as in Node
|
|
150
|
+
func (st *tnChildIpc) waitDrained() {
|
|
151
|
+
select {
|
|
152
|
+
case <-st.drained:
|
|
153
|
+
case <-time.After(time.Second):
|
|
154
|
+
}
|
|
141
155
|
}
|
|
142
156
|
|
|
143
157
|
func tnCPIpc(cp *TnChildProcess) *tnChildIpc {
|
|
@@ -210,6 +224,7 @@ func tnForkWith(argv []string, opts interface{}, extraEnv []string) *TnChildProc
|
|
|
210
224
|
}
|
|
211
225
|
env = append(env, extraEnv...)
|
|
212
226
|
env = append(env, "TN_IPC_ADDR="+ln.Addr().String(), "TN_IPC_TOKEN="+token)
|
|
227
|
+
env = tnSpawnEntryEnv(env)
|
|
213
228
|
envMap := map[string]interface{}{}
|
|
214
229
|
for _, kv := range env {
|
|
215
230
|
if k, v, ok := strings.Cut(kv, "="); ok {
|
|
@@ -225,7 +240,7 @@ func tnForkWith(argv []string, opts interface{}, extraEnv []string) *TnChildProc
|
|
|
225
240
|
spawnOpts["cwd"] = cwd
|
|
226
241
|
}
|
|
227
242
|
cp := TnSpawn(exe, argv, spawnOpts)
|
|
228
|
-
st := &tnChildIpc{connected: true}
|
|
243
|
+
st := &tnChildIpc{connected: true, drained: make(chan struct{})}
|
|
229
244
|
cp.ipc = st
|
|
230
245
|
go func() {
|
|
231
246
|
ln.(*net.TCPListener).SetDeadline(time.Now().Add(30 * time.Second))
|
|
@@ -233,6 +248,7 @@ func tnForkWith(argv []string, opts interface{}, extraEnv []string) *TnChildProc
|
|
|
233
248
|
conn, err := ln.Accept()
|
|
234
249
|
if err != nil {
|
|
235
250
|
ln.Close()
|
|
251
|
+
close(st.drained)
|
|
236
252
|
return
|
|
237
253
|
}
|
|
238
254
|
kind, payload, err := tnReadFrame(conn)
|
|
@@ -241,11 +257,12 @@ func tnForkWith(argv []string, opts interface{}, extraEnv []string) *TnChildProc
|
|
|
241
257
|
continue
|
|
242
258
|
}
|
|
243
259
|
ln.Close()
|
|
244
|
-
link := &tnIpcLink{conn: conn}
|
|
260
|
+
link := &tnIpcLink{conn: conn, done: st.drained}
|
|
245
261
|
TnLoopPost(func() {
|
|
246
262
|
st.link = link
|
|
247
263
|
if !st.connected {
|
|
248
264
|
link.close()
|
|
265
|
+
close(st.drained)
|
|
249
266
|
return
|
|
250
267
|
}
|
|
251
268
|
for _, data := range st.pending {
|
|
@@ -277,6 +294,13 @@ func tnForkWith(argv []string, opts interface{}, extraEnv []string) *TnChildProc
|
|
|
277
294
|
|
|
278
295
|
// fork(modulePath, args?, options?): this program, run again (a native binary
|
|
279
296
|
// holds one program; branch on process.send / cluster.isPrimary)
|
|
297
|
+
// fork('./child.ts'): runs the entry point compiled from that file
|
|
298
|
+
func TnForkAt(entry string, modulePath interface{}, rest ...interface{}) *TnChildProcess {
|
|
299
|
+
tnNextEntry = entry
|
|
300
|
+
defer func() { tnNextEntry = "" }()
|
|
301
|
+
return TnFork(modulePath, rest...)
|
|
302
|
+
}
|
|
303
|
+
|
|
280
304
|
func TnFork(modulePath interface{}, rest ...interface{}) *TnChildProcess {
|
|
281
305
|
argv := []string{}
|
|
282
306
|
var opts interface{}
|
|
@@ -898,11 +922,15 @@ func tnClusterListen(srv *TnNetServer, network string, address string) (net.List
|
|
|
898
922
|
}`;
|
|
899
923
|
const CLUSTER_EMITTER = 'on=*TnEventEmitter; once=*TnEventEmitter; addListener=*TnEventEmitter; off=*TnEventEmitter; removeListener=*TnEventEmitter; removeAllListeners=*TnEventEmitter; emit=bool; listenerCount=float64';
|
|
900
924
|
export function registerCluster(r) {
|
|
901
|
-
defineHelper(r, 'nodeIpc', ['crypto/rand', 'encoding/binary', 'encoding/hex', 'encoding/json', 'io', 'net', 'os', 'reflect', 'strings', 'sync', 'time'], ['nodeClone', 'nodeChild', 'nodeEvents', 'eventLoop', 'nodeInvoke', 'dynamic'], ipcHelper);
|
|
925
|
+
defineHelper(r, 'nodeIpc', ['crypto/rand', 'encoding/binary', 'encoding/hex', 'encoding/json', 'io', 'net', 'os', 'reflect', 'strings', 'sync', 'time'], ['nodeClone', 'nodeChild', 'nodeEvents', 'eventLoop', 'nodeInvoke', 'dynamic', 'entryPoints'], ipcHelper);
|
|
902
926
|
const useIpc = () => r.helper('nodeIpc');
|
|
903
927
|
// child_process.fork and the child's process.send / connected / disconnect
|
|
904
928
|
r.functions['child_process.fork'] = (c) => {
|
|
905
929
|
useIpc();
|
|
930
|
+
// fork('./child.ts'): that file is compiled in as a second entry point
|
|
931
|
+
const entry = r.entryPoint(c.nodes[0]);
|
|
932
|
+
if (entry !== '')
|
|
933
|
+
return `TnForkAt(${JSON.stringify(entry)}, ${c.args.join(', ')})`;
|
|
906
934
|
return `TnFork(${c.args.join(', ')})`;
|
|
907
935
|
};
|
|
908
936
|
r.results['child_process.fork'] = '*TnChildProcess';
|
|
@@ -923,6 +951,16 @@ export function registerCluster(r) {
|
|
|
923
951
|
return `TnProcessSend(${c.args.join(', ')})`;
|
|
924
952
|
};
|
|
925
953
|
r.results['process.send'] = 'bool';
|
|
954
|
+
// process.send?.(…) / process.disconnect?.(): they exist only in a process
|
|
955
|
+
// with an IPC channel (a forked child)
|
|
956
|
+
r.functions['process.send?.'] = (c) => {
|
|
957
|
+
useIpc();
|
|
958
|
+
return `func() { if tnIpcParent != nil { TnProcessSend(${c.args.join(', ')}) } }()`;
|
|
959
|
+
};
|
|
960
|
+
r.functions['process.disconnect?.'] = (_c) => {
|
|
961
|
+
useIpc();
|
|
962
|
+
return 'func() { if tnIpcParent != nil { TnProcessDisconnect() } }()';
|
|
963
|
+
};
|
|
926
964
|
r.functions['process.disconnect'] = (_c) => {
|
|
927
965
|
useIpc();
|
|
928
966
|
return 'TnProcessDisconnect()';
|
package/bin/node/core.js
CHANGED
|
@@ -85,7 +85,7 @@ func tnInvokeArg(a interface{}, t reflect.Type) reflect.Value {
|
|
|
85
85
|
}`;
|
|
86
86
|
export function registerCore(r) {
|
|
87
87
|
defineHelper(r, 'nodeInvoke', ['reflect'], ['dynamic'], invokeHelper);
|
|
88
|
-
defineClass(r, 'NodeJS.ErrnoException', '*TnError', 'class', '', 'message=string; code=string', 'name=string; stack=string; cause=interface{}; syscall=string; path=string; errno=float64; hostname=string; address=string; port=float64; actual=interface{}; expected=interface{}; operator=string; generatedMessage=bool', '');
|
|
88
|
+
defineClass(r, 'NodeJS.ErrnoException', '*TnError', 'class', '', 'message=string; code=string', 'name=string; stack=string; cause=interface{}; syscall=string; path=string; errno=float64; hostname=string; address=string; port=float64; actual=interface{}; expected=interface{}; operator=string; generatedMessage=bool; errors=[]interface{}', '');
|
|
89
89
|
r.globals['NodeJS'] = 'NodeJS';
|
|
90
90
|
// Callback types of Node's typings (TransformCallback …)
|
|
91
91
|
for (const name of ['stream.TransformCallback', 'fs.NoParamCallback']) {
|