tun

package
v0.3.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package tun is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RestoreDnsServer

func RestoreDnsServer() error

RestoreDnsServer remove the nameservers added by ktctl

Types

type Cli

type Cli struct{}

Cli ...

func (*Cli) GetName

func (s *Cli) GetName() string

func (*Cli) SetDnsServer

func (s *Cli) SetDnsServer(dnsServers []string, isDebug bool) error

SetDnsServer set dns server records

func (*Cli) SetRoute

func (s *Cli) SetRoute(ipRange []string, isDebug bool) error

SetRoute let specified ip range route to tun device

func (*Cli) ToSocks

func (s *Cli) ToSocks(sockAddr string, isDebug bool) error

ToSocks create a tun and connect to socks endpoint

type CliInterface

type CliInterface interface {
	ToSocks(sockAddr string, isDebug bool) error
	SetRoute(ipRange []string, isDebug bool) error
	SetDnsServer(dnsServers []string, isDebug bool) error
	GetName() string
}

CliInterface ...

type MockCliInterface

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

MockCliInterface is a mock of CliInterface interface.

func NewMockCliInterface

func NewMockCliInterface(ctrl *gomock.Controller) *MockCliInterface

NewMockCliInterface creates a new mock instance.

func (*MockCliInterface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockCliInterface) SetDnsServer

func (m *MockCliInterface) SetDnsServer(dnsServers []string) error

SetDnsServer mocks base method.

func (*MockCliInterface) SetRoute

func (m *MockCliInterface) SetRoute(ipRange []string) error

SetRoute mocks base method.

func (*MockCliInterface) ToSocks

func (m *MockCliInterface) ToSocks(sockAddr string) error

ToSocks mocks base method.

type MockCliInterfaceMockRecorder

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

MockCliInterfaceMockRecorder is the mock recorder for MockCliInterface.

func (*MockCliInterfaceMockRecorder) SetDnsServer

func (mr *MockCliInterfaceMockRecorder) SetDnsServer(dnsServers interface{}) *gomock.Call

SetDnsServer indicates an expected call of SetDnsServer.

func (*MockCliInterfaceMockRecorder) SetRoute

func (mr *MockCliInterfaceMockRecorder) SetRoute(ipRange interface{}) *gomock.Call

SetRoute indicates an expected call of SetRoute.

func (*MockCliInterfaceMockRecorder) ToSocks

func (mr *MockCliInterfaceMockRecorder) ToSocks(sockAddr interface{}) *gomock.Call

ToSocks indicates an expected call of ToSocks.

Jump to

Keyboard shortcuts

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