Add base setup
This commit is contained in:
18
lifetime.go
Normal file
18
lifetime.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package curre
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
type Lifetime func() int
|
||||
|
||||
func ConsoleLifetime() int {
|
||||
signals := make(chan os.Signal, 1)
|
||||
signal.Notify(signals, syscall.SIGINT, syscall.SIGTERM)
|
||||
|
||||
<-signals
|
||||
|
||||
return OK
|
||||
}
|
Reference in New Issue
Block a user