Documentation ¶
Index ¶
- Constants
- func GetPackageVersion(service string) *string
- func InstallPackages(services map[string]Service)
- func RemoveServices(services map[string]Service)
- func StartServices(services map[string]Service)
- func WriteServiceConfig(path string, config ServiceConfig) error
- type APIInfo
- type Broker
- type DBConnector
- type IService
- type Service
- type ServiceConfig
- type ServiceStatus
Constants ¶
View Source
const ( ServiceRunning = "running" ServiceFailed = "failed" ServiceMissing = "missing" ServiceStop = "stopped" )
Variables ¶
This section is empty.
Functions ¶
func GetPackageVersion ¶
GetPackageVersion return package version
func InstallPackages ¶
InstallPackages start all given services
func RemoveServices ¶
RemoveServices remove all given services
func StartServices ¶
StartServices start all given services
func WriteServiceConfig ¶
func WriteServiceConfig(path string, config ServiceConfig) error
WriteServiceConfig store configuration
Types ¶
type APIInfo ¶
type APIInfo struct { CertPath string `json:"certPath"` KeyPath string `json:"keyPath"` Password string `json:"password"` IP string `json:"ip"` Port string `json:"port"` URLToken string `json:"urlToken"` BrowsingFolder string `json:"browsingFolder"` APIVersion string `json:"apiVersion"` }
APIInfo api description
type Broker ¶
type Broker struct { IP string `json:"ip"` Port string `json:"port"` Login string `json:"login"` Password string `json:"password"` CaPath string `json:"caPath"` Secure bool `json:"secure"` }
Broker description
type DBConnector ¶
DBConnector description
type Service ¶
type Service struct { Name string `json:"name"` Systemd []string `json:"systemd"` //systemd service Version string `json:"version"` PackageName string `json:"packageName"` //DebianPackageName ConfigPath string `json:"configPath"` }
Service description
func (Service) GetServiceStatus ¶
GetServiceStatus return service status
type ServiceConfig ¶
type ServiceConfig struct { LocalBroker Broker `json:"localBroker"` NetworkBroker Broker `json:"networkBroker"` AuthBroker Broker `json:"authBroker"` DB DBConnector `json:"db"` HistoryDB DBConnector `json:"historyDb"` LogLevel string `json:"logLevel"` ExternalAPI APIInfo `json:"externalAPI"` InternalAPI APIInfo `json:"internalAPI"` ClientAPI APIInfo `json:"clientAPI"` DataPath string `json:"dataPath"` ServiceDataPath string `json:"serviceDataPath"` }
ServiceConfig description
func ReadServiceConfig ¶
func ReadServiceConfig(path string) (*ServiceConfig, error)
ReadServiceConfig parse the configuration file
func (ServiceConfig) ToJSON ¶
func (config ServiceConfig) ToJSON() (string, error)
ToJSON dump switch config struct
type ServiceStatus ¶
ServiceStatus description
Click to show internal directories.
Click to hide internal directories.