-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathutils.go
More file actions
25 lines (22 loc) · 751 Bytes
/
utils.go
File metadata and controls
25 lines (22 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package main
import "github.com/jmpsec/osctrl/pkg/config"
// Helper to compose paths for API
func _apiPath(target string) string {
return apiPrefixPath + apiVersionPath + target
}
// Helper to convert YAML settings loaded from file to settings
func loadedYAMLToServiceParams(yml config.APIConfiguration, loadedFile string) *config.ServiceParameters {
return &config.ServiceParameters{
ConfigFlag: true,
ServiceConfigFile: loadedFile,
Service: &yml.Service,
DB: &yml.DB,
Redis: &yml.Redis,
Osquery: &yml.Osquery,
JWT: &yml.JWT,
TLS: &yml.TLS,
Logger: &yml.Logger,
Carver: &yml.Carver,
Debug: &yml.Debug,
}
}