service

package
v0.0.0-...-3a45640 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidService = errors.New("invalid service definition")

Functions

This section is empty.

Types

type Config

type Config struct {
	Interval time.Duration `json:"interval" yaml:"interval"`
	Hosts    []Host        `json:"hosts" yaml:"hosts"`
}

type Host

type Host struct {
	Host     string `json:"host" yaml:"host"`
	User     string `json:"user" yaml:"user"`
	Password string `json:"password" yaml:"password"`
}

type NetworkResult

type NetworkResult struct {
	IP       string `json:"ip"`
	Type     string `json:"type"`
	Subtype  string `json:"subtype"`
	Via      string `json:"via"`
	Padding  string `json:"padding"`
	Asn      string `json:"asn"`
	Asnlist  string `json:"asnlist"`
	AsnName  string `json:"asn_name"`
	Country  string `json:"country"`
	Protocol string `json:"protocol"`
}

type Option

type Option func(*Service) error

func WithConfig

func WithConfig(path string) Option

func WithEndpoint

func WithEndpoint(addr string) Option

WithEndpoint defines the HTTP address to be called when the service is attempting to update the DNS configuration.

func WithLogger

func WithLogger(l *tracelog.TraceLogger) Option

func WithMeter

func WithMeter(meter metric.Meter) Option

func WithTracer

func WithTracer(tr trace.Tracer) Option

type Service

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

func New

func New(options ...Option) (*Service, error)

New validates that the required system settings have been configured for the service to run.

func (*Service) Run

func (s *Service) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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