server

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenDB

func OpenDB(cfg *Config) (*sql.DB, error)

Types

type Config

type Config struct {
	Port    int
	Env     string
	Version string
	DB      struct {
		Dsn          string
		MaxOpenConns int
		MaxIdleConns int
		MaxIdleTime  time.Duration
	}
	APIFootballKey string
	FirebaseCreds  map[string]string
	// only need cors for local development
	Cors struct {
		TrustedOrigins []string
	}
}

func NewConfig

func NewConfig() (*Config, error)

type Server

type Server struct {
	Config             *Config
	Logger             *slog.Logger
	APIFootballService *apifootball.Service
	UsersService       *users.Service
}

func New

func New() *Server

func (*Server) Routes

func (srv *Server) Routes() http.Handler

Jump to

Keyboard shortcuts

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