server

package
v0.0.0-...-ccf00c7 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleBudgetEdit

func HandleBudgetEdit(conn *sql.Conn, w http.ResponseWriter, r *http.Request) error

func HandleBudgetsShow

func HandleBudgetsShow(conn *sql.Conn, w http.ResponseWriter, r *http.Request) error

func HandleGraphShow

func HandleGraphShow(conn *sql.Conn, w http.ResponseWriter, r *http.Request) error

func HandleMonthShow

func HandleMonthShow(conn *sql.Conn, w http.ResponseWriter, r *http.Request) error

func HandleTransactionAdd

func HandleTransactionAdd(conn *sql.Conn, w http.ResponseWriter, r *http.Request) error

func HandleTransactionDelete

func HandleTransactionDelete(conn *sql.Conn, w http.ResponseWriter, r *http.Request) error

func HandleTransactionEdit

func HandleTransactionEdit(conn *sql.Conn, w http.ResponseWriter, r *http.Request) error

func HandleTransactionsShow

func HandleTransactionsShow(conn *sql.Conn, w http.ResponseWriter, r *http.Request) error

Types

type APIError

type APIError struct {
	StatusCode int
	Message    string
}

func NewAPIError

func NewAPIError(statusCode int, err error) APIError

func (APIError) Error

func (e APIError) Error() string

type APIFunc

type APIFunc func(conn *sql.Conn, w http.ResponseWriter, r *http.Request) error

type Server

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

func NewServer

func NewServer(port int, databaseURL string) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) Handle

func (s *Server) Handle(h APIFunc) http.HandlerFunc

func (*Server) InitRouter

func (s *Server) InitRouter() chi.Router

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

Jump to

Keyboard shortcuts

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