Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteConfigToLocal ¶
func WriteConfigToLocal() (err error)
WriteConfigToLocal is write vpn config to local,node machine sync by rsync tool
Types ¶
type BaseConfigService ¶
type BaseConfigService struct {
}
BaseConfigService is an implement for config service
func (*BaseConfigService) GetVPNConfig ¶
func (s *BaseConfigService) GetVPNConfig(ctx context.Context, user *models.CommonUser) (config *models.UserVPNConfig, err error)
GetVPNConfig return vpn config
type ConfigHandler ¶
type ConfigHandler struct {
common.BaseHandler
Service ConfigService
}
ConfigHandler is config handler
func (*ConfigHandler) GetHostList ¶
func (h *ConfigHandler) GetHostList(ctx *fasthttp.RequestCtx)
GetHostList get host list that user can used
func (*ConfigHandler) GetVPNConfig ¶
func (h *ConfigHandler) GetVPNConfig(ctx *fasthttp.RequestCtx)
GetVPNConfig get personal vpn config
type ConfigService ¶
type ConfigService interface {
GetVPNConfig(ctx context.Context, user *models.CommonUser) (config *models.UserVPNConfig, err error)
}
ConfigService vpn config service interface
type VPNConfigResponse ¶
type VPNConfigResponse struct {
Enable bool `json:"enable"`
UserName string `json:"userName"`
Password string `json:"password"`
Hosts []VPNHostConfig `json:"hosts"`
Start int64 `json:"start"`
End int64 `json:"end"`
Level int `json:"level"`
Package int `json:"package"`
}
VPNConfigResponse vpn config
Click to show internal directories.
Click to hide internal directories.