openvpn

package
v1.21.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	SchemeTCP  = "tcp"
	SchemeUnix = "unix"
)

Variables

View Source
var (
	ErrTimeout              = errors.New("timeout")
	ErrEmptyResponse        = errors.New("empty response")
	ErrUnknownProtocol      = errors.New("unknown protocol")
	ErrInvalidPassword      = errors.New("invalid password")
	ErrErrorResponse        = errors.New("error response")
	ErrConnectionTerminated = errors.New("OpenVPN management interface connection terminated")
)

Functions

This section is empty.

Types

type Client added in v1.0.0

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

func New added in v1.19.2

func New(ctx context.Context, logger *slog.Logger, conf config.Config, oauth2Client *oauth2.Provider) *Client

func (*Client) AcceptClient added in v1.8.0

func (c *Client) AcceptClient(logger *slog.Logger, client state.ClientIdentifier, username string)

func (*Client) Connect added in v1.0.0

func (c *Client) Connect() error

func (*Client) DenyClient added in v1.8.0

func (c *Client) DenyClient(logger *slog.Logger, client state.ClientIdentifier, reason string)

func (*Client) SendCommand added in v1.0.0

func (c *Client) SendCommand(cmd string, passTrough bool) (string, error)

SendCommand passes command to a given connection (adds logging and EOL character) and returns the response.

func (*Client) SendCommandf added in v1.6.0

func (c *Client) SendCommandf(format string, a ...any) (string, error)

SendCommandf passes command to a given connection (adds logging and EOL character) and returns the response.

func (*Client) Shutdown added in v1.3.0

func (c *Client) Shutdown()

Shutdown shutdowns the client connection.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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