Documentation
¶
Index ¶
- Constants
- func FindAndShutdownTheRunningInstance(pfs PidFile) (err error)
- func FindDaemonProcess(pfs PidFile) (present bool, process *os.Process, err error)
- func IsPidFileExists(pfs PidFile) bool
- type Base
- type CachedTCPWriter
- type CachedUDPWriter
- type Config
- func (c *Config) BuildAddr() (err error)
- func (c *Config) BuildLogger()
- func (c *Config) BuildPidFileStruct() *pidFileStruct
- func (c *Config) BuildServerAddr() (err error)
- func (c *Config) BuildUriAddr(defaultPort string) (err error)
- func (c *Config) PressEnterToExit()
- func (c *Config) UpdatePrefixInConfigFile(s string)
- type Conn
- type PidFile
- type UdpPacket
Constants ¶
View Source
const DefaultPidDirTemplate = "/var/run/$APPNAME"
View Source
const DefaultPidPathTemplate = "/var/run/$APPNAME/$APPNAME.pid"
Variables ¶
This section is empty.
Functions ¶
func FindAndShutdownTheRunningInstance ¶
FindAndShutdownTheRunningInstance locates the daemon process if running
func FindDaemonProcess ¶
FindDaemonProcess locates the daemon process if running
func IsPidFileExists ¶
IsPidFileExists checks if the pid file exists or not
Types ¶
type Base ¶
func NewBaseLogger ¶
func NewBaseLogger(config *log.LoggerConfig) *Base
type CachedTCPWriter ¶
type CachedUDPWriter ¶
type Config ¶
type Config struct {
LoggerConfig *log.LoggerConfig
log.Logger
Addr string
Uri *url.URL
UriBase string
Adapter string // network adapter name. such as "en4". default "". for udp multicast
PrefixInCommandLine string
PrefixInConfigFile string
PidDir string
Network string
TlsConfigInitializer tls2.Initializer
}
func NewConfigWithParams ¶
func NewConfigWithParams(isServer bool, netType, prefixPrefix, prefixCLI string, loggerConfig *log.LoggerConfig, tlsConfigInitializer tls2.Initializer, addr, uriBase, adapter string) *Config
func (*Config) BuildLogger ¶
func (c *Config) BuildLogger()
func (*Config) BuildPidFileStruct ¶
func (c *Config) BuildPidFileStruct() *pidFileStruct
func (*Config) BuildServerAddr ¶
func (*Config) BuildUriAddr ¶
func (*Config) PressEnterToExit ¶
func (c *Config) PressEnterToExit()
func (*Config) UpdatePrefixInConfigFile ¶
Click to show internal directories.
Click to hide internal directories.