adguard

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: MIT Imports: 13 Imported by: 2

README

AdGuard Home Go SDK

Release GoDoc License Status Go Report Card codecov

Updated to version 0.107.60 of the upstream API.

This was written primarily for use in my Terraform provider for AdGuard Home.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ADG

type ADG struct {
	HostURL    string
	HTTPClient *http.Client
	Auth       AuthStruct
}

ADG Client

func NewClient

func NewClient(host, username, password, scheme *string, timeout *int, enableInsecureSkipVerify ...*bool) (*ADG, error)

NewClient

func (*ADG) AccessList added in v1.0.0

func (c *ADG) AccessList() (*models.AccessList, error)

AccessList - List (dis)allowed clients, blocked hosts, etc

func (*ADG) AccessSet added in v1.0.0

func (c *ADG) AccessSet(accessList models.AccessList) error

AccessSet - Set (dis)allowed clients, blocked hosts, etc

func (*ADG) AppleDohMobileconfig added in v1.0.0

func (c *ADG) AppleDohMobileconfig(host, clientId *string) (string, error)

AppleDohMobileconfig - Get DNS over HTTPS .mobileconfig

func (*ADG) AppleDotMobileconfig added in v1.0.0

func (c *ADG) AppleDotMobileconfig(host, clientId *string) (string, error)

AppleDotMobileconfig - Get DNS over TLS .mobileconfig

func (*ADG) BlockedServicesAll added in v1.0.0

func (c *ADG) BlockedServicesAll() (*models.BlockedServicesAll, error)

BlockedServicesAll - Get available services to use for blocking

func (*ADG) BlockedServicesGet added in v1.0.0

func (c *ADG) BlockedServicesGet() (*models.BlockedServicesSchedule, error)

BlockedServicesGet - Get blocked services

func (*ADG) BlockedServicesUpdate added in v1.0.0

func (c *ADG) BlockedServicesUpdate(blockedServicesSchedule models.BlockedServicesSchedule) error

BlockedServicesUpdate - Update blocked services

func (*ADG) CacheClear added in v1.0.0

func (c *ADG) CacheClear() error

CacheClear - Clear DNS cache

func (*ADG) Clients added in v1.0.0

func (c *ADG) Clients() (*models.Clients, error)

Clients - Get information about configured clients

func (*ADG) ClientsAdd added in v1.0.0

func (c *ADG) ClientsAdd(client models.Client) error

ClientsAdd - Add a new client

func (*ADG) ClientsDelete added in v1.0.0

func (c *ADG) ClientsDelete(clientDelete models.ClientDelete) error

ClientsDelete - Remove a client

func (*ADG) ClientsSearch added in v1.0.0

func (c *ADG) ClientsSearch(identifiers []string) (*models.ClientsFindResponse, error)

ClientsSearch - Get information about clients by their IP addresses, CIDR, MAC addresses, or ClientIDs

func (*ADG) ClientsUpdate added in v1.0.0

func (c *ADG) ClientsUpdate(clientUpdate models.ClientUpdate) error

ClientsUpdate - Update client information

func (*ADG) DhcpAddStaticLease added in v1.0.0

func (c *ADG) DhcpAddStaticLease(dhcpStaticLease models.DhcpStaticLease) error

DhcpAddStaticLease - Adds a static lease

func (*ADG) DhcpFindActiveDhcp added in v1.0.0

func (c *ADG) DhcpFindActiveDhcp(dhcpFindActiveReq models.DhcpFindActiveReq) (*models.DhcpSearchResult, error)

DhcpFindActiveDhcp - Searches for an active DHCP server on the network

func (*ADG) DhcpInterfaces added in v1.0.0

func (c *ADG) DhcpInterfaces() (*models.NetInterfaces, error)

DhcpInterfaces - Gets the available DHCP interfaces

func (*ADG) DhcpRemoveStaticLease added in v1.0.0

func (c *ADG) DhcpRemoveStaticLease(dhcpStaticLease models.DhcpStaticLease) error

DhcpRemoveStaticLease - Removes a static lease

func (*ADG) DhcpReset added in v1.0.0

func (c *ADG) DhcpReset() error

DhcpReset - Reset DHCP configuration

func (*ADG) DhcpResetLeases added in v1.0.0

func (c *ADG) DhcpResetLeases() error

DhcpResetLeases - Reset DHCP leases

func (*ADG) DhcpSetConfig added in v1.0.0

func (c *ADG) DhcpSetConfig(dhcpConfig models.DhcpConfig) error

DhcpSetConfig - Updates the current DHCP server configuration

func (*ADG) DhcpStatus added in v1.0.0

func (c *ADG) DhcpStatus() (*models.DhcpStatus, error)

DhcpStatus - Gets the current DHCP settings and status

func (*ADG) DhcpUpdateStaticLease added in v1.0.0

func (c *ADG) DhcpUpdateStaticLease(dhcpStaticLease models.DhcpStaticLease) error

DhcpUpdateStaticLease - Updates a static lease

func (*ADG) DnsConfig added in v1.0.0

func (c *ADG) DnsConfig(dnsConfig models.DNSConfig) error

DnsConfig - Set general DNS parameters

func (*ADG) DnsInfo added in v1.0.0

func (c *ADG) DnsInfo() (*models.DNSInfo, error)

DnsInfo - Get genedal DNS parameters

func (*ADG) FilteringAddUrl added in v1.0.0

func (c *ADG) FilteringAddUrl(filterData models.AddUrlRequest) error

FilteringAddUrl - Add filter URL or an absolute file path

func (*ADG) FilteringCheckHost added in v1.0.0

func (c *ADG) FilteringCheckHost(name *string, client *string, qtype *string) (*models.FilterCheckHostResponse, error)

FilteringCheckHost - Check if host name is filtered

func (*ADG) FilteringConfig added in v1.0.0

func (c *ADG) FilteringConfig(filterConfig models.FilterConfig) error

FilteringConfig - Set filtering parameters

func (*ADG) FilteringRefresh added in v1.0.0

func (c *ADG) FilteringRefresh(filterRefreshRequest models.FilterRefreshRequest) (*models.FilterRefreshResponse, error)

FilteringRefresh - Set URL parameters

func (*ADG) FilteringRemoveUrl added in v1.0.0

func (c *ADG) FilteringRemoveUrl(filterDelete models.RemoveUrlRequest) error

FilteringRemoveUrl - Remove filter URL

func (*ADG) FilteringSetRules added in v1.0.0

func (c *ADG) FilteringSetRules(rules models.SetRulesRequest) error

FilteringSetRules - Set user-defined filter rules

func (*ADG) FilteringSetUrl added in v1.0.0

func (c *ADG) FilteringSetUrl(filterUpdate models.FilterSetUrl) error

FilteringSetUrl - Set URL parameters

func (*ADG) FilteringStatus added in v1.0.0

func (c *ADG) FilteringStatus() (*models.FilterStatus, error)

FilteringStatus - Get filtering parameters

func (*ADG) InstallCheckConfig added in v1.0.0

func (c *ADG) InstallCheckConfig(checkConfigRequest models.CheckConfigRequest) (*models.CheckConfigResponse, error)

InstallCheckConfig - Checks configuration

func (*ADG) InstallConfigure added in v1.0.0

func (c *ADG) InstallConfigure(initialConfiguration models.InitialConfiguration) error

InstallConfigure - Applies the initial configuration

func (*ADG) InstallGetAddresses added in v1.0.0

func (c *ADG) InstallGetAddresses() (*models.AddressesInfo, error)

InstallGetAddresses - Gets the network interfaces information

func (*ADG) Login added in v1.0.0

func (c *ADG) Login(login models.Login) error

Login - Perform administrator login

func (*ADG) Logout added in v1.0.0

func (c *ADG) Logout() error

Logout - Perform administrator logout

func (*ADG) ParentalDisable added in v1.0.0

func (c *ADG) ParentalDisable() error

ParentalDisable - Disable parental filtering

func (*ADG) ParentalEnable added in v1.0.0

func (c *ADG) ParentalEnable() error

ParentalEnable - Enable parental filtering

func (*ADG) ParentalStatus added in v1.0.0

func (c *ADG) ParentalStatus() (*models.ParentalStatus, error)

ParentalStatus - Get parental filtering status

func (*ADG) Profile added in v1.0.0

func (c *ADG) Profile() (*models.ProfileInfo, error)

Profile

func (*ADG) ProfileUpdate added in v1.0.0

func (c *ADG) ProfileUpdate(profileInfo models.ProfileInfo) error

ProfileUpdate - Updates current user info

func (*ADG) Protection added in v1.0.0

func (c *ADG) Protection(setProtectionRequest models.SetProtectionRequest) error

Protection - Set protection state and duration

func (*ADG) Querylog added in v1.0.0

func (c *ADG) Querylog(olderThan *string, offset *int, limit *int, search *string, responseStatus *string) (*models.QueryLog, error)

Querylog - Get DNS server query log.

func (*ADG) QuerylogClear added in v1.0.0

func (c *ADG) QuerylogClear() error

QuerylogClear - Clear the query log

func (*ADG) QuerylogConfig added in v1.0.0

func (c *ADG) QuerylogConfig() (*models.GetQueryLogConfigResponse, error)

QuerylogConfig - Get query log parameters

func (*ADG) QuerylogConfigUpdate added in v1.0.0

func (c *ADG) QuerylogConfigUpdate(getQueryLogConfigResponse models.GetQueryLogConfigResponse) error

QuerylogConfigUpdate - Set query log parameters

func (*ADG) RewriteAdd added in v1.0.0

func (c *ADG) RewriteAdd(rewriteEntry models.RewriteEntry) error

RewriteAdd - Add a new Rewrite rule

func (*ADG) RewriteDelete added in v1.0.0

func (c *ADG) RewriteDelete(rewriteEntry models.RewriteEntry) error

RewriteDelete - Remove a Rewrite rule

func (*ADG) RewriteList added in v1.0.0

func (c *ADG) RewriteList() (*models.RewriteList, error)

RewriteList - Get list of Rewrite rules

func (*ADG) RewriteUpdate added in v1.0.0

func (c *ADG) RewriteUpdate(rewriteUpdate models.RewriteUpdate) error

RewriteUpdate - Update a Rewrite rule

func (*ADG) SafeBrowsingDisable added in v1.0.0

func (c *ADG) SafeBrowsingDisable() error

SafeBrowsingDisable - Disable safebrowsing

func (*ADG) SafeBrowsingEnable added in v1.0.0

func (c *ADG) SafeBrowsingEnable() error

SafeBrowsingEnable - Enable safebrowsing

func (*ADG) SafeBrowsingStatus added in v1.0.0

func (c *ADG) SafeBrowsingStatus() (*models.Enabled, error)

SafeBrowsingStatus - Get safebrowsing status

func (*ADG) SafeSearchSettings added in v1.0.0

func (c *ADG) SafeSearchSettings(safeSearchConfig models.SafeSearchConfig) error

SafeSearchSettings - Update safesearch settings

func (*ADG) SafeSearchStatus added in v1.0.0

func (c *ADG) SafeSearchStatus() (*models.SafeSearchConfig, error)

SafeSearchStatus - Get safesearch status

func (*ADG) Stats added in v1.0.0

func (c *ADG) Stats() (*models.Stats, error)

Stats - Get DNS server statistics

func (*ADG) StatsConfig added in v1.0.0

func (c *ADG) StatsConfig() (*models.GetStatsConfigResponse, error)

StatsConfig - Get statistics parameters

func (*ADG) StatsConfigUpdate added in v1.0.0

func (c *ADG) StatsConfigUpdate(statsConfig models.GetStatsConfigResponse) error

StatsConfigUpdate - Sets statistics parameters

func (*ADG) StatsReset added in v1.0.0

func (c *ADG) StatsReset() error

StatsReset - Reset all statistics to zeroes

func (*ADG) Status added in v1.0.0

func (c *ADG) Status() (*models.ServerStatus, error)

Status - Get DNS server current status and general settings

func (*ADG) TestUpstreamDns added in v1.0.0

func (c *ADG) TestUpstreamDns(upstreamsConfig models.UpstreamsConfig) (*models.UpstreamsConfigResponse, error)

TestUpstreamDns - Test upstream configuration

func (*ADG) TlsConfigure added in v1.0.0

func (c *ADG) TlsConfigure(tlsConfig models.TlsConfig) (*models.TlsConfig, error)

TlsConfigure - Updates current TLS configuration

func (*ADG) TlsStatus added in v1.0.0

func (c *ADG) TlsStatus() (*models.TlsConfig, error)

TlsStatus - Returns TLS configuration and its status

func (*ADG) TlsValidate added in v1.0.0

func (c *ADG) TlsValidate(tlsConfig models.TlsConfig) (*models.TlsConfig, error)

TlsValidate - Checks if the current TLS configuration is valid

func (*ADG) Update added in v1.0.0

func (c *ADG) Update() error

Update - Begin auto-upgrade procedure

func (*ADG) VersionJson added in v1.0.0

func (c *ADG) VersionJson(getVersionRequest models.GetVersionRequest) (*models.VersionInfo, error)

VersionJson - Gets information about the latest available version of AdGuard

type AuthStruct

type AuthStruct struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

AuthStruct

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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