vpn

package
v0.0.0-...-215383d Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConnectionError = errors.New("fail To connect to VPN")

Functions

func NewVpnModel

func NewVpnModel(s *spinner.Model, c Connection) tea.Model

NewVpnModel creates a model with a connection that defines how to connection to a network

Types

type Connection

type Connection interface {
	//EnsureConnected checks if you are logged to the connection.
	//
	//If the connection can not be established, should return an error.
	//
	//The connection process must be executed synchronously, if this function returns no error, that's mean that the
	//connection is established.
	EnsureConnected() error

	//Name of the connection for log purpose
	Name() string
}

Connection is an interface that represent an object that can connect to a Network

type ConnectionEstablished

type ConnectionEstablished struct{}

type ConnectionStatus

type ConnectionStatus = int
const (
	Connected        ConnectionStatus = iota
	ConnectionFailed ConnectionStatus = iota
	Connecting       ConnectionStatus = iota
)

type NetworkManagerConnexion

type NetworkManagerConnexion struct {
	ConnectionName string
}

func (NetworkManagerConnexion) ConnectToVPN

func (c NetworkManagerConnexion) ConnectToVPN() error

func (NetworkManagerConnexion) EnsureConnected

func (c NetworkManagerConnexion) EnsureConnected() error

func (NetworkManagerConnexion) IsConnectedToVPN

func (c NetworkManagerConnexion) IsConnectedToVPN() bool

func (NetworkManagerConnexion) Name

Jump to

Keyboard shortcuts

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