utilities

package
v0.0.0-...-057e48f Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckObjectID

func CheckObjectID(hexID string) bool

CheckObjectID checks whether a hexID is null or now

func GenerateObjectID

func GenerateObjectID() string

GenerateObjectID for index keying records of data

func HandleOptionsRequest

func HandleOptionsRequest(w http.ResponseWriter, r *http.Request)

HandleOptionsRequest handles incoming OPTIONS request

func RespondWithError

func RespondWithError(w http.ResponseWriter, status int, error JWTError)

RespondWithError returns JSON Error to Requested is Auth is bad

func SetResponseHeaders

func SetResponseHeaders(w http.ResponseWriter, authToken string, apiKey string) http.ResponseWriter

SetResponseHeaders sets the response headers being sent back to the client

Types

type JWTError

type JWTError struct {
	Message string `json:"message"`
}

JWTError is a struct that is used to contain a json encoded error message for any JWT related errors

type JsonErr

type JsonErr struct {
	Code int    `json:"code"`
	Text string `json:"text"`
}

JsonErr structures a standard error to return

Jump to

Keyboard shortcuts

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