publicip

package
v0.0.0-...-ddd9f4d Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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(settings settings.PublicIP, puid, pgid int,
	httpClient *http.Client, logger Logger,
) (loop *Loop, err error)

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) Fetcher

func (l *Loop) Fetcher() (fetcher *api.ResilientFetcher)

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) RunOnce

func (l *Loop) RunOnce(ctx context.Context) (err error)

func (*Loop) Start

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

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