agdprotobuf

package
v0.0.0-...-fa1ca77 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package agdprotobuf contains protobuf utils.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteSlicesToIPs

func ByteSlicesToIPs(data [][]byte) (ips []netip.Addr, err error)

ByteSlicesToIPs converts a slice of byte slices into a slice of netip.Addrs.

func IPToBytes

func IPToBytes(ip netip.Addr) (b []byte)

IPToBytes is a wrapper around netip.Addr.MarshalBinary that ignores the always-nil error.

func IPsToByteSlices

func IPsToByteSlices(ips []netip.Addr) (data [][]byte)

IPsToByteSlices is a wrapper around netip.Addr.MarshalBinary that ignores the always-nil errors.

func UnsafelyConvertStrSlice

func UnsafelyConvertStrSlice[T1, T2 ~string](s []T1) (res []T2)

UnsafelyConvertStrSlice checks if []T1 can be converted to []T2 at compile time and, if so, converts the slice using package unsafe.

Slices resulting from this conversion must not be mutated. TODO(f.setrakov): Generalize.

func UnsafelyConvertUint32Slice

func UnsafelyConvertUint32Slice[T1, T2 ~uint32](s []T1) (res []T2)

UnsafelyConvertUint32Slice checks if []T1 can be converted to []T2 at compile time and, if so, converts the slice using package unsafe.

Slices resulting from this conversion must not be mutated.

Types

This section is empty.

Jump to

Keyboard shortcuts

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