moved to src/ folder; add users

This commit is contained in:
Settel 2021-07-31 22:42:35 +02:00
parent b2d3e38236
commit dd76910326
15 changed files with 28 additions and 3 deletions

View File

@ -3,10 +3,10 @@ info:
@perl -ne 'm/^([a-zA-Z0-9\-]+):/ && print(" $$1\n");' Makefile @perl -ne 'm/^([a-zA-Z0-9\-]+):/ && print(" $$1\n");' Makefile
build: build:
go build knyt.go cd src/ && go build -o ../knyt knyt.go
run: run:
go run knyt.go cd src/ && go run knyt.go
run-loop: run-loop:
pexec -R -c -e TARGET \ pexec -R -c -e TARGET \
@ -15,7 +15,7 @@ run-loop:
-- $(MAKE) '$$TARGET' -- $(MAKE) '$$TARGET'
run-standalone: run-standalone:
./knyt cd src/ && ../knyt
_run-endless-loop: _run-endless-loop:
while true; do $(MAKE) run || sleep 3; done while true; do $(MAKE) run || sleep 3; done

View File

@ -0,0 +1,5 @@
{
id: "764353",
name: "Settel",
role: "admin",
}

View File

@ -0,0 +1,5 @@
{
id: "837293",
name: "Player #1",
role: "player",
}

View File

@ -0,0 +1,7 @@
package users
type User struct {
Id string `json:"id"`
Name string `json:"name"`
Role string `json:"role"`
}

View File

@ -0,0 +1,8 @@
package users
func NewUser(id, name string) *User {
return &User{
id: id,
name: name,
}
}