adguard

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: MIT Imports: 6 Imported by: 1

README

AdGuard Home Go SDK

Release GoDoc License Status Go Report Card

Based on version 0.107 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) (*ADG, error)

NewClient

func (*ADG) CreateClient

func (c *ADG) CreateClient(client Client) (*Client, error)

CreateClient - Create a client

func (*ADG) DeleteClient

func (c *ADG) DeleteClient(clientDelete ClientDelete) error

DeleteClient - Deletes a client

func (*ADG) GetClient

func (c *ADG) GetClient(identifier string) (*Client, error)

GetClient - Returns a client based on an identifier

func (*ADG) UpdateClient

func (c *ADG) UpdateClient(clientUpdate ClientUpdate) (*Client, error)

UpdateClient - Update a client

type AllClients

type AllClients struct {
	Clients       []Client     `json:"clients"`
	ClientAuto    []ClientAuto `json:"auto_clients"`
	SupportedTags []string     `json:"supported_tags"`
}

AllClients

type AuthStruct

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

AuthStruct

type Client

type Client struct {
	Name                     string   `json:"name"`
	Ids                      []string `json:"ids"`
	UseGlobalSettings        bool     `json:"use_global_settings"`
	FilteringEnabled         bool     `json:"filtering_enabled"`
	ParentalEnabled          bool     `json:"parental_enabled"`
	SafebrowsingEnabled      bool     `json:"safebrowsing_enabled"`
	SafesearchEnabled        bool     `json:"safesearch_enabled"`
	UseGlobalBlockedServices bool     `json:"use_global_blocked_services"`
	BlockedServices          []string `json:"blocked_services"`
	Upstreams                []string `json:"upstreams"`
	Tags                     []string `json:"tags"`
}

Client

type ClientAuto

type ClientAuto struct {
	Name      string            `json:"name"`
	Ip        string            `json:"ip"`
	Source    string            `json:"source"`
	WhoisInfo map[string]string `json:"whois_info"`
}

ClientAuto

type ClientDelete

type ClientDelete struct {
	Name string `json:"name"`
}

ClientDelete

type ClientUpdate

type ClientUpdate struct {
	Name string `json:"name"`
	Data Client `json:"data"`
}

ClientUpdate

Jump to

Keyboard shortcuts

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