home

package
v0.107.45 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: GPL-3.0 Imports: 84 Imported by: 0

Documentation

Overview

Package home contains AdGuard Home's HTTP API methods.

Index

Constants

View Source
const MaxFileSize = 1024 * 1024

MaxFileSize is a maximum file length in bytes.

View Source
const PasswordMinRunes = 8

PasswordMinRunes is the minimum length of user's password in runes.

Variables

View Source
var Context homeContext

Context - a global context object

View Source
var GLMode bool

GLMode - enable GL-Inet compatibility mode

Functions

func Main

func Main(clientBuildFS fs.FS)

Main is the entry point

func RegisterAuthHandlers

func RegisterAuthHandlers()

RegisterAuthHandlers - register handlers

Types

type Auth

type Auth struct {
	// contains filtered or unexported fields
}

Auth - global object

func InitAuth

func InitAuth(dbFilename string, users []webUser, sessionTTL uint32, rateLimiter *authRateLimiter) *Auth

InitAuth - create a global object

func (*Auth) Close

func (a *Auth) Close()

Close - close module

type DHCP added in v0.107.33

type DHCP interface {
	// Leases returns all the DHCP leases.
	Leases() (leases []*dhcpsvc.Lease)

	// HostByIP returns the hostname of the DHCP client with the given IP
	// address.  The address will be netip.Addr{} if there is no such client,
	// due to an assumption that a DHCP client must always have a hostname.
	HostByIP(ip netip.Addr) (host string)

	// MACByIP returns the MAC address for the given IP address leased.  It
	// returns nil if there is no such client, due to an assumption that a DHCP
	// client must always have a MAC address.
	MACByIP(ip netip.Addr) (mac net.HardwareAddr)
}

DHCP is an interface for accessing DHCP lease data the [clientsContainer] needs.

type Theme added in v0.107.22

type Theme string

Theme is an enum of all allowed UI themes.

const (
	ThemeAuto  Theme = "auto"
	ThemeLight Theme = "light"
	ThemeDark  Theme = "dark"
)

Allowed Theme values.

Keep in sync with client/src/helpers/constants.js.

func (*Theme) UnmarshalText added in v0.107.22

func (t *Theme) UnmarshalText(b []byte) (err error)

UnmarshalText implements encoding.TextUnmarshaler interface for *Theme.

type UID added in v0.107.44

type UID uuid.UUID

UID is the type for the unique IDs of persistent clients.

func NewUID added in v0.107.44

func NewUID() (uid UID, err error)

NewUID returns a new persistent client UID. Any error returned is an error from the cryptographic randomness reader.

func (UID) MarshalText added in v0.107.44

func (uid UID) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler for UID.

func (*UID) UnmarshalText added in v0.107.44

func (uid *UID) UnmarshalText(data []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for UID.

Jump to

Keyboard shortcuts

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