client

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDefaultLogger

func SetDefaultLogger(logger *logrus.Logger)

SetDefaultLogger is to set logger for vpn client.

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option is to use a dependency injection for handler.

type OptionFunc

type OptionFunc func(c *config)

OptionFunc is a function for Option interface.

func WithAuthMethod

func WithAuthMethod(f auth.ClientAuthMethod) OptionFunc

WithAuthMethod returns OptionFunc for inserting auth method.

func WithGRPCInsecure added in v1.2.0

func WithGRPCInsecure(b bool) OptionFunc

WithGRPCInsecure returns OptionFunc for inserting grpc insecure.

func WithSelfSignedCertification added in v1.2.0

func WithSelfSignedCertification(cert string) OptionFunc

WithSelfSignedCertification returns OptionFunc for inserting grpc custom certification

func WithServerAddr

func WithServerAddr(addr string) OptionFunc

WithServerAddr returns OptionFunc for inserting server addr.

func WithServerPort

func WithServerPort(port string) OptionFunc

WithServerPort returns OptionFunc for inserting server port.

type Rollback

type Rollback struct {
	Routes []route
	// contains filtered or unexported fields
}

func (*Rollback) AddRoute

func (r *Rollback) AddRoute(destination net.IP, via net.IP, dev string)

AddRoute adds a route to the deletion set when it is reset.

func (*Rollback) Close

func (r *Rollback) Close()

Close is to rollback applied network settings.

func (*Rollback) ResetGatewayOSX

func (r *Rollback) ResetGatewayOSX(tun *water.Interface, gw string)

ResetGatewayOSX tells the rollback object what gateway should be set on exit.

type VpnClient

type VpnClient interface {
	Run() error
	Close() error
	JWT() string
	MyVpnIp() string
}

VpnClient is an interface for connecting to VPN server.

func NewVpnClient

func NewVpnClient(opts ...Option) (VpnClient, error)

NewVpnClient returns new vpn client.

Jump to

Keyboard shortcuts

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