handlers

package
v0.0.0-...-22d5775 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CountService

type CountService interface {
	Increment(ctx context.Context, it services.IncrementType, sessionID string) (counts services.Counts, err error)
	Get(ctx context.Context, sessionID string) (counts services.Counts, err error)
}

type DefaultHandler

type DefaultHandler struct {
	Log          *slog.Logger
	CountService CountService
}

func New

func New(log *slog.Logger, cs CountService) *DefaultHandler

func (*DefaultHandler) Get

func (*DefaultHandler) Post

func (*DefaultHandler) ServeHTTP

func (h *DefaultHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*DefaultHandler) View

func (h *DefaultHandler) View(w http.ResponseWriter, r *http.Request, props ViewProps)

type ViewProps

type ViewProps struct {
	Counts services.Counts
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳