Skip to content

Commit

Permalink
util: move to internal/netutil
Browse files Browse the repository at this point in the history
  • Loading branch information
apprehensions committed Jan 30, 2024
1 parent 77307d1 commit fd48ebb
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions bloxstraprpc/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
type RichPresenceImage struct {
AssetID *int64 `json:"assetId"`
HoverText *string `json:"hoverText"`
Clear bool `json:"clear"`
Reset bool `json:"reset"`
Clear bool `json:"clear"`
Reset bool `json:"reset"`
}

// Data holds game information sent from a BloxstrapRPC message
Expand Down
3 changes: 2 additions & 1 deletion util/net.go → internal/netutil/netutil.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package util
// Package netutil provides shared utility networking functions.
package netutil

import (
"errors"
Expand Down
6 changes: 3 additions & 3 deletions roblox/bootstrapper/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"log"
"os"

"github.com/vinegarhq/vinegar/util"
"github.com/vinegarhq/vinegar/internal/netutil"
)

// Package is a representation of a Binary package.
Expand Down Expand Up @@ -58,13 +58,13 @@ func (p *Package) Download(dest, deployURL string) error {

log.Printf("Downloading Package %s (%s)", p.Name, dest)

if err := util.Download(deployURL+"-"+p.Name, dest); err == nil {
if err := netutil.Download(deployURL+"-"+p.Name, dest); err == nil {
return p.Verify(dest)
}

log.Printf("Failed to fetch package %s, retrying...", p.Name)

if err := util.Download(deployURL+"-"+p.Name, dest); err != nil {
if err := netutil.Download(deployURL+"-"+p.Name, dest); err != nil {
return fmt.Errorf("download package %s: %w", p.Name, err)
}

Expand Down
4 changes: 2 additions & 2 deletions roblox/bootstrapper/pkg_manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"
"strings"

"github.com/vinegarhq/vinegar/util"
"github.com/vinegarhq/vinegar/internal/netutil"
)

// PackageManifest is a representation of a Binary version's packages
Expand Down Expand Up @@ -49,7 +49,7 @@ func FetchPackageManifest(d *Deployment) (PackageManifest, error) {

log.Printf("Fetching manifest for %s (%s)", d.GUID, url)

smanif, err := util.Body(url)
smanif, err := netutil.Body(url)
if err != nil {
return PackageManifest{}, fmt.Errorf("fetch %s package manifest: %w", d.GUID, err)
}
Expand Down
2 changes: 0 additions & 2 deletions util/util.go

This file was deleted.

4 changes: 2 additions & 2 deletions wine/dxvk/dxvk.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"path"
"path/filepath"

"github.com/vinegarhq/vinegar/util"
"github.com/vinegarhq/vinegar/internal/netutil"
"github.com/vinegarhq/vinegar/wine"
)

Expand Down Expand Up @@ -59,7 +59,7 @@ func Install(ver string, pfx *wine.Prefix) error {

log.Printf("Downloading DXVK %s (%s)", ver, url)

if err := util.Download(url, f.Name()); err != nil {
if err := netutil.Download(url, f.Name()); err != nil {
return fmt.Errorf("download dxvk %s: %w", ver, err)
}

Expand Down

0 comments on commit fd48ebb

Please sign in to comment.