In this project, so far, I have decided to include two configuration files. One that will be used to define the environments we are in.
The other one will be used to define the basic information of the CX-20 station and the parameters to be applied to it, like for example, the welcome message, the localization or the language...
File to define the values to be injected into the station, as well as its basic information
The network section is only dedicated to the information for the good progress of the operations. There is no data in this file that will be applied to the station.
The sections just below are dedicated to the configuration to be applied to the station. Here they are:
- Personalization
- OnScreenID
- Wallpaper
- WifiNetwork
- LanSettings
- LanHostName
- PrimaryInterface
- Services
- WirelessNetwork
- LanSettings
File to define the values of the current environment
File content :
env: "env-type"
log: "log-method"
api-url: "http://192.168.1.1:4003/v2"
# ---
api-user: "user"
api-password: "password"
# ---
api-token: "tokentoken"
env:
valid options :
- debug
- test
- pre-prod
- prod
- alpha
- beta
log:
valid options :
- all-in-one : all log level in same file
- separated : each log level separate by dedicated file
The structure below may not change, or there may be only additional possibilities
type YmlConfig struct {
Env string `yaml:"env"`
Log string `yaml:"log"`
ApiUrl string `yaml:"api-url"`
ApiUser string `yaml:"api-user"`
ApiPassword string `yaml:"api-password"`
ApiToken string `yaml:"api-token"`
}
The following structure may change in the future
type Barco struct {
Network struct {
IP string
SubnetMask string
Gateway string
}
Personalisation struct {
OnScreenID struct {
Language string
MeetingRoomName string
Location string
WelcomeMessage string
ShowNetworkInfo bool
EnableThreaterMode bool
}
Wallpaper struct {
Number int
}
}
WifiNetwork struct {
LanSettings struct {
LanHostName struct {
Hostname string
}
PrimaryInterface struct {
Method string
PrimaryInterfaceIP string
PrimaryInterfaceSubnetMask string
PrimaryInterfaceGateway string
PrimaryInterfaceDnsServer string
}
}
Services struct {
ShareViaAirPlay bool
ShareViaGoogleCast bool
}
WirelessNetwork struct {
SsidName string
Wpa2Password string
}
}
}
Not coded at this time
For authentication, it will be enough to enter either the user and the password, or to encode the user and the password in base64 with the following formatting: "user:password"
I strongly recommend using the following code: req.Header.Add("Authorization", Auth)
with Auth as the environment variable that contains the token. Refer to the line above
/*
BenchmarkBuffioScan 500 6408963 ns/op 4208 B/op 2 allocs/op
BenchmarkBytesCount 500 4323397 ns/op 8200 B/op 1 allocs/op
BenchmarkBytes32k 500 3650818 ns/op 65545 B/op 1 allocs/op
*/