vpn

package
v0.0.0-...-c936f35 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Overview

Package vpn provides an i3bar module for openvpn information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

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

Module represents a VPN bar module.

func DefaultInterface

func DefaultInterface() *Module

DefaultInterface constructs an instance of the VPN module for "tun0", the usual interface for VPNs.

func New

func New(iface string) *Module

New constructs an instance of the VPN module for the specified interface.

func (*Module) Output

func (m *Module) Output(outputFunc func(State) bar.Output) *Module

Output configures a module to display the output of a user-defined function.

func (*Module) Stream

func (m *Module) Stream(s bar.Sink)

Stream starts the module.

type State

type State int

State represents the vpn state.

const (
	Disconnected State = iota
	Waiting
	Connected
)

Valid states for the vpn

func (State) Connected

func (s State) Connected() bool

Connected returns true if the VPN is connected.

func (State) Disconnected

func (s State) Disconnected() bool

Disconnected returns true if the VPN is off.

Jump to

Keyboard shortcuts

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