mirror of
https://github.com/sorenisanerd/gotty.git
synced 2024-11-14 01:14:25 +00:00
21 lines
332 B
Go
21 lines
332 B
Go
|
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
|
||
|
}
|
||
|
}
|