Skip to content

Commit c1c0739

Browse files
committed
I hope this is going somewhere
1 parent 5581147 commit c1c0739

37 files changed

+5703
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.idea/
2+
sqlboiler.*
23

34
# Binaries for programs and plugins
45
*.exe

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
# Giesela
22

3+
Giesela is the core service of the, well... Giesela network?
4+
I don't really know, but we can always adjust this later on...
35

4-
# Peers required
6+
## Introduction
57

6-
- [Ari](https://github.com/gieseladev/ari-player) (`io.giesela.ari`)
7-
- [Elakshi](https://github.com/gieseladev/elakshi) (`io.giesela.elakshi`)
8+
In order to support the complex permission and authentication system, Giesela
9+
takes the role of a WAMP Router.
10+
11+
12+
## Peers required
13+
14+
- [Ari](https://github.com/gieseladev/ari-player) (`io.ari`)
15+
- [Elakshi](https://github.com/gieseladev/elakshi) (`io.elakshi`)
816
- [Wampus](https://github.com/gieseladev/wampus) (`com.disord`)

api/wamp/giesela.md

Whitespace-only changes.

api/wamp/procedures.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
# Procedures
3+
4+
## Player
5+
6+
Prefixed with "player."
7+
8+
enqueue()
9+
dequeue()
10+
11+
move()
12+
skip_next()
13+
skip_prev()
14+
15+
pause()
16+
seek()
17+
volume()
18+
19+
## RBAC
20+
21+
Prefixed with "rbac."
22+
23+
get_role()
24+
Get a role by its name or id.
25+
26+
get_roles(target)
27+
Get the roles for a target.
28+
29+
assign_role(role, target)
30+
Add a role to a target.
31+
unassign_role(role, target)
32+
Remove a role from a target.
33+
34+
create_role()
35+
Create a new role.
36+
delete_role()
37+
Delete a role.

cmd/database/generate.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package main
2+
3+
import (
4+
"github.com/volatiletech/sqlboiler/boilingcore"
5+
)
6+
7+
func main() {
8+
_ = boilingcore.Aliases{}
9+
}

cmd/database/main.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package main
2+
3+
import "fmt"
4+
5+
func main() {
6+
if err := DoMigration(); err != nil {
7+
fmt.Println(err)
8+
}
9+
}

cmd/database/migration.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package main
2+
3+
import (
4+
"github.com/golang-migrate/migrate/v4"
5+
_ "github.com/golang-migrate/migrate/v4/database/postgres"
6+
_ "github.com/golang-migrate/migrate/v4/source/file"
7+
)
8+
9+
func DoMigration() error {
10+
m, err := migrate.New(
11+
"file://configs/sql/migrate",
12+
"")
13+
if err != nil {
14+
return err
15+
}
16+
17+
return m.Up()
18+
}

cmd/giesela/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package main
22

3+
// TODO make Giesela a specialised WAMP router!!
4+
35
func main() {
46

57
}

configs/sql/schema.sql

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
create table roles
2+
(
3+
id bigserial primary key,
4+
guild_id text,
5+
name text not null,
6+
permissions smallint[] not null
7+
);
8+
9+
create unique index roles_guild_id_name_uindex
10+
on roles (guild_id, name);
11+
12+
create table role_targets
13+
(
14+
id bigserial primary key,
15+
target text not null,
16+
role_id bigint not null references roles on delete cascade
17+
);

go.mod

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module github.com/gieseladev/giesela
2+
3+
go 1.13
4+
5+
require (
6+
github.com/DATA-DOG/go-sqlmock v1.3.3 // indirect
7+
github.com/ericlagergren/decimal v0.0.0-20191206042408-88212e6cfca9 // indirect
8+
github.com/friendsofgo/errors v0.9.2
9+
github.com/gammazero/nexus/v3 v3.0.0
10+
github.com/getsentry/sentry-go v0.3.1 // indirect
11+
github.com/go-redis/redis/v7 v7.0.0-beta.4
12+
github.com/gofrs/uuid v3.2.0+incompatible // indirect
13+
github.com/golang-migrate/migrate/v4 v4.7.0
14+
github.com/kat-co/vala v0.0.0-20170210184112-42e1d8b61f12
15+
github.com/lib/pq v1.0.0
16+
github.com/spf13/viper v1.6.1
17+
github.com/stretchr/testify v1.4.0
18+
github.com/volatiletech/inflect v0.0.0-20170731032912-e7201282ae8d // indirect
19+
github.com/volatiletech/null v8.0.0+incompatible
20+
github.com/volatiletech/sqlboiler v3.6.1+incompatible
21+
)

0 commit comments

Comments
 (0)