Skip to content

Commit

Permalink
move some structs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sagleft committed Nov 30, 2022
1 parent 715b79c commit 7656227
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions v2/internal/utopia/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,13 +426,13 @@ func (c *UtopiaClient) ToogleChannelNotifications(channelID string, enabled bool
}

// GetNetworkConnections - get current network peers
func (c *UtopiaClient) GetNetworkConnections(channelID string) ([]PeerInfo, error) {
func (c *UtopiaClient) GetNetworkConnections(channelID string) ([]structs.PeerInfo, error) {
response, err := c.apiQuery("getNetworkConnections", map[string]interface{}{})
if err != nil {
return nil, err
}

data := []PeerInfo{}
data := []structs.PeerInfo{}
if err := convertResult(response, &data); err != nil {
return nil, err
}
Expand Down
5 changes: 0 additions & 5 deletions v2/internal/utopia/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,3 @@ type query struct {
Params map[string]interface{} `json:"params"`
Filters map[string]interface{} `json:"filter"`
}

type PeerInfo struct {
Direction int `json:"direction"`
Address string `json:"remoteAddress"`
}
3 changes: 3 additions & 0 deletions v2/messenger.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ type Client interface {

// ToogleChannelNotifications - enable or disable channel notifications
ToogleChannelNotifications(channelID string, enabled bool) error

// GetNetworkConnections - get current network peers
GetNetworkConnections(channelID string) ([]structs.PeerInfo, error)
}

type Config = utopia.Config
Expand Down
5 changes: 5 additions & 0 deletions v2/pkg/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,8 @@ type SearchChannelData struct {
Name string `json:"name"` // Monica
OwnerPubkey string `json:"owner"` // 1B742E8D8DAE682ADD2568BE25B23F35BA7A8BFC1D5D3BCA0EE219A754A48201
}

type PeerInfo struct {
Direction int `json:"direction"`
Address string `json:"remoteAddress"`
}

0 comments on commit 7656227

Please sign in to comment.