Documentation
¶
Overview ¶
Package hyper provides a fantasy.Provider that proxies requests to Hyper.
Index ¶
Constants ¶
View Source
const (
// Name is the default name of this meta provider.
Name = "hyper"
)
Variables ¶
View Source
var BaseURL = sync.OnceValue(func() string { return cmp.Or(os.Getenv("HYPER_URL"), defaultBaseURL) })
BaseURL returns the base URL, which is either $HYPER_URL or the default.
View Source
var Embedded = sync.OnceValue(func() catwalk.Provider { var provider catwalk.Provider if err := json.Unmarshal(embedded, &provider); err != nil { slog.Error("could not use embedded provider data", "err", err) } return provider })
Embedded returns the embedded Hyper provider.
View Source
var Enabled = sync.OnceValue(func() bool { b, _ := strconv.ParseBool( cmp.Or( os.Getenv("HYPER"), os.Getenv("HYPERCRUSH"), os.Getenv("HYPER_ENABLE"), os.Getenv("HYPER_ENABLED"), ), ) return b })
Enabled returns true if hyper is enabled.
View Source
var ErrNoCredits = errors.New("you're out of credits")
Functions ¶
Types ¶
type Option ¶
type Option = func(*options)
Option configures the proxy provider.
func WithBaseURL ¶
WithBaseURL sets the proxy base URL (e.g. http://localhost:8080).
func WithHTTPClient ¶
WithHTTPClient sets custom HTTP client.
func WithHeaders ¶
WithHeaders sets extra headers sent to the proxy.
Click to show internal directories.
Click to hide internal directories.