// Copyright (c) 2026 Arslaan Pathan // This software is licensed under the ARPL. See LICENSE for details. package manifest import ( "fmt" "encoding/json" "net/http" "log" "io" "errors" "github.com/BurntSushi/toml" ) type KiiroToml struct { // package name Name string `toml:"pkgname"` // supported architectures Architectures string `toml:"archs"` // authors Authors []string `toml:"authors"` // maintainers of the Kiirofile/kiiro.toml Maintainers []string `toml:"maintainers"` // Dependencies on other Kiiro packages - you can refer to a package from a specific source by using : // If no source is provided (just a bare URL), we clone directly from git Depends []string `toml:"deps"` // Platforms it runs on: e.g. "Windows", "macOS", "Linux", "BSD" Platforms []string `toml:"platforms"` } func FetchKiiroToml(url string) (*KiiroToml, error) { fmt.Println("Fetching kiiro.toml...") res, err := http.Get(url) if err != nil { return nil, err } body, err := io.ReadAll(res.Body) res.Body.Close() if res.StatusCode > 299 { return nil, err } if err != nil { return nil, err } kiirotoml, err := ParseKiiroToml(body) if err != nil { return nil, err } fmt.Println("Fetched package listing!") return kiirotoml, nil } func ParseKiiroToml(kiirotomlTOML []byte) (*KiiroToml, error) { var kiirotoml KiiroToml err := toml.Unmarshal(kiirotomlTOML, kiirotoml); if err != nil { return nil, err } return &kiirotoml, nil; }