utils

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewError

func NewError(ctx *gin.Context, status int, err error)

NewError creates an error in the gin context.

func ParseClueID added in v0.0.8

func ParseClueID(clueString string, gameId int64, rm map[string]int) int64

ParseClueID converts a clue string to a clue ID. Clue strings have the format "clue_DJ_1_2", "clue_FJ" and the parsed int64 is of the form <game_id>0<round>0<clue_index>.

func ParseRoundAndColumn

func ParseRoundAndColumn(clueString string) (int64, int64)

ParseRoundAndColumn parses a clue string and returns the round and column.

Types

type HTTPError

type HTTPError struct {
	Code    int    `json:"code" example:"400"`
	Message string `json:"message" example:"status bad request"`
}

HTTPError is the error response for the API.

Jump to

Keyboard shortcuts

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