config

package
v0.0.0-...-799e77a Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: BSD-3-Clause Imports: 5 Imported by: 51

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDatabase

func GetDatabase(uri string) (string, string)

GetDatabase gets the driver name and connection string corresponding to the input

func ReadConfig

func ReadConfig(configFileName string)

ReadConfig parses the configuration file

func SetPublicUrls

func SetPublicUrls() error

SetPublicUrls sets the default publics urls of the 3 servers from the config

Types

type Auth

type Auth struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

type Certificate

type Certificate struct {
	Cert       string `yaml:"cert"`
	PrivateKey string `yaml:"private_key"`
}

type Configuration

type Configuration struct {
	Certificate    Certificate        `yaml:"certificate"`
	Storage        Storage            `yaml:"storage"`
	License        License            `yaml:"license"`
	LcpServer      ServerInfo         `yaml:"lcp"`
	LsdServer      LsdServerInfo      `yaml:"lsd"`
	FrontendServer FrontendServerInfo `yaml:"frontend"`
	LsdNotifyAuth  Auth               `yaml:"lsd_notify_auth"`
	LcpUpdateAuth  Auth               `yaml:"lcp_update_auth"`
	CMSAccessAuth  Auth               `yaml:"cms_access_auth"`
	LicenseStatus  LicenseStatus      `yaml:"license_status"`
	Localization   Localization       `yaml:"localization"`
	Logging        Logging            `yaml:"logging"`
	TestMode       bool               `yaml:"test_mode"`
	GoofyMode      bool               `yaml:"goofy_mode"`
	Profile        string             `yaml:"profile,omitempty"`
}
var Config Configuration

Config is a global variable which contains the server configuration

type FileSystem

type FileSystem struct {
	Directory string `yaml:"directory"`
	URL       string `yaml:"url,omitempty"`
}

type FrontendServerInfo

type FrontendServerInfo struct {
	ServerInfo          `yaml:",inline"`
	Directory           string `yaml:"directory,omitempty"`
	ProviderUri         string `yaml:"provider_uri"`
	RightPrint          int32  `yaml:"right_print"`
	RightCopy           int32  `yaml:"right_copy"`
	MasterRepository    string `yaml:"master_repository"`
	EncryptedRepository string `yaml:"encrypted_repository"`
}

type License

type License struct {
	Links map[string]string `yaml:"links"`
}

type LicenseStatus

type LicenseStatus struct {
	Renew          bool   `yaml:"renew"`
	Register       bool   `yaml:"register"`
	Return         bool   `yaml:"return"`
	RentingDays    int    `yaml:"renting_days"`
	RenewDays      int    `yaml:"renew_days"`
	RenewPageUrl   string `yaml:"renew_page_url,omitempty"`
	RenewCustomUrl string `yaml:"renew_custom_url,omitempty"`
}

type Localization

type Localization struct {
	Languages       []string `yaml:"languages"`
	Folder          string   `yaml:"folder"`
	DefaultLanguage string   `yaml:"default_language"`
}

type Logging

type Logging struct {
	Directory      string `yaml:"directory"`
	SlackToken     string `yaml:"slack_token"`
	SlackChannelID string `yaml:"slack_channel"`
}

type LsdServerInfo

type LsdServerInfo struct {
	ServerInfo     `yaml:",inline"`
	LicenseLinkUrl string `yaml:"license_link_url,omitempty"`
	UserDataUrl    string `yaml:"user_data_url,omitempty"`
}

type ServerInfo

type ServerInfo struct {
	Host          string `yaml:"host,omitempty"`
	Port          int    `yaml:"port,omitempty"`
	AuthFile      string `yaml:"auth_file"`
	ReadOnly      bool   `yaml:"readonly,omitempty"`
	PublicBaseUrl string `yaml:"public_base_url,omitempty"`
	Database      string `yaml:"database,omitempty"`
	CertDate      string `yaml:"cert_date,omitempty"`
	Resources     string `yaml:"resources,omitempty"`
}

type Storage

type Storage struct {
	FileSystem FileSystem `yaml:"filesystem"`
	AccessId   string     `yaml:"access_id"`
	DisableSSL bool       `yaml:"disable_ssl"`
	PathStyle  bool       `yaml:"path_style"`
	Mode       string     `yaml:"mode"`
	Secret     string     `yaml:"secret"`
	Endpoint   string     `yaml:"endpoint"`
	Bucket     string     `yaml:"bucket"`
	Region     string     `yaml:"region"`
	Token      string     `yaml:"token"`
}

Jump to

Keyboard shortcuts

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