handler

package
v0.0.0-...-e898e3a Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDiscordOauth

func NewDiscordOauth() *oauth2.Config

Types

type EchoTemplates

type EchoTemplates struct {
	// contains filtered or unexported fields
}

EchoTemplates is a custom renderer for echo wrapped with helper functions

func NewTemplates

func NewTemplates() *EchoTemplates

func (*EchoTemplates) Render

func (t *EchoTemplates) Render(w io.Writer, name string, data interface{}, c echo.Context) error

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(DB *sqlx.DB) *Handler

func (*Handler) GetTemplates

func (h *Handler) GetTemplates() *EchoTemplates

func (*Handler) HandleAuth

func (h *Handler) HandleAuth(c echo.Context) error

func (*Handler) HandleAuthCallback

func (h *Handler) HandleAuthCallback(c echo.Context) error

func (*Handler) HandleDashboard

func (h *Handler) HandleDashboard(e echo.Context) error

func (*Handler) HandleInventories

func (h *Handler) HandleInventories(e echo.Context) error

type InventoryData

type InventoryData struct {
	Inventory data.Inventory
	User      UserWrapper
}

type PageData

type PageData struct {
	Title           string
	ContentTemplate string
}

PageData is the data that is passed to the template to render the page

type UserWrapper

type UserWrapper struct {
	discordgo.User
	IconURL string
}

Jump to

Keyboard shortcuts

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