config

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintUsage

func PrintUsage(prefix string)

Types

type Auth added in v1.0.0

type Auth struct {
	Method AuthMethod `default:"none" desc:"auth method: none|static|ldap"`
	Static Static
	Ldap   Ldap
}

type AuthMethod added in v1.0.0

type AuthMethod string

func (*AuthMethod) Decode added in v1.0.0

func (a *AuthMethod) Decode(value string) error

func (*AuthMethod) String added in v1.0.0

func (a *AuthMethod) String() string

type Config

type Config struct {
	Listen   string `default:"127.0.0.1:1080" desc:"socks5 server listen ip:port"`
	LogLevel string `default:"info" desc:"log level: debug|info|warn|error|fatal"`
	Auth     Auth
}

func NewConfig

func NewConfig(prefix string) (*Config, error)

type Ldap

type Ldap struct {
	Url      string `desc:"ldap url. example: ldaps://example.com:636"`
	BindUser string `desc:"ldap bind user. example: uid=bind,cn=users,cn=accounts,dc=example,dc=com"`
	BindPass string `desc:"ldap bind pass"`
	BaseDn   string `desc:"ldap search base dn. example: cn=users,cn=accounts,dc=example,DC=com"`
	Filter   string `desc:"ldap search filter. example: (&(uid=%s)(memberOf=cn=devops,cn=groups,cn=accounts,dc=example,dc=com))"`
}

type Static

type Static struct {
	User string `desc:"static username"`
	Pass string `desc:"static password"`
}

Jump to

Keyboard shortcuts

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