routestatus

package
v0.6.3-beta01 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	ConnectionID int      `json:"connection_id,omitempty"`
	GroupID      int      `json:"connection_group_id,omitempty"`
	RouteStatus  []*Entry `json:"statuses"`
}

func NewConnection

func NewConnection(conID, grID int, entries ...*Entry) *Connection

type Entry

type Entry struct {
	Status  string `json:"status"`
	IP      string `json:"ip"`
	Message string `json:"msg,omitempty"`
}

func NewEntry

func NewEntry(ip netip.Prefix, err error) *Entry

type Message

type Message struct {
	common.MessageHeader
	Data []*Connection `json:"data"`
}

func New

func New() *Message

func (*Message) Add

func (msg *Message) Add(connections ...*Connection)

Adds new connections to array. Performs smart merge, if connections have same IDs

func (*Message) Send

func (msg *Message) Send(w io.Writer) error

Send message to controller (writer)

Jump to

Keyboard shortcuts

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