gotty/backend/localcommand/options.go

21 lines
332 B
Go
Raw Permalink Normal View History

2017-02-26 06:37:07 +08:00
package localcommand
import (
"syscall"
"time"
)
type Option func(*LocalCommand)
func WithCloseSignal(signal syscall.Signal) Option {
return func(lcmd *LocalCommand) {
lcmd.closeSignal = signal
}
}
func WithCloseTimeout(timeout time.Duration) Option {
return func(lcmd *LocalCommand) {
lcmd.closeTimeout = timeout
}
}