cli

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: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProviderUnspecified       = errors.New("VPN provider to format was not specified")
	ErrMultipleProvidersToFormat = errors.New("more than one VPN provider to format were specified")
)
View Source
var (
	ErrModeUnspecified     = errors.New("at least one of -enduser or -maintainer must be specified")
	ErrNoProviderSpecified = errors.New("no provider was specified")
)

Functions

This section is empty.

Types

type CLI

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

func New

func New() *CLI

func (*CLI) CI

func (c *CLI) CI(context.Context) error

func (*CLI) ClientKey

func (c *CLI) ClientKey(args []string) error

func (*CLI) FormatServers

func (c *CLI) FormatServers(args []string) error

func (*CLI) GenKey

func (c *CLI) GenKey(args []string) (err error)

func (*CLI) HealthCheck

func (c *CLI) HealthCheck(ctx context.Context, reader *reader.Reader, _ Warner) (err error)

func (*CLI) OpenvpnConfig

func (c *CLI) OpenvpnConfig(logger OpenvpnConfigLogger, reader *reader.Reader,
	ipv6Checker IPv6Checker,
) error

func (*CLI) Update

func (c *CLI) Update(ctx context.Context, args []string, logger UpdaterLogger) error

type IPFetcher

type IPFetcher interface {
	String() string
	CanFetchAnyIP() bool
	FetchInfo(ctx context.Context, ip netip.Addr) (data models.PublicIP, err error)
}

type IPv6Checker

type IPv6Checker interface {
	IsIPv6Supported() (supported bool, err error)
}

type OpenvpnConfigLogger

type OpenvpnConfigLogger interface {
	Info(s string)
	Warn(s string)
}

type ParallelResolver

type ParallelResolver interface {
	Resolve(ctx context.Context, settings resolver.ParallelSettings) (
		hostToIPs map[string][]netip.Addr, warnings []string, err error)
}

type Source

type Source interface {
	Read() (settings settings.Settings, err error)
	ReadHealth() (health settings.Health, err error)
	String() string
}

type Unzipper

type Unzipper interface {
	FetchAndExtract(ctx context.Context, url string) (
		contents map[string][]byte, err error)
}

type UpdaterLogger

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

type Warner

type Warner interface {
	Warn(s string)
}

Jump to

Keyboard shortcuts

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