howl

package
v0.0.0-...-74b8911 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultValidator

func DefaultValidator(b []byte) bool

DefaultValidator accepts any stream which contains the string "woofwoof"

Types

type Howl

type Howl struct {
	//quic bits.
	Conn   quic.Connection
	Stream quic.Stream //Bidirectional QUIC Stream

	Listener quic.Listener //Pure Quic Listener

	Validator Validator // Function for validating the the connection before accepting unidirectional comms.
	MsgDelim  string    //Delimeter to set end of message - "/n" by default.
}

Defines the howl struct

func (*Howl) Connect

func (h *Howl) Connect(addr string, verifytls bool, validator []byte) error

Connect to a quic server and start a stream.

func (*Howl) NewHowlListener

func (h *Howl) NewHowlListener(addr string, tlsconfig *tls.Config) error

NewHowlListener starts a listener for Howl

func (*Howl) Recieve

func (h *Howl) Recieve(msglen int) (len int, message []byte, err error)

Recieve data over the bi-directional stream

func (*Howl) Send

func (h *Howl) Send(message []byte) (len int, err error)

Send data over the bi-directional stream

type Validator

type Validator func([]byte) bool

Jump to

Keyboard shortcuts

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