Documentation
¶
Overview ¶
Package beszel implements the Beszel host-monitoring provider (PocketBase API).
Index ¶
Constants ¶
const ( ID = "beszel" EndpointKey = "endpoint" TokenKey = "token" EmailKey = "email" PasswordKey = "password" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthResponse ¶
type AuthResponse struct {
Token string `json:"token"`
Record *UserRecord `json:"record"`
}
AuthResponse is returned by PocketBase password authentication.
type Beszel ¶
type Beszel struct {
// contains filtered or unexported fields
}
Beszel is an HTTP client for the Beszel hub (PocketBase).
func GetClient ¶
func GetClient() *Beszel
GetClient builds a Beszel client from vendors.beszel config. Returns nil when endpoint is not configured.
func NewBeszel ¶
NewBeszel creates a Beszel client. Prefer token; otherwise email+password are used to authenticate on demand. Returns nil when endpoint is empty.
func (*Beszel) ListSystems ¶
func (b *Beszel) ListSystems(ctx context.Context) (*SystemList, error)
ListSystems returns monitored systems (first page).
type System ¶
type System struct {
ID string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
Host string `json:"host"`
Port string `json:"port"`
Info any `json:"info"`
}
System is a Beszel monitored host.
type SystemList ¶
type SystemList struct {
Page int `json:"page"`
PerPage int `json:"perPage"`
TotalItems int `json:"totalItems"`
TotalPages int `json:"totalPages"`
Items []System `json:"items"`
}
SystemList is a paginated list of Beszel systems.
type UserRecord ¶
UserRecord is the authenticated user record from PocketBase.