Documentation
¶
Overview ¶
Package admin serves the voting-config endpoint by proxying the GitHub Pages CDN (valargroup/token-holder-voting-config).
Server registration, approval, and removal happen via GitHub PRs on the config repo — no write endpoints here.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Admin ¶
type Admin struct {
// contains filtered or unexported fields
}
Admin fetches and caches the voting-config from the GitHub Pages CDN.
func (*Admin) GetVotingConfig ¶ added in v0.5.0
func (a *Admin) GetVotingConfig() (*VotingConfig, error)
GetVotingConfig returns the cached voting config, refreshing if stale.
type Config ¶
type Config struct {
// Disable turns off the admin server entirely.
Disable bool `mapstructure:"disable"`
// ConfigURL is the GitHub Pages CDN URL for the voting-config JSON.
ConfigURL string `mapstructure:"config_url"`
}
Config holds the admin server configuration, read from app.toml admin.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default admin configuration.
type ServiceEntry ¶
type ServiceEntry struct {
URL string `json:"url"`
Label string `json:"label"`
OperatorAddress string `json:"operator_address,omitempty"`
}
ServiceEntry is the wire format for a server in the voting-config response.
type VotingConfig ¶
type VotingConfig struct {
Version int `json:"version"`
VoteServers []ServiceEntry `json:"vote_servers"`
PIRServers []ServiceEntry `json:"pir_endpoints"`
}
VotingConfig is the wire format returned by GET /api/voting-config.
Click to show internal directories.
Click to hide internal directories.