configuration

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigPath

func ConfigPath() string

func ParseSizeString

func ParseSizeString(s string) (int64, error)

Types

type BasicAuth

type BasicAuth struct {
	Username           string `mapstructure:"username" yaml:"username"`
	Password           string `mapstructure:"password" yaml:"password"`
	PasswordFile       string `mapstructure:"passwordFile" yaml:"passwordFile"`
	PasswordPrompt     bool   `mapstructure:"passwordPrompt" yaml:"passwordPrompt"`
	UnauthorizedPage   string `mapstructure:"unauthorizedPage" yaml:"unauthorizedPage"`
	UnauthorizedStatus int    `mapstructure:"unauthorizedStatus" yaml:"unauthorizedStatus"`
	NoDialog           bool   `mapstructure:"noDialog" yaml:"noDialog"`
}

type CORS

type CORS struct {
	AllowedOrigins      []string `mapstructure:"allowedOrigins" yaml:"allowedOrigins"`
	AllowedHeaders      []string `mapstructure:"allowedHeaders" yaml:"allowedHeaders"`
	MaxAge              int      `mapstructure:"maxAge" yaml:"maxAge"`
	AllowCredentials    bool     `mapstructure:"allowCredentials" yaml:"allowCredentials"`
	AllowPrivateNetwork bool     `mapstructure:"allowPrivateNetwork" yaml:"allowPrivateNetwork"`
	SuccessStatus       int      `mapstructure:"successStatus" yaml:"successStatus"`
}

type Discovery

type Discovery struct {
	Enabled      bool    `mapstructure:"enabled" yaml:"enabled"`
	Host         string  `mapstructure:"host" yaml:"host"`
	Key          string  `mapstructure:"key" yaml:"key" json:"-"`
	KeyPath      string  `mapstructure:"keyPath" yaml:"keyPath"`
	Insecure     bool    `mapstructure:"insecure" yaml:"insecure"`
	PreferredURL string  `mapstructure:"preferredURL" yaml:"preferredURL"`
	RequiredURL  string  `mapstructure:"requiredURL" yaml:"requiredURL"`
	OnlyRedirect bool    `mapstructure:"onlyRedirect" yaml:"onlyRedirect"`
	Reports      Reports `mapstructure:"reports" yaml:"reports"`
}

type HeaderFilter

type HeaderFilter struct {
	UseDefaults bool     `mapstructure:"useDefaults" yaml:"useDefaults"`
	Allow       []string `mapstructure:"allow" yaml:"allow"`
	Block       []string `mapstructure:"block" yaml:"block"`
}

type NATTraversal

type NATTraversal struct {
	P2P  P2P  `mapstructure:"p2p" yaml:"p2p"`
	UPnP UPnP `mapstructure:"upnp" yaml:"upnp"`
}

func (*NATTraversal) IsUsingUPnP

func (c *NATTraversal) IsUsingUPnP() bool

func (*NATTraversal) IsUsingWebRTC

func (c *NATTraversal) IsUsingWebRTC() bool

type Output

type Output struct {
	Quiet   bool   `mapstructure:"quiet" yaml:"quiet"`
	Format  string `mapstructure:"format" yaml:"format"`
	QRCode  bool   `mapstructure:"qrCode" yaml:"qrCode"`
	NoColor bool   `mapstructure:"noColor" yaml:"noColor"`
}

type P2P

type P2P struct {
	Enabled                 bool          `mapstructure:"enabled" yaml:"enabled"`
	Only                    bool          `mapstructure:"only" yaml:"only"`
	WebRTCConfigurationFile string        `mapstructure:"webrtcConfigurationFile" yaml:"webrtcConfigurationFile"`
	WebRTCConfiguration     []byte        `json:"webrtcConfiguration" yaml:"webrtcConfiguration"`
	DiscoveryDir            string        `mapstructure:"discoveryDir" yaml:"discoveryDir"`
	ICEGatherTimeout        time.Duration `mapstructure:"iceGatherTimeout" yaml:"iceGatherTimeout"`
}

func (*P2P) ParseConfig

func (c *P2P) ParseConfig() (*webrtc.Configuration, error)

type Reports

type Reports struct {
	Enabled      bool         `mapstructure:"enabled" yaml:"enabled"`
	HeaderFilter HeaderFilter `mapstructure:"headerFilter" yaml:"headerFilter"`
}

type Root

type Root struct {
	Output       Output       `mapstructure:"output" yaml:"output"`
	Server       Server       `mapstructure:"server" yaml:"server"`
	BasicAuth    BasicAuth    `mapstructure:"basicAuth" yaml:"basicAuth"`
	CORS         CORS         `mapstructure:"cors" yaml:"cors"`
	NATTraversal NATTraversal `mapstructure:"natTraversal" yaml:"natTraversal"`
	Subcommands  *Subcommands `mapstructure:"cmd" yaml:"cmd"`
	Discovery    Discovery    `mapstructure:"discovery" yaml:"discovery"`
}

func EmptyRoot

func EmptyRoot() *Root

func (*Root) Hydrate

func (c *Root) Hydrate() error

func (*Root) Init

func (c *Root) Init(cmd *cobra.Command)

func (*Root) Validate

func (c *Root) Validate() error

type Server

type Server struct {
	Host        string        `mapstructure:"host" yaml:"host"`
	Port        int           `mapstructure:"port" yaml:"port"`
	Timeout     time.Duration `mapstructure:"timeout" yaml:"timeout"`
	AllowBots   bool          `mapstructure:"allowBots" yaml:"allowBots"`
	MaxReadSize string        `mapstructure:"maxReadSize" yaml:"maxReadSize"`
	ExitOnFail  bool          `mapstructure:"exitOnFail" yaml:"exitOnFail"`
	TLSCert     string        `mapstructure:"tlsCert" yaml:"tlsCert"`
	TLSKey      string        `mapstructure:"tlsKey" yaml:"tlsKey"`
}

type Subcommands

type Subcommands struct {
	Receive         *receive.Configuration         `mapstructure:"receive" yaml:"receive"`
	Send            *send.Configuration            `mapstructure:"send" yaml:"send"`
	Exec            *exec.Configuration            `mapstructure:"exec" yaml:"exec"`
	Redirect        *redirect.Configuration        `mapstructure:"redirect" yaml:"redirect"`
	RProxy          *rproxy.Configuration          `mapstructure:"rproxy" yaml:"rproxy"`
	P2P             *p2p.Configuration             `mapstructure:"p2p" yaml:"p2p"`
	DiscoveryServer *discoveryserver.Configuration `mapstructure:"discoveryServer" yaml:"discoveryServer"`
}

type UPnP

type UPnP struct {
	ExternalPort int           `mapstructure:"externalPort" yaml:"externalPort"`
	Enabled      bool          `mapstructure:"mapPort" yaml:"mapPort"`
	Duration     time.Duration `mapstructure:"duration" yaml:"duration"`
	Timeout      time.Duration `mapstructure:"timeout" yaml:"timeout" flag:"upnp-discovery-timeout"`
}

Jump to

Keyboard shortcuts

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