settings

package
v0.0.0-...-cee8920 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserAllowAll = regexp.MustCompile("")

Functions

func EncodeConfig

func EncodeConfig(c Config) []byte

func Env

func Env(name string) string

Env returns a chisel environment variable

func EnvBool

func EnvBool(name string) bool

EnvBool returns a boolean using an environment variable

func EnvDuration

func EnvDuration(name string, def time.Duration) time.Duration

EnvDuration returns a duration using an environment variable, with a default fallback

func EnvInt

func EnvInt(name string, def int) int

EnvInt returns an integer using an environment variable, with a default fallback

func L4Proto

func L4Proto(s string) (head, proto string)

L4Proto extacts the layer-4 protocol from the given string

func ParseAuth

func ParseAuth(auth string) (string, string)

Types

type Config

type Config struct {
	Version string
	Remotes
}

func DecodeConfig

func DecodeConfig(b []byte) (*Config, error)

type Remote

type Remote struct {
	LocalHost, LocalPort, LocalProto    string
	RemoteHost, RemotePort, RemoteProto string
	Socks, Reverse, Stdio               bool
}

func DecodeRemote

func DecodeRemote(s string) (*Remote, error)

func (Remote) CanListen

func (r Remote) CanListen() bool

CanListen checks if the port can be listened on

func (Remote) Encode

func (r Remote) Encode() string

Encode remote to a string

func (Remote) Local

func (r Remote) Local() string

Local is the decodable local portion

func (Remote) Remote

func (r Remote) Remote() string

Remote is the decodable remote portion

func (Remote) String

func (r Remote) String() string

implement Stringer

func (Remote) UserAddr

func (r Remote) UserAddr() string

UserAddr is checked when checking if a user has access to a given remote

type Remotes

type Remotes []*Remote

func (Remotes) Encode

func (rs Remotes) Encode() []string

Encode back into strings

func (Remotes) Reversed

func (rs Remotes) Reversed(reverse bool) Remotes

Filter out forward reversed/non-reversed remotes

type User

type User struct {
	Name  string
	Pass  string
	Addrs []*regexp.Regexp
}

func (*User) HasAccess

func (u *User) HasAccess(addr string) bool

Jump to

Keyboard shortcuts

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