Documentation ¶
Overview ¶
Package website contains the service delivering the website
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrServerAlreadyStarted = errors.New("server was already started")
)
Functions ¶
func ParseDailyStatsTemplate ¶
func ParseIndexTemplate ¶
Types ¶
type HTMLDataDailyStats ¶
type HTMLDataDailyStats struct { Title string Day string DayPrev string DayNext string TimeSince string TimeUntil string TopRelays []*database.TopRelayEntry TopBuildersBySummary []*database.TopBuilderEntry BuilderProfits []*database.BuilderProfitEntry }
type HTTPErrorResp ¶
type Stats ¶
type Stats struct { Since time.Time Until time.Time TimeStr string // i.e. 24h, 12h, 1h or 7d TopRelays []*database.TopRelayEntry TopBuilders []*database.TopBuilderEntry BuilderProfits []*database.BuilderProfitEntry TopBuildersByRelay map[string][]*database.TopBuilderEntry }
type Webserver ¶
type Webserver struct {
// contains filtered or unexported fields
}
func NewWebserver ¶
func NewWebserver(opts *WebserverOpts) (*Webserver, error)
func (*Webserver) RespondError ¶
func (srv *Webserver) RespondError(w http.ResponseWriter, code int, message string)
func (*Webserver) RespondErrorJSON ¶ added in v1.8.2
func (srv *Webserver) RespondErrorJSON(w http.ResponseWriter, code int, response any)
func (*Webserver) StartServer ¶
type WebserverOpts ¶
Click to show internal directories.
Click to hide internal directories.