util

package
v0.0.0-...-347cd60 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const ConversationIDLength = 12

Conversations

View Source
const ConversationTokenIDLength = 12

Conversation tokens

View Source
const ConversationTokenLength = 32
View Source
const MailboxTokenLength = 64

Mailbox

View Source
const MaxConversationDataLength = 10_000 // Not sure about this number yet, but should be good for now
View Source
const MaxConversationMembers = 100
View Source
const MaxConversationTokenDataLength = 2_000 // Not sure about this number yet, but should be good for now
View Source
const StatusError = 2
View Source
const StatusOffline = 1
View Source
const StatusOnline = 0

Variables

View Source
var Log = log.New(os.Stdout, "chat-server ", log.Flags())
View Source
var OwnPath = ""

The domain of the chat server

Functions

func GenerateToken

func GenerateToken(tkLength int32) string

func Hash

func Hash(str string) []byte

Hashes using SHA256

func HashString

func HashString(str string) string

Hashes using SHA256

func IsExpired

func IsExpired(c *fiber.Ctx) bool

IsExpired checks if the token is expired

func Node64

func Node64(id int64) string

func NodeTo64

func NodeTo64(id string) int64

func PrintIfTesting

func PrintIfTesting(v ...any)

func TimestampToken

func TimestampToken(time int64) (string, error)

func VerifyTimestampToken

func VerifyTimestampToken(timestampToken string) (int64, bool)

Types

This section is empty.

Jump to

Keyboard shortcuts

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