Add Database Functions
This commit is contained in:
parent
126070829c
commit
253b020733
22 changed files with 1076 additions and 119 deletions
|
@ -1,7 +1,7 @@
|
|||
package device
|
||||
|
||||
type Device struct {
|
||||
Id string `json:"id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Keys map[string]string `json:"keys,omitempty"`
|
||||
Id string `json:"id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Keys map[string]*Key `json:"keys,omitempty"`
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package device
|
||||
|
||||
func New() device *Device {
|
||||
|
||||
}
|
||||
func New() (device *Device) {
|
||||
return
|
||||
}
|
||||
|
|
7
entities/device/key.go
Normal file
7
entities/device/key.go
Normal file
|
@ -0,0 +1,7 @@
|
|||
package device
|
||||
|
||||
type Key struct {
|
||||
Id string `json:"id,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
package event
|
||||
|
||||
// TODO: Check if it can be deleted
|
||||
|
||||
type EDU struct {
|
||||
Type string `json:"type,omitempty"`
|
||||
Content string `json:"content,omitempty"`
|
||||
|
|
|
@ -5,6 +5,6 @@ type Event struct {
|
|||
RoomId string `json:"roomId,omitempty"`
|
||||
EventType string `json:"eventType,omitempty"`
|
||||
Content string `json:"content,omitempty"`
|
||||
Parent string `json:"parent,omitempty"`
|
||||
ParentId string `json:"parent,omitempty"`
|
||||
Depth int `json:"depth,omitempty"`
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package event
|
||||
|
||||
func New() event *Event {
|
||||
|
||||
}
|
||||
func New() (event *Event) {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -5,9 +5,9 @@ import (
|
|||
)
|
||||
|
||||
type Room struct {
|
||||
Id string `json:"id,omitempty"`
|
||||
Messages map[string]event.Event `json:"messages,omitempty"`
|
||||
State map[string]event.Event `json:"state,omitempty"`
|
||||
Members []string `json:"members,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
Id string `json:"id,omitempty"`
|
||||
Messages map[string]*event.Event `json:"messages,omitempty"`
|
||||
//State map[string]event.Event `json:"state,omitempty"`
|
||||
Members []string `json:"members,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package room
|
||||
|
||||
func New() room *Room {
|
||||
|
||||
}
|
||||
func New() (room *Room) {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -5,7 +5,9 @@ import (
|
|||
)
|
||||
|
||||
type Transaction struct {
|
||||
Id string `json:"id,omitempty"`
|
||||
PDUS map[string]event.Event `json:"pdus,omitempty"`
|
||||
EDUS []event.EDU `json:"edus,omitempty"`
|
||||
Id string `json:"id,omitempty"`
|
||||
Origin string `json:"origin,omitempty"`
|
||||
Timestamp int `json:"timestamp,omitempty"`
|
||||
PDUS map[string]*event.Event `json:"pdus,omitempty"`
|
||||
//EDUS []event.EDU `json:"edus,omitempty"`
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package transaction
|
||||
|
||||
func New() transaction *Transaction {
|
||||
|
||||
}
|
||||
func New() (transaction *Transaction) {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
)
|
||||
|
||||
type User struct {
|
||||
Id string `json:"id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Password string `json:"password,omitempty"`
|
||||
Devices map[string]device.Device `json:"devices,omitempty"`
|
||||
Id string `json:"id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Password string `json:"password,omitempty"`
|
||||
Devices map[string]*device.Device `json:"devices,omitempty"`
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package user
|
||||
|
||||
func New() user *User {
|
||||
|
||||
}
|
||||
func New() (user *User) {
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue