Documentation
¶
Index ¶
- func BitrateFormatter(v float64) string
- func EligibleSpeedtestsForChartView(speedtests []models.Speedtest) []models.Speedtest
- func ExtractHost(ectx echo.Context) string
- func ExtractPort(ectx echo.Context) string
- func ExtractReverseProxyIP(ectx echo.Context) string
- func FromRedirectWithError(ectx echo.Context) (error, bool)
- func GetEnv(key string, fallback func() string) string
- func GetLastVisitedPath(ectx echo.Context) (string, error)
- func InjectServiceContainer(ctx context.Context, container ServiceContainer) context.Context
- func IsBindToUnspecified(ectx echo.Context) bool
- func IsLocalRequest(ectx echo.Context) bool
- func IsReverseProxyRequest(ectx echo.Context) bool
- func NewCookie(ectx echo.Context, name string, value string, path string, expiry time.Time) *http.Cookie
- func NewWsConn(conn *websocket.Conn) *wsConn
- func RawURL(ectx echo.Context, host string, path string, query map[string]string) *url.URL
- func RedirectWithError(ectx echo.Context, err error) error
- func RegisterHandlers(e *echo.Echo)
- func RegisterMiddlewares(e *echo.Echo, ctx context.Context)
- func RegisterStaticFiles(e *echo.Echo, fs fs.FS) error
- func RegisterTemplates(e *echo.Echo, fs fs.FS) error
- func RenderString(ectx echo.Context, tpl string, v any) (string, error)
- func ServerAddress(ectx echo.Context) string
- func SetLastVisitedPathCookie(ectx echo.Context)
- func SetVirtualHost(host string)
- func Start(e *echo.Echo, host string, port string) error
- func StartTLS(e *echo.Echo, host string, port string, certfilepath string, ...) error
- func StoreHandlerError(err error) string
- func TimeFormatter(v float64) string
- func URL(ectx echo.Context, path string, query map[string]string) *url.URL
- func UnsetLastVisitedPathCookie(ectx echo.Context)
- func WithVirtualHost(path string) string
- type AxisView
- type Breakpoint
- type ChartView
- type ContextView
- type DashboardNetworkInviteLinkView
- type DashboardView
- type ElementView
- func NewElementView(id string, value string) ElementView
- func NewSpeedtestDownloadElementView(download models.BitRate) ElementView
- func NewSpeedtestLatencyElementView(latency models.Duration) ElementView
- func NewSpeedtestStatusElementView(status string) ElementView
- func NewSpeedtestUploadElementView(upload models.BitRate) ElementView
- type FormFieldView
- type FormView
- type LineChartView
- type LineView
- type MetaFormFieldView
- type NetworkConnectionEndpointView
- type NetworkJoinView
- type NetworkNodeActionsView
- type NetworkNodeConnectionsView
- type NetworkNodeInformationView
- type NetworkNodePackagesView
- type NetworkNodeProcessesView
- type NetworkNodeSpeedtestHistoryView
- type NetworkNodeSpeedtestView
- type NetworkView
- type NodeView
- func (v NodeView) CPU() string
- func (v NodeView) CPUCount() string
- func (v NodeView) CPUUsage() string
- func (v NodeView) Disk(idx int) string
- func (v NodeView) DiskCount() int
- func (v NodeView) DiskUsage() string
- func (v NodeView) Distribution() string
- func (v NodeView) GPU(idx int) string
- func (v NodeView) GPUCount() int
- func (v NodeView) HasDisk() bool
- func (v NodeView) HasGPU() bool
- func (v NodeView) Hostname() string
- func (v NodeView) IsSingleDisk() bool
- func (v NodeView) Kernel() string
- func (v NodeView) LastSeenOn() string
- func (v NodeView) LocalIP() string
- func (v NodeView) OS() string
- func (v NodeView) OSType() string
- func (v NodeView) Product() string
- func (v NodeView) PublicIP() string
- func (v NodeView) RAM() string
- func (v NodeView) RAMUsage() string
- func (v NodeView) Rx() string
- func (v NodeView) TotalDisk() string
- func (v NodeView) TotalRAM() string
- func (v NodeView) TotalRx() string
- func (v NodeView) TotalTx() string
- func (v NodeView) Tx() string
- func (v NodeView) Uptime() string
- type RangeFormFieldView
- type ServiceContainer
- type SettingsView
- type SpeedtestHistoryChartView
- type SpeedtestPhaseView
- type SpeedtestView
- type StartNetworkNodeSpeedtestView
- type Template
- type UserAgent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BitrateFormatter ¶
func ExtractHost ¶
func ExtractHost(ectx echo.Context) string
func ExtractPort ¶
func ExtractPort(ectx echo.Context) string
func ExtractReverseProxyIP ¶
func ExtractReverseProxyIP(ectx echo.Context) string
func FromRedirectWithError ¶
Tries to extract an error that may have originated from a self redirect.
func GetLastVisitedPath ¶
Tries to get the last visited path that is present inside a cookie.
func InjectServiceContainer ¶
func InjectServiceContainer( ctx context.Context, container ServiceContainer, ) context.Context
func IsBindToUnspecified ¶
func IsBindToUnspecified(ectx echo.Context) bool
Checks if the server is bind to an unspecified address (e.g., 0.0.0.0)
func IsLocalRequest ¶
func IsLocalRequest(ectx echo.Context) bool
func IsReverseProxyRequest ¶
func IsReverseProxyRequest(ectx echo.Context) bool
func RedirectWithError ¶
Self redirects and appends an error uuid to the url.
func RegisterHandlers ¶
func RegisterHandlers(e *echo.Echo)
func RegisterMiddlewares ¶
func RegisterStaticFiles ¶
func RegisterTemplates ¶
func ServerAddress ¶
func ServerAddress(ectx echo.Context) string
func SetLastVisitedPathCookie ¶
func SetLastVisitedPathCookie(ectx echo.Context)
Sets a cookie with the current request url path.
func SetVirtualHost ¶
func SetVirtualHost(host string)
func StoreHandlerError ¶
func TimeFormatter ¶
func UnsetLastVisitedPathCookie ¶
func UnsetLastVisitedPathCookie(ectx echo.Context)
Unsets the last visited path cookie
func WithVirtualHost ¶
Types ¶
type AxisView ¶
func NewAxisView ¶
type Breakpoint ¶
type Breakpoint int
const ( MobileBreakpoint Breakpoint = 560 TabletBreakpoint Breakpoint = 860 DesktopBreakpoint Breakpoint = 1440 )
func ExtractBreakpoint ¶
func ExtractBreakpoint(ectx echo.Context) (Breakpoint, bool)
func (Breakpoint) ChartSize ¶
func (bp Breakpoint) ChartSize() (int, int)
func (Breakpoint) Desktop ¶
func (bp Breakpoint) Desktop() bool
func (Breakpoint) Mobile ¶
func (bp Breakpoint) Mobile() bool
func (Breakpoint) Tablet ¶
func (bp Breakpoint) Tablet() bool
type ContextView ¶
type ContextView struct {
echo.Context
}
func NewContextView ¶
func NewContextView( ctx echo.Context, ) ContextView
func (ContextView) Breakpoint ¶
func (v ContextView) Breakpoint() Breakpoint
func (ContextView) HasAdminRights ¶
func (v ContextView) HasAdminRights() bool
type DashboardNetworkInviteLinkView ¶
type DashboardNetworkInviteLinkView struct { Code models.JoinNetworkCode URL string }
func NewDashNetworkInviteLinkView ¶
func NewDashNetworkInviteLinkView( url string, code models.JoinNetworkCode, ) DashboardNetworkInviteLinkView
func (DashboardNetworkInviteLinkView) Expiry ¶
func (v DashboardNetworkInviteLinkView) Expiry() string
func (DashboardNetworkInviteLinkView) String ¶
func (v DashboardNetworkInviteLinkView) String() string
type DashboardView ¶
type DashboardView struct { ContextView InviteLink DashboardNetworkInviteLinkView }
func NewDashboardView ¶
func NewDashboardView() DashboardView
func (DashboardView) ShowInviteLink ¶
func (v DashboardView) ShowInviteLink() bool
func (DashboardView) WithContext ¶
func (v DashboardView) WithContext(ctx echo.Context) DashboardView
func (DashboardView) WithInviteLink ¶
func (v DashboardView) WithInviteLink( inviteLink DashboardNetworkInviteLinkView, ) DashboardView
type ElementView ¶
func NewElementView ¶
func NewElementView( id string, value string, ) ElementView
func NewSpeedtestDownloadElementView ¶
func NewSpeedtestDownloadElementView( download models.BitRate, ) ElementView
func NewSpeedtestLatencyElementView ¶
func NewSpeedtestLatencyElementView( latency models.Duration, ) ElementView
func NewSpeedtestStatusElementView ¶
func NewSpeedtestStatusElementView( status string, ) ElementView
func NewSpeedtestUploadElementView ¶
func NewSpeedtestUploadElementView( upload models.BitRate, ) ElementView
type FormFieldView ¶
type FormView ¶
type FormView struct { Groups map[string][]FormFieldView // contains filtered or unexported fields }
func NewFormView ¶
func NewFormView( groups map[string][]FormFieldView, ) FormView
type LineChartView ¶
func NewLineChartView ¶
func NewLineChartView( lines []LineView, xaxis AxisView, yaxis AxisView, ) LineChartView
func (LineChartView) SVG ¶
func (v LineChartView) SVG(width, height int) string
type LineView ¶
type MetaFormFieldView ¶
type MetaFormFieldView struct {
// contains filtered or unexported fields
}
func (MetaFormFieldView) ID ¶
func (v MetaFormFieldView) ID() string
func (MetaFormFieldView) IsRanged ¶
func (v MetaFormFieldView) IsRanged() bool
func (MetaFormFieldView) Label ¶
func (v MetaFormFieldView) Label() string
func (MetaFormFieldView) Tooltip ¶
func (v MetaFormFieldView) Tooltip() string
func (MetaFormFieldView) Type ¶
func (v MetaFormFieldView) Type() string
type NetworkConnectionEndpointView ¶
func NewNetworkConnectionEndpointView ¶
func NewNetworkConnectionEndpointView( host string, port int, ) NetworkConnectionEndpointView
type NetworkJoinView ¶
type NetworkJoinView struct { PublicKeyURL string `json:"public_key_url"` ConnectionEndpointURL string `json:"connection_url"` }
func NewNetworkJoinView ¶
func NewNetworkJoinView( publicKeyUrl string, connectionEndpointUrl string, ) NetworkJoinView
type NetworkNodeActionsView ¶
func NewNetworkNodeActionsView ¶
func NewNetworkNodeActionsView( node models.Node, remove bool, err error, ) NetworkNodeActionsView
type NetworkNodeConnectionsView ¶
type NetworkNodeConnectionsView struct { NodeView Connections []models.Connection ExposedTCPConnections []models.Connection ExposedUDPConnections []models.Connection Err error }
func NewNetworkNodeConnectionsView ¶
func NewNetworkNodeConnectionsView( node models.Node, connections []models.Connection, err error, ) NetworkNodeConnectionsView
type NetworkNodeInformationView ¶
type NetworkNodeInformationView struct { ContextView NodeView }
func NewNetworkNodeInformationView ¶
func NewNetworkNodeInformationView( ctx echo.Context, node models.Node, ) NetworkNodeInformationView
type NetworkNodePackagesView ¶
type NetworkNodeProcessesView ¶
func (NetworkNodeProcessesView) CPU ¶
func (v NetworkNodeProcessesView) CPU() string
func (NetworkNodeProcessesView) Memory ¶
func (v NetworkNodeProcessesView) Memory() string
type NetworkNodeSpeedtestHistoryView ¶
type NetworkNodeSpeedtestHistoryView struct { NodeView ContextView Speedtests []SpeedtestView Chart *SpeedtestHistoryChartView Err error Limit int }
func (NetworkNodeSpeedtestHistoryView) AverageDownloadSpeed ¶
func (v NetworkNodeSpeedtestHistoryView) AverageDownloadSpeed() string
func (NetworkNodeSpeedtestHistoryView) AverageUploadSpeed ¶
func (v NetworkNodeSpeedtestHistoryView) AverageUploadSpeed() string
func (NetworkNodeSpeedtestHistoryView) PeakDownloadSpeedtest ¶
func (v NetworkNodeSpeedtestHistoryView) PeakDownloadSpeedtest() SpeedtestView
type NetworkNodeSpeedtestView ¶
type NetworkNodeSpeedtestView struct { NodeView Speedtest SpeedtestView Err error }
type NetworkView ¶
func NewNetworkView ¶
func NewNetworkView( nodes []models.Node, nodeStatsPollBurst time.Duration, ) NetworkView
type NodeView ¶
func (NodeView) Distribution ¶
func (NodeView) IsSingleDisk ¶
func (NodeView) LastSeenOn ¶
type RangeFormFieldView ¶
type RangeFormFieldView struct { FormFieldView Value int Default int Min int Max int }
func NewRangeFormFieldView ¶
func (RangeFormFieldView) Accepts ¶
func (v RangeFormFieldView) Accepts(d int) bool
type ServiceContainer ¶
type ServiceContainer struct { NodeManager *service.NodeManagerService NodeScheduler *service.NodeSchedulerService NodeCommander *service.NodeCommanderService NodeSpeedtest *service.NodeSpeedtestService MasterConfiguration *service.MasterConfigurationService Network *service.NetworkService Networking *service.NetworkingService Authentication *service.AuthenticationService Authorization *service.AuthorizationService }
Container for all dependencies required in service context.
func ExtractServiceContainer ¶
func ExtractServiceContainer( ctx context.Context, ) *ServiceContainer
type SettingsView ¶
func NewSettingsView ¶
func NewSettingsView( form FormView, error error, ) SettingsView
type SpeedtestHistoryChartView ¶
type SpeedtestHistoryChartView struct { ChartView Breakpoint }
func NewSpeedtestHistoryChartView ¶
func NewSpeedtestHistoryChartView( speedtests []models.Speedtest, breakpoint Breakpoint, ) SpeedtestHistoryChartView
func (SpeedtestHistoryChartView) SVG ¶
func (v SpeedtestHistoryChartView) SVG() string
type SpeedtestPhaseView ¶
type SpeedtestPhaseView models.SpeedtestPhase
func (SpeedtestPhaseView) IsDownloadPhase ¶
func (v SpeedtestPhaseView) IsDownloadPhase() bool
func (SpeedtestPhaseView) IsLatencyPhase ¶
func (v SpeedtestPhaseView) IsLatencyPhase() bool
func (SpeedtestPhaseView) IsUploadPhase ¶
func (v SpeedtestPhaseView) IsUploadPhase() bool
type SpeedtestView ¶
func NewSpeedtestView ¶
func NewSpeedtestView( nodeid string, speedtest models.Speedtest, ) SpeedtestView
func (SpeedtestView) Status ¶
func (v SpeedtestView) Status() SpeedtestPhaseView
func (SpeedtestView) TakenAt ¶
func (v SpeedtestView) TakenAt() string
type StartNetworkNodeSpeedtestView ¶
func NewStartNetworkNodeSpeedtestView ¶
func NewStartNetworkNodeSpeedtestView( node models.Node, err error, ) StartNetworkNodeSpeedtestView
type UserAgent ¶
func (UserAgent) Breakpoint ¶
func (ua UserAgent) Breakpoint() Breakpoint
Source Files
¶
- connection.go
- cookie.go
- ctx.go
- env.go
- handler+dashboard.go
- handler+network.go
- handler+settings.go
- handler+user.go
- handler+util.go
- handler.go
- middleware.go
- param.go
- route.go
- static.go
- template.go
- view+chart.go
- view+dashboard.go
- view+form.go
- view+html.go
- view+network.go
- view+node.go
- view+speedtest.go
- view+util.go
- view.go
- virtual-host.go
- ws.go
Click to show internal directories.
Click to hide internal directories.