games struct stubbed
parent
81af991c58
commit
f40fdd60da
|
|
@ -0,0 +1,9 @@
|
|||
package main
|
||||
|
||||
type Games struct {
|
||||
db DB
|
||||
}
|
||||
|
||||
func NewGames(db DB) Games {
|
||||
return Games{db: db}
|
||||
}
|
||||
|
|
@ -27,10 +27,16 @@ func run(ctx context.Context) error {
|
|||
return err
|
||||
}
|
||||
|
||||
db, err := NewDB(ctx, config.DB.Scheme, config.DB.Conn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
S := &S{
|
||||
ctx: ctx,
|
||||
limiter: rate.NewLimiter(10, 10),
|
||||
config: config,
|
||||
games: NewGames(db),
|
||||
}
|
||||
|
||||
s := &http.Server{
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ type S struct {
|
|||
ctx context.Context
|
||||
limiter *rate.Limiter
|
||||
config Config
|
||||
games Games
|
||||
}
|
||||
|
||||
func (s *S) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue