quic

package
v0.0.0-...-6f42e1d Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TlsClientConfig = tls.Config{
	InsecureSkipVerify: true,
	NextProtos:         []string{proto.KingIP},
}

Functions

func GenerateTLSConfig

func GenerateTLSConfig() *tls.Config

Setup a bare-bones TLS config for the server. From `https://github.com/quic-go/quic-go/blob/master/example/echo/echo.go`.

func SyncTransport

func SyncTransport(stream quic.Stream, handler transport.HandleFunc, msg proto.Message) (*transport.Transport, error)

Sends message, handles response and abandons the connection.

Types

type Dialer

type Dialer struct {
	// contains filtered or unexported fields
}

func NewDialer

func NewDialer(
	config DialerConfig,
	streamHandler DialerStreamHandleFunc,
) *Dialer

func (*Dialer) Dial

func (s *Dialer) Dial(ctx context.Context) error

type DialerConfig

type DialerConfig struct {
	Addr    string
	Regions map[string]string
}

type DialerStreamHandleFunc

type DialerStreamHandleFunc func(quic.Stream) error

type Listener

type Listener struct {
	// contains filtered or unexported fields
}

func NewListener

func NewListener(
	ctx context.Context,
	config ListenerConfig,
	registerHandler ListenerRegisterHandleFunc,
	regionsHandler ListenerRegionsHandleFunc,
	closeHandler ListenerCloseHandleFunc,
) *Listener

func (*Listener) Listen

func (s *Listener) Listen() error

type ListenerCloseHandleFunc

type ListenerCloseHandleFunc func(uint64)

type ListenerConfig

type ListenerConfig struct {
	Addr string
}

type ListenerRegionsHandleFunc

type ListenerRegionsHandleFunc func(uint64, map[string]string) error

type ListenerRegisterHandleFunc

type ListenerRegisterHandleFunc func(quic.Connection) (uint64, <-chan error, error)

Jump to

Keyboard shortcuts

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