mirror of
https://github.com/yudai/gotty.git
synced 2025-09-22 05:50:48 +02:00
Refactor
This commit is contained in:
parent
54403dd678
commit
a6133f34b7
54 changed files with 2140 additions and 1334 deletions
20
backend/localcommand/options.go
Normal file
20
backend/localcommand/options.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
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
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue