alibaba/kt-connect

View on GitHub
pkg/kt/service/tun/types.go

Summary

Maintainability
A
0 mins
Test Coverage
package tun

// Tunnel ...
type Tunnel interface {
    CheckContext() error
    ToSocks(sockAddr string) error
    SetRoute(ipRange []string, excludeIpRange []string) error
    CheckRoute(ipRange []string) []string
    RestoreRoute() error
    GetName() string
}

// Cli the singleton type
type Cli struct {}
var instance *Cli

// Ins get singleton instance
func Ins() Tunnel {
    if instance == nil {
        instance = &Cli{}
    }
    return instance
}