Debian Codegraph @

vendor/github.com/xyproto/gfx/http.go

raw
1 //go:build !tinygo
2 // +build !tinygo
3
4 package gfx
5
6 import (
7 "errors"
8 "image"
9 )
10
11 // Local fork: the upstream file imports net/http to provide convenience
12 // functions (Get, GetPNG, GetImage, GetTileset) that are not needed.
13 // Replacing them with error-returning stubs avoids pulling net/http,
14 // crypto/tls and their transitive dependencies into the binary.
15
16 var errNetDisabled = errors.New("gfx: network functions disabled in this build")
17
18 // Get is a no-op stub returning an error.
19 func Get(rawurl string) ([]byte, error) {
20 return nil, errNetDisabled
21 }
22
23 // GetPNG is a no-op stub returning an error.
24 func GetPNG(rawurl string) (image.Image, error) {
25 return nil, errNetDisabled
26 }
27
28 // GetImage is a no-op stub returning an error.
29 func GetImage(rawurl string) (image.Image, error) {
30 return nil, errNetDisabled
31 }
32
33 // GetTileset is a no-op stub returning an error.
34 func GetTileset(p Palette, tileSize image.Point, rawurl string) (*Tileset, error) {
35 return nil, errNetDisabled
36 }