feature, net/tshttpproxy: pull out support for using proxies as a feature
Saves 139 KB. Also Synology support, which I saw had its own large-ish proxy parsing support on Linux, but support for proxies without Synology proxy support is reasonable, so I pulled that out as its own thing. Updates #12614 Change-Id: I22de285a3def7be77fdcf23e2bec7c83c9655593 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
9b997c8f2f
commit
442a3a779d
+7
-1
@@ -50,7 +50,8 @@ func (h *Hook[Func]) Set(f Func) {
|
||||
}
|
||||
|
||||
// Get returns the hook function, or panics if it hasn't been set.
|
||||
// Use IsSet to check if it's been set.
|
||||
// Use IsSet to check if it's been set, or use GetOrNil if you're
|
||||
// okay with a nil return value.
|
||||
func (h *Hook[Func]) Get() Func {
|
||||
if !h.ok {
|
||||
panic("Get on unset feature hook, without IsSet")
|
||||
@@ -64,6 +65,11 @@ func (h *Hook[Func]) GetOk() (f Func, ok bool) {
|
||||
return h.f, h.ok
|
||||
}
|
||||
|
||||
// GetOrNil returns the hook function or nil if it hasn't been set.
|
||||
func (h *Hook[Func]) GetOrNil() Func {
|
||||
return h.f
|
||||
}
|
||||
|
||||
// Hooks is a slice of funcs.
|
||||
//
|
||||
// As opposed to a single Hook, this is meant to be used when
|
||||
|
||||
Reference in New Issue
Block a user