server

package
v0.0.0-...-d5ce679 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AthleteHandler

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

func AthletesHandler

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

func HomeHandler

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

func InitDB

func InitDB(d *Database) *pgxpool.Pool

func LandWorkoutHandler

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

func LandWorkoutsHandler

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

func QueryErgWorkouts

func QueryErgWorkouts() []common.ErgWorkout

func QueryWaterWorkouts

func QueryWaterWorkouts() []common.WaterWorkout

func WaterWorkoutHandler

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

func WaterWorkoutsHandler

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

Types

type Database

type Database struct {
	Port string
	Addr string
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase(opts ...DatabaseOption) *Database

type DatabaseOption

type DatabaseOption func(database *Database)

func WithDBAddr

func WithDBAddr(a string) DatabaseOption

func WithDBPort

func WithDBPort(p string) DatabaseOption

func WithDatabaseName

func WithDatabaseName(n string) DatabaseOption

func WithPassword

func WithPassword(p string) DatabaseOption

func WithUsername

func WithUsername(u string) DatabaseOption

type Server

type Server struct {
	Port string
	Addr string
}

func NewServer

func NewServer(opts ...ServerOption) *Server

func (Server) Start

func (s Server) Start()

type ServerOption

type ServerOption func(*Server)

func WithAddr

func WithAddr(a string) ServerOption

func WithPort

func WithPort(p string) ServerOption

Jump to

Keyboard shortcuts

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