helpers

package
v3.1.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package helpers contains deterministic, non-secret helpers for native plugins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountTag

func AccountTag(username string, options AccountTagOptions) string

AccountTag returns a Redis Cluster hash-tag for account-scoped keys.

func CountryName

func CountryName(countryCode string) string

CountryName returns the Lua-compatible display name for a country code.

func IsRoutableIP

func IsRoutableIP(ip string) bool

IsRoutableIP reports whether ip is suitable for public internet routing decisions.

func ScopedIP

func ScopedIP(ip string, options IPScopingOptions) string

ScopedIP returns ip or a configured network identifier for stable cache and Redis keys.

Types

type AccountTagOptions

type AccountTagOptions struct {
	HashTagPrefix string
	UseHashTags   bool
}

AccountTagOptions controls Redis Cluster hash-tag generation for account keys.

func DefaultAccountTagOptions

func DefaultAccountTagOptions() AccountTagOptions

DefaultAccountTagOptions returns the Lua-compatible account hash-tag defaults.

type IPScopingOptions

type IPScopingOptions struct {
	IPv4CIDR int
	IPv6CIDR int
}

IPScopingOptions controls deterministic IP network scoping.

Jump to

Keyboard shortcuts

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