utils

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdminAccountID = "00000000-0000-0000-0000-000000000000"
)

Variables

View Source
var (
	DebugEnabled bool
)

Functions

func DoRequest

func DoRequest(req *http.Request) (*http.Response, error)

func GetUserID

func GetUserID(ctx context.Context) (string, error)

GetUserID gets the Nakama UserID from the given context.

func LogError

func LogError(
	logger runtime.Logger,
	err error,
	code codes.Code,
) (string, error)

func LogErrorWithMessageAndCode

func LogErrorWithMessageAndCode(
	logger runtime.Logger,
	err error,
	code codes.Code,
	format string,
	v ...interface{},
) (string, error)

func MakeHTTPURL

func MakeHTTPURL(resource string, url string) string

func MakeWebSocketURL

func MakeWebSocketURL(resource string, url string) string

func MarshalResult

func MarshalResult(logger runtime.Logger, result any) (string, error)

MarshalResult marshals the given result and converts any marshalling error into a "Internal" RPC error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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