Documentation ¶
Overview ¶
Package Menshen LEAP API
the purpose of this application is to provide a service that uses go code and libraries to define the VPN provisioning API
Index ¶
- func CertGenHelper(registry *registry, ovpnCaCrt string, ovpnCaKey string, algo string, ...) func(echo.Context) error
- func DownloadConfigHelper(registry *registry, cfg *Config) func(echo.Context) error
- func GenConfigHelper(registry *registry, cfg *Config) func(echo.Context) error
- func GetLocationsFromEIPData(eip *m.EIPServiceV3) locationMap
- func InitMetricsServer() *echo.Echo
- func InitServer(cfg *Config) *echo.Echo
- func ParseEIPServiceFile(path string) (*m.EIPServiceV3, error)
- func ParseProviderJsonFile(path string) (*m.Provider, error)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CertGenHelper ¶
func CertGenHelper(registry *registry, ovpnCaCrt string, ovpnCaKey string, algo string, expiryDays int, addRootCa bool) func(echo.Context) error
GenerateCert godoc @Summary Get openvpn cert @Description Fetch a new key and cert. @Tags Provisioning @Accept json @Produce json @Success 200 {object} string @Failure 400 {object} error @Failure 404 {object} error @Failure 500 {object} error @Router /api/5/openvpn/cert [get]
func DownloadConfigHelper ¶
DownloadConfig godoc. @Summary Fetch OpenVPN Config File. @Description fetch a working config file for OpenVPN service. @Tags Provisioning @Produce text/plain @Success 200 {object} string @Failure 400 {object} error @Failure 404 {object} error @Failure 500 {object} error @Router /api/autoconf [get]
func GenConfigHelper ¶
GenerateConfig godoc. @Summary Fetch OpenVPN Config File. @Description fetch a working config file for OpenVPN service. @Tags Provisioning @Produce text/plain @Success 200 {object} string @Failure 400 {object} error @Failure 404 {object} error @Failure 500 {object} error @Router /api/5/openvpn/config [get]
func GetLocationsFromEIPData ¶
func GetLocationsFromEIPData(eip *m.EIPServiceV3) locationMap
func InitMetricsServer ¶
func InitMetricsServer() *echo.Echo
func ParseEIPServiceFile ¶
func ParseEIPServiceFile(path string) (*m.EIPServiceV3, error)
Types ¶
type Config ¶
type Config struct { EnableCertv3 bool AllowGatewayListing bool AllowBridgeListing bool AutoTLS bool // EIP is an existing EIPv3 file in the local filesystem (legacy) EIP string // EIPULR is a remote endpoint where to fetch an existing EIPv3 file from (legacy) EIPURL string // LocalBridges is a list of addresses where the available bridge // containers expose their control ports. LocalBridges []string LoadBalancerAddr string Port int PortMetrics int ServerName string ClientCertURL string CaFile string OvpnCaCrt string OvpnCaKey string OvpnClientCrtExpiry int // ProviderJson is a file path to an existing provider.json ProviderJson string Algo string DBFile string // This is the amount of milliseconds to wait since the last heartbeat from a bridge or gateway before // removing them from the resources that are returned to clients. // If this is zero then no cutoff will be applied LastSeenCutoffMillis int64 }