cloudflared/vendor/github.com/gobwas/ws/wsutil/extenstion.go
Devin Carr d608a64cc5
Some checks are pending
Check / check (1.22.x, macos-latest) (push) Waiting to run
Check / check (1.22.x, ubuntu-latest) (push) Waiting to run
Check / check (1.22.x, windows-latest) (push) Waiting to run
Semgrep config / semgrep/ci (push) Waiting to run
TUN-8685: Bump coredns dependency
Closes TUN-8685
2024-10-17 13:09:39 -07:00

32 lines
897 B
Go

package wsutil
import "github.com/gobwas/ws"
// RecvExtension is an interface for clearing fragment header RSV bits.
type RecvExtension interface {
UnsetBits(ws.Header) (ws.Header, error)
}
// RecvExtensionFunc is an adapter to allow the use of ordinary functions as
// RecvExtension.
type RecvExtensionFunc func(ws.Header) (ws.Header, error)
// BitsRecv implements RecvExtension.
func (fn RecvExtensionFunc) UnsetBits(h ws.Header) (ws.Header, error) {
return fn(h)
}
// SendExtension is an interface for setting fragment header RSV bits.
type SendExtension interface {
SetBits(ws.Header) (ws.Header, error)
}
// SendExtensionFunc is an adapter to allow the use of ordinary functions as
// SendExtension.
type SendExtensionFunc func(ws.Header) (ws.Header, error)
// BitsSend implements SendExtension.
func (fn SendExtensionFunc) SetBits(h ws.Header) (ws.Header, error) {
return fn(h)
}