This commit is contained in:
Bel LaPointe
2025-02-12 10:37:02 -07:00
parent a2c44498eb
commit 688b7d9c01
8 changed files with 90 additions and 53 deletions

View File

@@ -1,11 +0,0 @@
package lobby
import "context"
type Lobby interface{}
type lobby struct{}
func NewLobby(ctx context.Context) (Lobby, error) {
return lobby{}, nil
}

View File

@@ -0,0 +1,41 @@
package lobby
import (
"context"
"fmt"
"gitea/price-is-wrong/src/lib"
"io"
)
type Lobby struct{}
func Open(ctx context.Context, id string) (Lobby, error) {
result, err := open(ctx, id)
if err != nil {
return Lobby{}, err
}
if result != nil {
} else if err := create(ctx, id); err != nil {
return Lobby{}, err
} else if result, err = open(ctx, id); err != nil {
return Lobby{}, err
} else if result != nil {
} else {
return Lobby{}, fmt.Errorf("unable to create new lobby %s", id)
}
return *result, err
}
func open(ctx context.Context, id string) (*Lobby, error) {
return nil, io.EOF
}
func create(ctx context.Context, id string) error {
return io.EOF
}
func init(ctx context.Context) error {
_, err := lib.ExtractDB(ctx).ExecContext(ctx, `
`)
return err
}