types

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: Unlicense Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ApiResponseFactory = new(apiResponseAlias)
View Source
var DefaultPageTitle = "" // Set in main.go

Functions

This section is empty.

Types

type ApiResponse

type ApiResponse struct {
	Success bool        `json:"success"`
	Data    interface{} `json:"data,omitempty"`
	Error   error       `json:"error,omitempty"`
}

type Done

type Done = bool

Done is an alias for bool that indicates whether a goroutine is done. This is to have clarity between a bool result and a done indicator.

type GoResult

type GoResult[T any] struct {
	Response T
	Err      error
}

GoResult is a wrapper for a goroutine result with error handling

type HandlerInitContext

type HandlerInitContext struct {
	DB *sqlx.DB
}

HandlerInitContext is passed to the Initialize method of a HandlerRegistrar

type HandlerRegistrar

type HandlerRegistrar interface {
	Handler(engine *gin.Engine)
	Initialize(initContext *HandlerInitContext)
}

type MetaData

type MetaData struct {
	Title       string
	Description string
	Image       string
}

MetaData contains SEO information for a page PageTitle: The title of the page (defaults to website name) PageDescription: The description of the page (optional) PageImage: The image to be used when sharing the page (optional)

type StructuredPageData

type StructuredPageData struct {
	Meta *MetaData
	Data map[string]interface{}
}

StructuredPageData provides a structured way to pass data to a page Meta: SEO information for the page Data: Any data required by the page

func NewStructurePageData

func NewStructurePageData(data map[string]interface{}, meta *MetaData) StructuredPageData

type Tuple

type Tuple[T any, U any] struct {
	Item1 T
	Item2 U
}

Tuple is a wrapper for a tuple with 2 items

type Tuple3

type Tuple3[T any, U any, V any] struct {
	Item1 T
	Item2 U
	Item3 V
}

Tuple3 is a wrapper for a tuple with 3 items

type Tuple4

type Tuple4[T any, U any, V any, W any] struct {
	Item1 T
	Item2 U
	Item3 V
	Item4 W
}

Tuple4 is a wrapper for a tuple with 4 items

Jump to

Keyboard shortcuts

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