codes

package
v0.0.0-...-49870ec Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package codes defines application-level codes used to signal the reason for closing a QUIC connection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CodeStrings

func CodeStrings() []string

CodeStrings returns a slice of all String values of the enum

Types

type Code

Code represents an application-level QUIC connection close code. These codes indicate the reason why the server is terminating the connection and saying goodbye to the client.

const (
	// StopServer indicates that the server is stopping and the connection
	// is closed as part of a server shutdown.
	StopServer Code = iota // stop server

	// ToManyConns indicates that the server has too many connections
	// and cannot accept more, so it closes this one.
	ToManyConns // to many connections

	// Done indicates a normal termination of the connection, i.e.,
	// the server is done interacting and closes the connection gracefully.
	Done // bye
)

func CodeString

func CodeString(s string) (Code, error)

CodeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func CodeValues

func CodeValues() []Code

CodeValues returns all values of the enum

func (Code) IsACode

func (i Code) IsACode() bool

IsACode returns "true" if the value is listed in the enum definition. "false" otherwise

func (Code) MarshalText

func (i Code) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for Code

func (Code) String

func (i Code) String() string

func (*Code) UnmarshalText

func (i *Code) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for Code

Jump to

Keyboard shortcuts

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