internal

package
v0.0.0-...-7e02a57 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTemplateCache

func NewTemplateCache() (map[string]*template.Template, error)

Types

type Application

type Application struct {
	DB             *sql.DB
	FormDecoder    *form.Decoder
	Logger         *slog.Logger
	SessionManager *scs.SessionManager
	Snippets       *models.SnippetModel
	TemplateCache  map[string]*template.Template
	Users          *models.UserModel
}

func (*Application) IsAuthenticated

func (app *Application) IsAuthenticated(r *http.Request) bool

Return true if the current request is from an authenticated user, otherwise false.

func (*Application) NewTemplateData

func (app *Application) NewTemplateData(r *http.Request) templateData

func (*Application) Routes

func (app *Application) Routes(config Config) http.Handler

type Config

type Config struct {
	Addr string
}

func (*Config) OpenDb

func (c *Config) OpenDb() (*sql.DB, error)

func (*Config) Parse

func (c *Config) Parse()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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