Initial pgterminate code

This commit is contained in:
Julien Riou 2018-06-10 08:44:53 +02:00
commit 565c45a8fc
No known key found for this signature in database
GPG key ID: BA3E15176E45E85D
15 changed files with 697 additions and 0 deletions

29
notifier/console.go Normal file
View file

@ -0,0 +1,29 @@
package notifier
import (
"github.com/jouir/pgterminate/base"
"log"
)
// Console notifier structure
type Console struct {
sessions chan base.Session
}
// NewConsole creates a console notifier
func NewConsole(sessions chan base.Session) Notifier {
return &Console{
sessions: sessions,
}
}
// Run starts console notifier
func (c *Console) Run() {
for session := range c.sessions {
log.Printf("%s", session)
}
}
// Reload for handling SIGHUP signals
func (c *Console) Reload() {
}