service/internal/cfg/cfg.go

24 lines
586 B
Go

package cfg
import (
"flag"
)
var (
// UsePipes controls if stdin/stdout should be used for IPC.
UsePipes bool
// UseSockets controls if a socket should be used for IPC.
UseSockets bool
// Socket provides a name for the desired socket if UseSockets is true.
Socket string
)
// Init initializes our configuration from flags.
func Init() {
flag.BoolVar(&UsePipes, "use-pipes", true, "Use stdin/stdout pipes for messaging")
flag.BoolVar(&UseSockets, "use-socket", false, "Use sockets for messaging")
flag.StringVar(&Socket, "socket", "accord", "Socket path")
flag.Parse()
}