listener

package
v0.0.0-...-86b787e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(key string) (func(...func(Listener) error) (Listener, error), bool)

func Range

func Range(fn func(string))

func Register

func Register(key string, fn func(...func(Listener) error) (Listener, error)) func(...func(Listener) error) (Listener, error)

func WithAddress

func WithAddress(protocol, address string) func(Listener) error

func WithConfig

func WithConfig(c toml.Primitive, decoder TomlDecoder) func(Listener) error

Types

type AddAddresser

type AddAddresser interface {
	AddAddress(net.Addr)
}

type DummyUDPConn

type DummyUDPConn struct {
	Buffer []byte

	Laddr net.Addr
	Raddr *net.UDPAddr

	Fn func(b []byte, addr *net.UDPAddr) (int, error)
}

func (*DummyUDPConn) Close

func (dc *DummyUDPConn) Close() error

func (*DummyUDPConn) LocalAddr

func (dc *DummyUDPConn) LocalAddr() net.Addr

func (*DummyUDPConn) Read

func (dc *DummyUDPConn) Read(b []byte) (int, error)

func (*DummyUDPConn) RemoteAddr

func (dc *DummyUDPConn) RemoteAddr() net.Addr

func (*DummyUDPConn) SetDeadline

func (dc *DummyUDPConn) SetDeadline(t time.Time) error

func (*DummyUDPConn) SetReadDeadline

func (dc *DummyUDPConn) SetReadDeadline(t time.Time) error

func (*DummyUDPConn) SetWriteDeadline

func (dc *DummyUDPConn) SetWriteDeadline(t time.Time) error

func (*DummyUDPConn) Write

func (dc *DummyUDPConn) Write(b []byte) (int, error)

type Listener

type Listener interface {
	Start(ctx context.Context) error
	Accept() (net.Conn, error)
}

func Dummy

func Dummy(options ...func(Listener) error) (Listener, error)

func MustDummy

func MustDummy(options ...func(Listener) error) Listener

func NewSocket

func NewSocket(sc SocketConfig) (Listener, error)

type SocketConfig

type SocketConfig struct {
	Addresses []net.Addr
}

func (*SocketConfig) AddAddress

func (sc *SocketConfig) AddAddress(a net.Addr)

type TomlDecoder

type TomlDecoder interface {
	PrimitiveDecode(primValue toml.Primitive, v interface{}) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL