model

package
v0.0.0-...-f7e23ef Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppSecret = "frp-api-xxx"
View Source
var AppServerPort int
View Source
var AppServerPrefix string
View Source
var ClientMap sync.Map

Functions

func LoadClientMap

func LoadClientMap()

func LoadCustomDomainMap

func LoadCustomDomainMap() (m map[string]string)

func SaveClientMap

func SaveClientMap()

Types

type AppConfig

type AppConfig struct {
	BindPort              int              `json:"bindPort"`
	VhostHTTPPort         int              `json:"vhostHTTPPort"`
	VhostHTTPSPort        int              `json:"vhostHTTPSPort"`
	TcpMuxHTTPConnectPort int              `json:"tcpmuxHTTPConnectPort"`
	Custom404Page         string           `json:"custom404Page"`
	ClientDefaultTls      ClientDefaultTls `json:"client_default_tls"`
}

func GetAppConfig

func GetAppConfig() AppConfig

type Client

type Client struct {
	Id     string           `json:"id"` //客户端机器码
	Vhosts map[string]Vhost `json:"vhosts"`
}

type ClientDefaultTls

type ClientDefaultTls struct {
	Force    bool   `json:"force"`
	CertFile string `json:"cert_file"`
	KeyFile  string `json:"key_file"`
}

type Vhost

type Vhost struct {
	Id           string `json:"id"` // type+custom_domain值的md5,默认每个用户的type+custom_domain都是唯一
	Type         string `json:"type"`
	Name         string `json:"name"`
	CustomDomain string `json:"custom_domain"`
	CnameDomain  string `json:"cname_domain"`
	LocalAddr    string `json:"local_addr"`
	RemotePort   int    `json:"remote_port"`
	CrtPath      string `json:"crt_path"`
	KeyPath      string `json:"key_path"`
	Status       bool   `json:"status"` //true.开启,false.关闭
	CreatedAt    int64  `json:"created_at"`
}

Jump to

Keyboard shortcuts

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