publicip

package
v0.0.0-...-1e25372 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher

type Fetcher interface {
	FetchInfo(ctx context.Context, ip netip.Addr) (
		result models.PublicIP, err error)
}

type Logger

type Logger interface {
	Info(s string)
	Warn(s string)
	Error(s string)
}

type Loop

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

func NewLoop

func NewLoop(fetcher Fetcher, logger Logger,
	settings settings.PublicIP, puid, pgid int) *Loop

func (*Loop) ClearData

func (l *Loop) ClearData() (err error)

ClearData is used when the VPN connection goes down and the public IP is not known anymore.

func (*Loop) GetData

func (l *Loop) GetData() (data models.PublicIP)

GetData returns the public IP data obtained from the last fetch. It is notably used by the HTTP control server.

func (*Loop) Start

func (l *Loop) Start(_ context.Context) (_ <-chan error, err error)

func (*Loop) StartSingleRun

func (l *Loop) StartSingleRun()

func (*Loop) Stop

func (l *Loop) Stop() (err error)

func (*Loop) String

func (l *Loop) String() string

func (*Loop) UpdateWith

func (l *Loop) UpdateWith(partialUpdate settings.PublicIP) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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