utils

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCookie

func BuildCookie(ctx context.Context, cookieName, cookieValue, origin string, expireTime time.Time) (string, error)

BuildCookie builds a cookie string.

func ClearAuthCookies

func ClearAuthCookies(ctx context.Context, cookieName, origin string) error

func GetPageToken

func GetPageToken(limit int, offset int) (string, error)

func JSONStr

func JSONStr(v any) string

func MarshalPageToken

func MarshalPageToken(pageToken *modelpb.PageToken) (string, error)

func Ptr

func Ptr[T any](v T) *T

func Unique

func Unique[T comparable](arr []T) []T

func UnmarshalPageToken

func UnmarshalPageToken(s string, pageToken *modelpb.PageToken) error

Types

type Info

type Info struct {
	UserID    int64
	SessionID string
}

func GetInfo

func GetInfo(ctx context.Context) *Info

Jump to

Keyboard shortcuts

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