models

package
v0.0.0-...-0f1ebe4 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthMethod

type AuthMethod interface {
	GetName() string

	Init() error
	Close() error
	Check(username, password string) (bool, error)
}

type AuthPlainTextConfig

type AuthPlainTextConfig struct {
	Path       string
	HashMethod string
}

type AuthSQLConfig

type AuthSQLConfig struct {
	DBType           string
	DBConnection     string
	DBMaxConnections int

	HashMethod   string
	CacheTimeout int64

	QuerySelectUser string
}

type Config

type Config struct {
	Server        ServerConfig
	AuthSQL       AuthSQLConfig
	AuthPlainText AuthPlainTextConfig
	Subnets       SubnetsConfig
}

func (*Config) GetAuthMethods

func (c *Config) GetAuthMethods() ([]AuthMethod, error)

type ProxyClient

type ProxyClient interface {
	Handshake(reader *bufio.Reader) error
	Auth(reader *bufio.Reader, authMethods []AuthMethod) (*User, error)
	Request(reader *bufio.Reader) error
	Work() error
}

type ServerConfig

type ServerConfig struct {
	UID string
	GID string

	Bind    string
	Timeout int
	Buffer  int

	PrivateKey string
	PublicKey  string

	AllowAnonymous bool
	AllowHTTP      bool

	AllowTCPBind      bool
	TCPBindAddr       string
	TCPBindPortsStart int
	TCPBindPortsEnd   int

	// Don't use it in your config file, please, it's for internal use.
	TCPBindAddrIsHostname bool
	TCPBindAddrIP         net.IP
	TCPBindAddrHostname   string

	AllowUDPAssociation      bool
	UDPAssociationAddr       string
	UDPAssociationPortsStart int
	UDPAssociationPortsEnd   int

	// Don't use it in your config file, please, it's for internal use.
	UDPAssociationAddrIsHostname bool
	UDPAssociationAddrIP         net.IP
	UDPAssociationAddrHostname   string

	LogLevel string
	LogFile  string
}

type SubnetChecker

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

func (*SubnetChecker) Contains

func (s *SubnetChecker) Contains(ip net.IP) (*net.IPNet, bool)

func (*SubnetChecker) Empty

func (s *SubnetChecker) Empty() bool

func (*SubnetChecker) Load

func (s *SubnetChecker) Load(subnets []string) error

type SubnetsConfig

type SubnetsConfig struct {
	UserWillIgnore bool

	Allow       []string
	Deny        []string
	AllowRemote []string
}

type User

type User struct {
	Name string
}

Jump to

Keyboard shortcuts

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