Documentation ¶
Overview ¶
Package conf writes and reads the Encore configuration file for the user.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var APIBaseURL = (func() string { if u := os.Getenv("ENCORE_PLATFORM_API_URL"); u != "" { return u } return defaultPlatformURL })()
APIBaseURL is the base URL for communicating with the Encore Platform.
View Source
var AuthClient = oauth2.NewClient(nil, DefaultTokenSource)
AuthClient is an *http.Client that authenticates requests using the logged-in user.
View Source
var DefaultTokenSource = &TokenSource{}
View Source
var WSBaseURL = (func() string { return strings.Replace(APIBaseURL, "http", "ws", -1) })()
WSBaseURL is the base URL for communicating with the Encore Platform over WebSocket.
Functions ¶
Types ¶
type Config ¶
type Config struct { oauth2.Token Email string `json:"email,omitempty"` // non-zero if logged in as a user AppSlug string `json:"app_slug,omitempty"` // non-zero if logged in as an app WireGuard struct { PublicKey string `json:"pub,omitempty"` PrivateKey string `json:"priv,omitempty"` } `json:"wg,omitempty"` }
Config represents the stored Encore configuration.
func CurrentUser ¶
func OriginalUser ¶
type TokenSource ¶
type TokenSource struct {
// contains filtered or unexported fields
}
TokenSource implements oauth2.TokenSource by looking up the current logged in user's API Token. The zero value is ready to be used.
Click to show internal directories.
Click to hide internal directories.