Skip to content

Commit

Permalink
new package manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Glowman554 committed Dec 21, 2024
1 parent 508cad2 commit e01c785
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 1,099 deletions.
731 changes: 0 additions & 731 deletions fire/client/client.go

This file was deleted.

19 changes: 0 additions & 19 deletions fire/client/instance.go

This file was deleted.

63 changes: 0 additions & 63 deletions fire/command/commands/delete.go

This file was deleted.

70 changes: 0 additions & 70 deletions fire/command/commands/deploy.go

This file was deleted.

69 changes: 0 additions & 69 deletions fire/command/commands/get.go

This file was deleted.

46 changes: 0 additions & 46 deletions fire/command/commands/login.go

This file was deleted.

46 changes: 0 additions & 46 deletions fire/command/commands/register.go

This file was deleted.

61 changes: 61 additions & 0 deletions fire/firestorm/modules/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package modules

import (
"encoding/json"
"io"
"net/http"
"os"
)

func getBaseUrl() string {

baseUrl := "https://firepack.glowman554.de"

if h, ok := os.LookupEnv("PACK_URL"); ok {
baseUrl = h
}

return baseUrl
}

func fetchFileList(name string, version string) []ListEntry {
url := getBaseUrl() + "/list/" + name + "/" + version

resp, err := http.Get(url)
if err != nil {
panic(err)
}
defer resp.Body.Close()

body, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}

if resp.StatusCode == 500 {
panic(string(body))
}

var items []ListEntry
err = json.Unmarshal(body, &items)
if err != nil {
panic(err)
}

return items
}

func fetchFile(url string) string {
resp, err := http.Get(url)
if err != nil {
panic(err)
}
defer resp.Body.Close()

body, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}

return string(body)
}
Loading

0 comments on commit e01c785

Please sign in to comment.