Documentation
¶
Index ¶
- Variables
- func Get(name string) (string, bool)
- func NewPrefixWithConfig(ctx context.Context, conf *Config) (stream.Handler, error)
- func RegisterRegexp(name string, pattern string)
- func Unread(reader io.Reader, prefix []byte) io.Reader
- func UnreadStream(rwc stream.Stream, prefix []byte) stream.Stream
- func UnwrapUnread(reader io.Reader) (io.Reader, []byte)
- func UnwrapUnreadStream(rwc stream.Stream) (stream.Stream, []byte)
- type Config
- type Prefix
- func (p *Prefix) HandlePrefix(prefix string, handler stream.Handler)
- func (p *Prefix) HandleRegexp(pattern string, handler stream.Handler) error
- func (p *Prefix) Handler(r io.Reader) (handler stream.Handler, prefix []byte, err error)
- func (p *Prefix) NotFound(handler stream.Handler)
- func (p *Prefix) ServeStream(ctx context.Context, stm stream.Stream)
- type ProtocolEnum
- type Route
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = fmt.Errorf("error not found")
)
Functions ¶
func NewPrefixWithConfig ¶
NewPrefixWithConfig create a new Prefix with config.
func RegisterRegexp ¶
Types ¶
type Prefix ¶
type Prefix struct {
// contains filtered or unexported fields
}
Prefix is an Applicative protocol multiplexer It matches the prefix of each incoming reader against a list of registered patterns and calls the handler for the pattern that most closely matches the Handler.
func (*Prefix) HandleRegexp ¶
func (*Prefix) Handler ¶
Handler returns most matching handler and prefix bytes data to use for the given reader.
type ProtocolEnum ¶
type ProtocolEnum string
const ( ProtocolTLS ProtocolEnum = "tls" ProtocolSocks4 ProtocolEnum = "socks4" ProtocolSocks5 ProtocolEnum = "socks5" ProtocolHTTP1 ProtocolEnum = "http1" ProtocolHTTP2 ProtocolEnum = "http2" ProtocolSSH ProtocolEnum = "ssh" )
Click to show internal directories.
Click to hide internal directories.