util

package
v0.0.0-...-b7bd2ad Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnqueueRequestLog

func EnqueueRequestLog(entry LogEntry)

func GetLogChannelSize

func GetLogChannelSize() int

func PointerNotNil

func PointerNotNil[T any](ptr *T) bool

func PointerNotNilIdx

func PointerNotNilIdx[T any](ptr *T, _ int) bool

func StringFromPointer

func StringFromPointer(ptr *string) string

func WriteChannelLogsToFile

func WriteChannelLogsToFile()

func WriteLogsToFile

func WriteLogsToFile(date time.Time, entries []LogEntry)

Types

type DoublyLinkedList

type DoublyLinkedList[T any] struct {
	// contains filtered or unexported fields
}

func DoublyLinkedListFromSlice

func DoublyLinkedListFromSlice[T any](slice []T) *DoublyLinkedList[T]

func (*DoublyLinkedList[T]) Last

func (l *DoublyLinkedList[T]) Last() *T

func (*DoublyLinkedList[T]) PeekFirst

func (l *DoublyLinkedList[T]) PeekFirst() *T

func (*DoublyLinkedList[T]) PeekLast

func (l *DoublyLinkedList[T]) PeekLast() *T

func (*DoublyLinkedList[T]) PopFirst

func (l *DoublyLinkedList[T]) PopFirst() *T

func (*DoublyLinkedList[T]) PushEnd

func (l *DoublyLinkedList[T]) PushEnd(data T)

func (*DoublyLinkedList[T]) PushStart

func (l *DoublyLinkedList[T]) PushStart(data T)

func (*DoublyLinkedList[T]) Size

func (l *DoublyLinkedList[T]) Size() int

func (*DoublyLinkedList[T]) ToSlice

func (l *DoublyLinkedList[T]) ToSlice() []T

type LogEntry

type LogEntry struct {
	Timestamp time.Time `json:"timestamp"`
	UserID    string    `json:"user_id"`
	Endpoint  string    `json:"endpoint"`
	FriendID  string    `json:"friend_id"`
}

func GetLogsForDate

func GetLogsForDate(date time.Time) (logEntries []LogEntry, err error)

type Node

type Node[T any] struct {
	Data T
	Prev *Node[T]
	Next *Node[T]
}

func (*Node[T]) InsertAfter

func (n *Node[T]) InsertAfter(data T) *Node[T]

func (*Node[T]) InsertBefore

func (n *Node[T]) InsertBefore(data T) *Node[T]

func (*Node[T]) SwapWithNext

func (this *Node[T]) SwapWithNext()

Jump to

Keyboard shortcuts

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