response

package
v0.0.0-...-558561e Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleError

func HandleError(w http.ResponseWriter, err error)

func WriteJSON

func WriteJSON(w http.ResponseWriter, status int, response any)

func WriteJSONError

func WriteJSONError(w http.ResponseWriter, status int, message string, errors map[string]string)

Types

type AuthResponse

type AuthResponse struct {
	ID     uuid.UUID `json:"id"`
	Name   string    `json:"name"`
	Email  string    `json:"email"`
	APIKey string    `json:"api_key"`
}

type ErrorResponse

type ErrorResponse struct {
	Message string            `json:"message"`
	Errors  map[string]string `json:"errors,omitempty"`
}

type EventResponse

type EventResponse struct {
	ID          uuid.UUID    `json:"id"`
	User        UserResponse `json:"user"`
	Name        string       `json:"name"`
	Description string       `json:"description"`
	Address     string       `json:"address"`
	StartTime   time.Time    `json:"start_time"`
	EndTime     time.Time    `json:"end_time"`
}

type UserResponse

type UserResponse struct {
	ID   uuid.UUID `json:"id"`
	Name string    `json:"name"`
}

Jump to

Keyboard shortcuts

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