mirror of
https://github.com/safing/portmaster
synced 2025-04-23 12:29:10 +00:00
16 lines
480 B
Go
16 lines
480 B
Go
package terminal
|
|
|
|
import "time"
|
|
|
|
// Upstream defines the interface for upstream (parent) components.
|
|
type Upstream interface {
|
|
Send(msg *Msg, timeout time.Duration) *Error
|
|
}
|
|
|
|
// UpstreamSendFunc is a helper to be able to satisfy the Upstream interface.
|
|
type UpstreamSendFunc func(msg *Msg, timeout time.Duration) *Error
|
|
|
|
// Send is used to send a message through this upstream.
|
|
func (fn UpstreamSendFunc) Send(msg *Msg, timeout time.Duration) *Error {
|
|
return fn(msg, timeout)
|
|
}
|