beszel

package
v0.97.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package beszel implements the Beszel host-monitoring provider (PocketBase API).

Index

Constants

View Source
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

func NewBeszel(endpoint, token, email, password string) *Beszel

NewBeszel creates a Beszel client. Prefer token; otherwise email+password are used to authenticate on demand. Returns nil when endpoint is empty.

func (*Beszel) GetSystem

func (b *Beszel) GetSystem(ctx context.Context, id string) (*System, error)

GetSystem returns a single system by ID.

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

type UserRecord struct {
	ID    string `json:"id"`
	Email string `json:"email"`
}

UserRecord is the authenticated user record from PocketBase.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL