udp input except no clean shutdown
This commit is contained in:
@@ -3,6 +3,7 @@ package input
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"strconv"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
@@ -47,6 +48,12 @@ func newSourceFunc() func() Input {
|
||||
return singletonKeyboard
|
||||
}
|
||||
}
|
||||
if port, _ := strconv.Atoi(os.Getenv("INPUT_UDP")); port != 0 {
|
||||
singletonUDP := NewUDP(port)
|
||||
return func() Input {
|
||||
return singletonUDP
|
||||
}
|
||||
}
|
||||
return func() Input {
|
||||
generator := randomCharFromRange('a', 'g')
|
||||
if p, ok := os.LookupEnv("INPUT_RANDOM_WEIGHT_FILE"); ok && len(p) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user