Browse Source

Funktionsfähig ohne Pointer

test
Klaus Wendel 2 years ago
parent
commit
4781aac595
  1. 6
      nhooyrioWebsocketAddons/nhooyrioWebsocketAddons.go

6
nhooyrioWebsocketAddons/nhooyrioWebsocketAddons.go

@ -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)
}

Loading…
Cancel
Save