Documentation
¶
Overview ¶
Package chat provides tools for working with the chat-oriented QUIC based protocol such as server, client, etc.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidToken is returned when a token received from a client // does not match the expected size or format. ErrInvalidToken = errors.New("invalid token") // ErrInternal is returned when an unexpected internal server error occurs, // such as failures in the handshake process or token handling. ErrInternal = errors.New("internal server error") )
var ClientOptions clientOptionsNamespace
ClientOptions provides available options for client.
var ErrServerNotRunning = errors.New("server not running")
ErrServerNotRunning indicates that a server operation was attempted while the server is not running.
var ServerOptions serverOptionsNamespace
ServerOptions provides available options for server.
Functions ¶
func LogLevelStrings ¶
func LogLevelStrings() []string
LogLevelStrings returns a slice of all String values of the enum
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a QUIC chat client.
func NewClient ¶
func NewClient(opts ...ClientOption) *Client
NewClient creates a client with specified options.
type ClientOption ¶
type ClientOption func(cfg *clientConfig)
ClientOption applies option to client.
type LogLevel ¶
type LogLevel int8
LogLevel represents the severity level of a log message.
func LogLevelString ¶
LogLevelString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func LogLevelValues ¶
func LogLevelValues() []LogLevel
LogLevelValues returns all values of the enum
func (LogLevel) IsALogLevel ¶
IsALogLevel returns "true" if the value is listed in the enum definition. "false" otherwise
func (LogLevel) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface for LogLevel
func (*LogLevel) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface for LogLevel
type NopTokenRepo ¶
type NopTokenRepo struct{}
NopTokenRepo is a no-operation TokenRepo.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server provides chat sessions.
func NewServer ¶
func NewServer(opts ...ServerOption) *Server
NewServer creates a server with specified options.
type ServerOption ¶
type ServerOption func(cfg *serverConfig)
ServerOption applies option to server.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
client
command
|
|
|
server
command
|
|
|
Package codes defines application-level codes used to signal the reason for closing a QUIC connection.
|
Package codes defines application-level codes used to signal the reason for closing a QUIC connection. |
|
internal
|
|
|
msg
Package msg provides utilities for constructing, sending and receiving binary messages with fixed-size headers and variable payloads.
|
Package msg provides utilities for constructing, sending and receiving binary messages with fixed-size headers and variable payloads. |