123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- package v1
- import (
- "sync"
- "github.com/fatedier/frp/pkg/util/util"
- )
- var (
- DisallowUnknownFields = false
- DisallowUnknownFieldsMu sync.Mutex
- )
- type AuthScope string
- const (
- AuthScopeHeartBeats AuthScope = "HeartBeats"
- AuthScopeNewWorkConns AuthScope = "NewWorkConns"
- )
- type AuthMethod string
- const (
- AuthMethodToken AuthMethod = "token"
- AuthMethodOIDC AuthMethod = "oidc"
- )
- type QUICOptions struct {
- KeepalivePeriod int `json:"keepalivePeriod,omitempty"`
- MaxIdleTimeout int `json:"maxIdleTimeout,omitempty"`
- MaxIncomingStreams int `json:"maxIncomingStreams,omitempty"`
- }
- func (c *QUICOptions) Complete() {
- c.KeepalivePeriod = util.EmptyOr(c.KeepalivePeriod, 10)
- c.MaxIdleTimeout = util.EmptyOr(c.MaxIdleTimeout, 30)
- c.MaxIncomingStreams = util.EmptyOr(c.MaxIncomingStreams, 100000)
- }
- type WebServerConfig struct {
-
-
- Addr string `json:"addr,omitempty"`
-
-
- Port int `json:"port,omitempty"`
-
- User string `json:"user,omitempty"`
-
- Password string `json:"password,omitempty"`
-
-
-
- AssetsDir string `json:"assetsDir,omitempty"`
-
- PprofEnable bool `json:"pprofEnable,omitempty"`
-
- TLS *TLSConfig `json:"tls,omitempty"`
- }
- func (c *WebServerConfig) Complete() {
- c.Addr = util.EmptyOr(c.Addr, "127.0.0.1")
- }
- type TLSConfig struct {
-
- CertFile string `json:"certFile,omitempty"`
-
- KeyFile string `json:"keyFile,omitempty"`
-
- TrustedCaFile string `json:"trustedCaFile,omitempty"`
-
-
- ServerName string `json:"serverName,omitempty"`
- }
- type LogConfig struct {
-
-
-
-
- To string `json:"to,omitempty"`
-
-
- Level string `json:"level,omitempty"`
-
-
- MaxDays int64 `json:"maxDays"`
-
- DisablePrintColor bool `json:"disablePrintColor,omitempty"`
- }
- func (c *LogConfig) Complete() {
- c.To = util.EmptyOr(c.To, "console")
- c.Level = util.EmptyOr(c.Level, "info")
- c.MaxDays = util.EmptyOr(c.MaxDays, 3)
- }
- type HTTPPluginOptions struct {
- Name string `json:"name"`
- Addr string `json:"addr"`
- Path string `json:"path"`
- Ops []string `json:"ops"`
- TLSVerify bool `json:"tlsVerify,omitempty"`
- }
- type HeaderOperations struct {
- Set map[string]string `json:"set,omitempty"`
- }
- type HTTPHeader struct {
- Name string `json:"name"`
- Value string `json:"value"`
- }
|