webserver

package
v1.1.44 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

How to Use //go:embed https://blog.carlmjohnson.net/post/2021/how-to-use-go-embed/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFileSystem

func GetFileSystem(embededFiles embed.FS, rootDir string, useEmbedded bool) fs.FS

func GetHttpFileSystem

func GetHttpFileSystem(embededFiles embed.FS, rootDir string, useEmbedded bool) http.FileSystem

Types

type FiberServer

type FiberServer struct {
	App *fiber.App

	TemplateDataProviders map[string]TemplateDataProviderFn
	// contains filtered or unexported fields
}

func NewFiberServer

func NewFiberServer(viewsFolder string, staticFolder string, listenPort int) *FiberServer

func (*FiberServer) AddTemplateDataProvider

func (s *FiberServer) AddTemplateDataProvider(path string, callback TemplateDataProviderFn) error

func (*FiberServer) GetTemplateDataProvider

func (s *FiberServer) GetTemplateDataProvider(path string) TemplateDataProviderFn

func (*FiberServer) Run

func (s *FiberServer) Run(ctx context.Context) error

type HttpHandlerFuncWrapper

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

HttpHandlerFuncWrapper allow tu use a http.HandleFund as a http.Handler

func NewHttpHandlerFuncWrapper

func NewHttpHandlerFuncWrapper(fn func(http.ResponseWriter, *http.Request)) *HttpHandlerFuncWrapper

func (*HttpHandlerFuncWrapper) ServeHTTP

type TemplateDataProviderFn

type TemplateDataProviderFn func(c *fiber.Ctx) (fiber.Map, error)

Directories

Path Synopsis
cmd
ginpongo2 Module

Jump to

Keyboard shortcuts

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