util

package
v0.0.0-...-9f4aa90 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCtxWithScope

func GetCtxWithScope(ctx context.Context, scope string) context.Context

func GetCtxWithTraceId

func GetCtxWithTraceId(ctx context.Context) context.Context

func GetScopeFromCtx

func GetScopeFromCtx(ctx context.Context) (string, bool)

func GetTraceIdFromCtx

func GetTraceIdFromCtx(ctx context.Context) (string, bool)

func PrintColoredBanner

func PrintColoredBanner()

func SetOsProxy

func SetOsProxy(port uint16) error

func UnsetOsProxy

func UnsetOsProxy() error

Types

type Args

type Args struct {
	Addr           string
	Port           uint16
	DnsAddr        string
	DnsPort        uint16
	DnsIPv4Only    bool
	EnableDoh      bool
	Debug          bool
	Silent         bool
	SystemProxy    bool
	Timeout        uint16
	AllowedPattern StringArray
	PatternFile    string
	WindowSize     uint16
	Version        bool
}

func ParseArgs

func ParseArgs() *Args

type Config

type Config struct {
	Addr            string
	Port            int
	DnsAddr         string
	DnsPort         int
	DnsIPv4Only     bool
	EnableDoh       bool
	Debug           bool
	Silent          bool
	SystemProxy     bool
	Timeout         int
	WindowSize      int
	AllowedPatterns []*regexp.Regexp
}

func GetConfig

func GetConfig() *Config

func (*Config) Load

func (c *Config) Load(args *Args) error

type StringArray

type StringArray []string

func (*StringArray) Set

func (arr *StringArray) Set(value string) error

func (*StringArray) String

func (arr *StringArray) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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