Initial commit for the web interface
This commit is contained in:
commit
4eea7769ff
36 changed files with 1186 additions and 0 deletions
21
config/env.go
Normal file
21
config/env.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// FromEnv analyzes all the environment variables to find each one
|
||||
// starting by REVEIL_
|
||||
func (c *Config) FromEnv() error {
|
||||
for _, line := range os.Environ() {
|
||||
if strings.HasPrefix(line, "REVEIL_") {
|
||||
err := c.parseLine(line)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error in environment (%q): %w", line, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue