themes

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	List(ctx *gin.Context)
	Find(ctx *gin.Context)
	Config(ctx *gin.Context)
	Templates(ctx *gin.Context)
	Layouts(ctx *gin.Context)
	Update(ctx *gin.Context)
}

Handler defines methods for the themes to interact with the server.

type Themes

type Themes struct {
	*deps.Deps
}

Themes defines the handler for all site routes.

func New

func New(d *deps.Deps) *Themes

New

Creates a new themes handler.

func (*Themes) Config

func (t *Themes) Config(ctx *gin.Context)

Config

Returns http.StatusOK if theme config was obtained successfully.

func (*Themes) Find

func (t *Themes) Find(ctx *gin.Context)

Find

Returns http.StatusOK if the theme config was obtained. Returns http.StatusBadRequest if the name wasn't passed. Returns http.StatusInternalServerError if there as an error obtaining the config.

func (*Themes) Layouts

func (t *Themes) Layouts(ctx *gin.Context)

Layouts

Returns http.StatusInternalServerError if there was an error getting the layouts. Returns http.StatusOK if the layouts were obtained successfully or there were none found.

func (*Themes) List

func (t *Themes) List(ctx *gin.Context)

List

Returns http.StatusInternalServerError if there was an error getting the themes. Returns http.StatusOK if the themes were obtained successfully or there were none found.

func (*Themes) Templates

func (t *Themes) Templates(ctx *gin.Context)

Templates

Returns http.StatusInternalServerError if there was an error getting the templates. Returns http.StatusOK if the templates were obtained successfully or there were none found.

func (*Themes) Update

func (t *Themes) Update(ctx *gin.Context)

Update

Returns http.StatusOK if the theme was changed. Returns http.StatusInternalServerError if there was an error updating or formatting the post. Returns http.StatusBadRequest if the the validation failed, there was a conflict, or the post wasn't found.

type UpdateTheme

type UpdateTheme struct {
	Theme string `json:"theme" binding:"required"`
}

UpdateTheme defines the data to be validated when a theme is switched.

Jump to

Keyboard shortcuts

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