handlers

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGetStateHandler

func NewGetStateHandler(app AppGetState) http.Handler

func NewSetStateHandler

func NewSetStateHandler(app AppSetState) http.Handler

func OpenAPIHandler

func OpenAPIHandler(w http.ResponseWriter, r *http.Request)

func WelcomeHandler

func WelcomeHandler(w http.ResponseWriter, r *http.Request)

Types

type AppGetState

type AppGetState interface {
	GetState(ctx context.Context) map[int]int
}

type AppSetState

type AppSetState interface {
	SetState(ctx context.Context, state map[int]int) (map[int]int, error)
	SetOne(ctx context.Context, gameId, botsNumber int) (map[int]int, error)
}

type GetStateHandler

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

func (*GetStateHandler) ServeHTTP

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

type SetStateHandler

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

func (*SetStateHandler) ServeHTTP

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

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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