Funktionsfähig ohne Pointer

This commit is contained in:
Klaus Wendel, archium GmbH 2020-10-07 13:19:13 +02:00
parent eff7131cb7
commit 4781aac595
1 changed files with 6 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package nhooyrioWebsocketAddons
import (
"context"
"encoding/json"
"fmt"
"nhooyr.io/websocket"
"nhooyr.io/websocket/wsjson"
@ -12,6 +13,8 @@ type GosmContainerSection struct {
TagID string `json:"tagid"`
Attribute string `json:"attribute"` // might left empty
Content string `json:"content"`
Upstream bool `json:"streamdirection"` // up = true / down = false
Status string `json:"status"` // reserved for status message; type errors is out of bounds
}
type GosmContainer []GosmContainerSection
@ -26,6 +29,9 @@ type GosmAdapter interface {
func (r GosmContainer) Convert() (GosmAdapter, error) {
buffer, err := json.Marshal(r)
fmt.Println("Hier", r)
r = GosmContainer{GosmContainerSection{"E", "FF", "GGG", true, "Hallo"}}
fmt.Println("Hier2", r)
if err != nil {
panic(err)
}