unlogged

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

package unlogged provides functions to handle unlogged users.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromAddr

func FromAddr(ctx context.Context, addr string) (server.User, error)

FromAddr constructs a server.User from an address string like http.Request.RemoteAddr. The user is created if necessary.

func FromHash

func FromHash(ctx context.Context, hash uint32) (user server.User, err error)

FromHash constructs a server.User from a hash, creating the user if necessary.

func HashAddr

func HashAddr(addr string) uint32

HashAddr produces a 24 bits hash sum from address strings like http.Request.RemoteAddr. The sum is guaranteed to be the same from the same IP. The fonction is only pertinent for IPv4 addresses, but should never fail.

func LE24Bits

func LE24Bits(input uint32) []byte

LE24Bits converts a 24 bits unsigned integer to its Little-Endian representation.

Types

This section is empty.

Jump to

Keyboard shortcuts

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