api

package
v0.0.0-...-68731fb Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StatsCPU *cpu.Stats

Functions

func ApplySettings

func ApplySettings(settings SettingsResponse) error

func Auth

func Auth(c *fiber.Ctx) error

func Log

func Log(c *fiber.Ctx) error

func Portal

func Portal(c *fiber.Ctx) error

func Portals

func Portals(c *fiber.Ctx) error

func SettingsGet

func SettingsGet(c *fiber.Ctx) error

func SettingsPost

func SettingsPost(c *fiber.Ctx) error

func Stats

func Stats(c *fiber.Ctx) error

func VerifyToken

func VerifyToken(c *fiber.Ctx) bool

Types

type Error

type Error struct {
	Code    int
	Func    string
	Err     error
	Message string
	Details []any
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Fields

func (e *Error) Fields() map[string]interface{}

type Response

type Response struct {
	Message string `json:"message,omitempty"`
	Data    any    `json:"data"`
}

type SettingsInterfaceResponse

type SettingsInterfaceResponse struct {
	Mode         string `json:"mode"`
	Ready        bool   `json:"ready"`
	SSID         string `json:"ssid"`
	Password     string `json:"password"`
	Channel      int    `json:"channel"`
	Portal       bool   `json:"portal"`
	PortalSource string `json:"portal_source" mapstructure:"portal_source" koanf:"portal_source"`
}

type SettingsResponse

type SettingsResponse struct {
	Interface map[string]SettingsInterfaceResponse `json:"iface" mapstructure:"iface" koanf:"iface"`
}

type StatsHotspotResponse

type StatsHotspotResponse struct {
	SSID   string `json:"ssid"`
	Portal bool   `json:"portal"`
}

type StatsResponse

type StatsResponse struct {
	Cpu      float64              `json:"cpu"`
	MemTotal uint64               `json:"mem_total"`
	MemUsed  uint64               `json:"mem_used"`
	Hotspot  StatsHotspotResponse `json:"hotspot"`
}

Jump to

Keyboard shortcuts

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