utils

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CloudflareForwardedIP is the client's original IP given by CloudFlare in the request header.
	CloudflareForwardedIP = "CF-Connecting-IP"
)

Variables

This section is empty.

Functions

func GetCharacterIndex added in v1.3.0

func GetCharacterIndex(s string) int

func GetIP

func GetIP(ctx *fasthttp.RequestCtx) string

GetIP gets the forwarded IP from Cloudflare if it's available, or gets the remote IP as given by fasthttp.RequestCtx as a fallback.

func GetServerRoot added in v1.3.0

func GetServerRoot(ctx *fasthttp.RequestCtx) string

GetServerRoot gets the base domain that the server is using. If localhost is being used, it replaces https with http.

func RandBytes

func RandBytes(n int, c chan<- string, onExit func())

RandBytes gets a set of random bytes. Useful for random strings

func StringToZWS added in v1.3.0

func StringToZWS(baseStr string) string

func ZWSToString added in v1.3.0

func ZWSToString(encodedStr string) string

what else am i supposed to call it dumbass

Types

This section is empty.

Jump to

Keyboard shortcuts

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