gs1

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrResponseIncomplete = errors.New("response payload is not complete")
	ErrResponseMalformed  = errors.New("response payload contains invalid data")
)

Functions

func PrepareGS1Server

func PrepareGS1Server(responses chan []byte) (*udp.Server, func())

func ServerFactory

func ServerFactory(
	handler func(ctx context.Context, conn *net.UDPConn, addr *net.UDPAddr, req []byte),
) (*udp.Server, func())

Types

type Param

type Param struct {
	Name  []byte
	Value []byte
}

type QueryVersion

type QueryVersion int
const (
	VerUnknown QueryVersion = iota
	VerVanilla
	VerAM
	VerGS1
)

func (QueryVersion) String

func (ver QueryVersion) String() string

type Response

type Response struct {
	Fields     map[string]string
	Players    []map[string]string
	Objectives []map[string]string
	Version    QueryVersion
}
var Blank Response

func Query

func Query(ctx context.Context, addr netip.AddrPort, timeout time.Duration) (Response, error)

Jump to

Keyboard shortcuts

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