adapter

package
v0.0.0-...-52ab7f8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	Index string
	Doc   StateDoc
}

func (*Document) String

func (d *Document) String() string

type HealthInfo

type HealthInfo struct {
	UUID  string `json:"n_uuid"`
	State int    `json:"state"`
}

type Node

type Node struct {
	UUID     string `json:"uuid"`
	Name     string `json:"name"`
	Group    string `json:"group"`
	Location struct {
		Lat float64 `json:"lat"`
		Lon float64 `json:"lon"`
	} `json:"location"`
}

func GetNodeInfo

func GetNodeInfo(s *States) ([]Node, error)

type NodeState

type NodeState struct {
	NodeID string `json:"n_uuid"`
	State  bool   `json:"state"`
}

type StateDoc

type StateDoc struct {
	Node      Node         `json:"node"`
	Status    model.Status `json:"status"`
	Timestamp string       `json:"timestamp"`
}

type States

type States struct {
	Timestamp string      `json:"timestamp"`
	State     []NodeState `json:"state"`
}

func (*States) GetNodeIDs

func (s *States) GetNodeIDs() []string

func (*States) GetNodeMap

func (s *States) GetNodeMap() map[string]NodeState

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL