New Packet.lua format, test parsing and entire new lua ecossystem
This commit is contained in:
40
cmd/main.go
Normal file
40
cmd/main.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"runtime"
|
||||
|
||||
"github.com/roboogg133/packets/pkg/packet.lua.d"
|
||||
)
|
||||
|
||||
func main() {
|
||||
f, err := os.ReadFile("test/bat/Packet.lua")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
pk, err := packet.ReadPacket(f, nil)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
fmt.Println(
|
||||
pk.Name,
|
||||
pk.Description,
|
||||
)
|
||||
|
||||
if pk.Plataforms == nil {
|
||||
fmt.Print("NIGGER NIGGER NIGGER NIGGER NIGGER NIGGER")
|
||||
return
|
||||
}
|
||||
plataforms := *pk.Plataforms
|
||||
|
||||
for _, v := range *plataforms[packet.OperationalSystem(runtime.GOOS)].Sources {
|
||||
fmt.Printf("%s %s\n", v.Method, v.Url)
|
||||
if v.Method == "GET" {
|
||||
fmt.Println(*v.Specs.(packet.GETSpecs).SHA256)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user