websvc

package
v0.108.0-b.7 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package websvc contains the AdGuard Home web service.

TODO(a.garipov): Add tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// TLS is the optional TLS configuration.  If TLS is not nil,
	// SecureAddresses must not be empty.
	TLS *tls.Config

	// Addresses are the addresses on which to serve the plain HTTP API.
	Addresses []*netutil.IPPort

	// SecureAddresses are the addresses on which to serve the HTTPS API.  If
	// SecureAddresses is not empty, TLS must not be nil.
	SecureAddresses []*netutil.IPPort

	// Timeout is the timeout for all server operations.
	Timeout time.Duration
}

Config is the AdGuard Home web service configuration structure.

type Service

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

Service is the AdGuard Home web service. A nil *Service is a valid service that does nothing.

func New

func New(c *Config) (svc *Service)

New returns a new properly initialized *Service. If c is nil, svc is a nil *Service that does nothing.

func (*Service) Addrs

func (svc *Service) Addrs() (addrs []string)

Addrs returns all addresses on which this server serves the HTTP API. Addrs must not be called until Start returns.

func (*Service) Shutdown

func (svc *Service) Shutdown(ctx context.Context) (err error)

Shutdown implements the agh.Service interface for *Service. svc may be nil.

func (*Service) Start

func (svc *Service) Start() (err error)

Start implements the agh.Service interface for *Service. svc may be nil. After Start exits, all HTTP servers have tried to start, possibly failing and writing error messages to the log.

Jump to

Keyboard shortcuts

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