static

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: LGPL-2.1 Imports: 7 Imported by: 0

Documentation

Overview

Ytl Copyright (C) 2022 DomesticMoth <silkmoth@protonmail.com>

This file is part of Ytl.

Ytl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

Ytl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Ytl Copyright (C) 2022 DomesticMoth <silkmoth@protonmail.com>

This file is part of Ytl.

Ytl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

Ytl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Ytl Copyright (C) 2022 DomesticMoth <silkmoth@protonmail.com>

This file is part of Ytl.

Ytl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

Ytl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Index

Constants

View Source
const (
	SECURE_LVL_UNSECURE               uint = 0
	SECURE_LVL_ENCRYPTED                   = 1
	SECURE_LVL_VERIFIED                    = 2
	SECURE_LVL_ENCRYPTED_AND_VERIFIED      = 3
)

Variables

This section is empty.

Functions

func META_HEADER

func META_HEADER() []byte

Types

type AllowList

type AllowList []ed25519.PublicKey

func (*AllowList) IsAllow

func (a *AllowList) IsAllow(key ed25519.PublicKey) bool

type ConnClosedByDeduplicatorError

type ConnClosedByDeduplicatorError struct{}

func (ConnClosedByDeduplicatorError) Error

func (ConnClosedByDeduplicatorError) Temporary

func (e ConnClosedByDeduplicatorError) Temporary() bool

func (ConnClosedByDeduplicatorError) Timeout

func (e ConnClosedByDeduplicatorError) Timeout() bool

type ConnResult

type ConnResult struct {
	Conn          net.Conn
	Pkey          ed25519.PublicKey
	SecurityLevel uint
}

type ConnTimeoutError

type ConnTimeoutError struct{}

func (ConnTimeoutError) Error

func (e ConnTimeoutError) Error() string

func (ConnTimeoutError) Temporary

func (e ConnTimeoutError) Temporary() bool

func (ConnTimeoutError) Timeout

func (e ConnTimeoutError) Timeout() bool

type InapplicableProxyTypeError

type InapplicableProxyTypeError struct {
	Transport string
	Proxy     url.URL
}

func (InapplicableProxyTypeError) Error

func (InapplicableProxyTypeError) Temporary

func (e InapplicableProxyTypeError) Temporary() bool

func (InapplicableProxyTypeError) Timeout

func (e InapplicableProxyTypeError) Timeout() bool

type InvalidUriError

type InvalidUriError struct {
	Err string
}

func (InvalidUriError) Error

func (e InvalidUriError) Error() string

func (InvalidUriError) Temporary

func (e InvalidUriError) Temporary() bool

func (InvalidUriError) Timeout

func (e InvalidUriError) Timeout() bool

type IvalidPeerPublicKey

type IvalidPeerPublicKey struct {
	Text string
}

func (IvalidPeerPublicKey) Error

func (e IvalidPeerPublicKey) Error() string

func (IvalidPeerPublicKey) Temporary

func (e IvalidPeerPublicKey) Temporary() bool

func (IvalidPeerPublicKey) Timeout

func (e IvalidPeerPublicKey) Timeout() bool

type ProtoVersion

type ProtoVersion struct {
	Major uint8
	Minor uint8
}

func PROTO_VERSION

func PROTO_VERSION() ProtoVersion

Because there are no constants structures in go

func (ProtoVersion) String

func (e ProtoVersion) String() string

type Transport

type Transport interface {
	GetScheme() string
	Connect(ctx context.Context, uri url.URL, proxy *url.URL, key ed25519.PrivateKey) (ConnResult, error)
	Listen(ctx context.Context, uri url.URL, key ed25519.PrivateKey) (TransportListener, error)
}

type TransportListener

type TransportListener interface {
	// Accept waits for and returns the next connection to the listener.
	Accept() (net.Conn, error)

	// Accept waits for and returns the next connection with optional transport key to the listener.
	AcceptConn() (ConnResult, error)

	// Close closes the listener.
	// Any blocked Accept operations will be unblocked and return errors.
	Close() error

	// Addr returns the listener's network address.
	Addr() net.Addr
}

func ListenerToTransportListener

func ListenerToTransportListener(linstener net.Listener, secLvl uint) TransportListener

type TransportSecurityCheckError

type TransportSecurityCheckError struct {
	Expected ed25519.PublicKey
	Received ed25519.PublicKey
}

func (TransportSecurityCheckError) Error

func (TransportSecurityCheckError) Temporary

func (e TransportSecurityCheckError) Temporary() bool

func (TransportSecurityCheckError) Timeout

func (e TransportSecurityCheckError) Timeout() bool

type UnacceptableAddressError

type UnacceptableAddressError struct {
	Text string
}

func (UnacceptableAddressError) Error

func (e UnacceptableAddressError) Error() string

func (UnacceptableAddressError) Temporary

func (e UnacceptableAddressError) Temporary() bool

func (UnacceptableAddressError) Timeout

func (e UnacceptableAddressError) Timeout() bool

type UnknownProtoError

type UnknownProtoError struct{}

func (UnknownProtoError) Error

func (e UnknownProtoError) Error() string

func (UnknownProtoError) Temporary

func (e UnknownProtoError) Temporary() bool

func (UnknownProtoError) Timeout

func (e UnknownProtoError) Timeout() bool

type UnknownProtoVersionError

type UnknownProtoVersionError struct {
	Expected ProtoVersion
	Received ProtoVersion
}

func (UnknownProtoVersionError) Error

func (e UnknownProtoVersionError) Error() string

func (UnknownProtoVersionError) Temporary

func (e UnknownProtoVersionError) Temporary() bool

func (UnknownProtoVersionError) Timeout

func (e UnknownProtoVersionError) Timeout() bool

type UnknownSchemeError

type UnknownSchemeError struct {
	Scheme string
}

func (UnknownSchemeError) Error

func (e UnknownSchemeError) Error() string

func (UnknownSchemeError) Temporary

func (e UnknownSchemeError) Temporary() bool

func (UnknownSchemeError) Timeout

func (e UnknownSchemeError) Timeout() bool

Jump to

Keyboard shortcuts

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