45 lines
1.0 KiB
Go
45 lines
1.0 KiB
Go
|
package config
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"path"
|
||
|
|
||
|
ooccp "git.loafle.net/overflow/overflow_commons_go/config/probe"
|
||
|
)
|
||
|
|
||
|
func ContainerPIDPath(name string) string {
|
||
|
pidName := fmt.Sprintf("%s.pid", name)
|
||
|
|
||
|
return path.Join(PIDDirPath(), pidName)
|
||
|
}
|
||
|
|
||
|
func ContainerBinPath(name string) string {
|
||
|
var binName string
|
||
|
switch name {
|
||
|
case ooccp.ContainerGeneralName:
|
||
|
binName = ooccp.ContainerGeneralFileName
|
||
|
case ooccp.ContainerNetworkName:
|
||
|
binName = ooccp.ContainerNetworkFileName
|
||
|
case ooccp.ContainerDiscoveryName:
|
||
|
binName = ooccp.ContainerDiscoveryFileName
|
||
|
default:
|
||
|
}
|
||
|
|
||
|
return path.Join(BinDirPath(), binName)
|
||
|
}
|
||
|
|
||
|
func ContainerLogConfigPath(name string) string {
|
||
|
var configName string
|
||
|
switch name {
|
||
|
case ooccp.ContainerGeneralName:
|
||
|
configName = ooccp.ContainerGeneralLogConfigFileName
|
||
|
case ooccp.ContainerNetworkName:
|
||
|
configName = ooccp.ContainerNetworkLogConfigFileName
|
||
|
case ooccp.ContainerDiscoveryName:
|
||
|
configName = ooccp.ContainerDiscoveryLogConfigFileName
|
||
|
default:
|
||
|
}
|
||
|
|
||
|
return path.Join(BinDirPath(), configName)
|
||
|
}
|