web

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package web provides a web API for the generator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AchievementOutputType

type AchievementOutputType string

AchievementOutputType is the type of output for the achievement endpoint.

var (
	AchievementOutputTypeDefault  AchievementOutputType = ""
	AchievementOutputTypeDownload AchievementOutputType = "download"
)

AchievementOutputType constants.

type AchievementRequest

type AchievementRequest struct {
	Background string `json:"background"`
	Title      string `json:"title"`
	Text       string `json:"text"`

	Output AchievementOutputType `json:"output"`
}

AchievementRequest is the request body for the achievement endpoint.

type ErrorResponse

type ErrorResponse struct {
	Error   string `json:"error"`
	Message string `json:"message"`
}

ErrorResponse is the response body for errors.

type WebAPI

type WebAPI struct {
	Generator *generator.Generator
}

WebAPI provides a web API for the generator using the fiber framework.

func New

func New(generator *generator.Generator) WebAPI

New returns a new WebAPI.

func (WebAPI) StartWebAPI

func (web WebAPI) StartWebAPI()

StartWebAPI starts the WebAPI, registers all routes and blocks until the server is shut down.

Jump to

Keyboard shortcuts

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