data

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckService

func CheckService(details *ServiceCheck)

Types

type ConsoleData

type ConsoleData struct {
	Sites    []Site        `json:"sites"`
	Services []interface{} `json:"services"`
}

func (*ConsoleData) Merge

func (c *ConsoleData) Merge(data []SiteQueryData)

type DetailsMap

type DetailsMap map[string]int

type EgressBinding

type EgressBinding struct {
	Ports map[int]int `json:"ports"`
	Host  string      `json:"host"`
}

type EgressPortMap

type EgressPortMap map[string]map[int]int

type HttpRequestStats

type HttpRequestStats struct {
	Requests       int                 `json:"requests"`
	BytesIn        int                 `json:"bytes_in"`
	BytesOut       int                 `json:"bytes_out"`
	Details        DetailsMap          `json:"details"`
	LatencyMax     int                 `json:"latency_max"`
	ByHandlingSite HttpRequestStatsMap `json:"by_handling_site,omitempty"`
}

type HttpRequestStatsMap

type HttpRequestStatsMap map[string]HttpRequestStats

type HttpRequestsHandled

type HttpRequestsHandled struct {
	SiteId            string              `json:"site_id"`
	ByServer          HttpRequestStatsMap `json:"by_server,omitempty"`
	ByOriginatingSite HttpRequestStatsMap `json:"by_originating_site,omitempty"`
}

type HttpRequestsHandledList

type HttpRequestsHandledList []HttpRequestsHandled

type HttpRequestsReceived

type HttpRequestsReceived struct {
	SiteId   string              `json:"site_id"`
	ByClient HttpRequestStatsMap `json:"by_client,omitempty"`
}

type HttpRequestsReceivedList

type HttpRequestsReceivedList []HttpRequestsReceived

type HttpService

type HttpService struct {
	Service
	RequestsReceived HttpRequestsReceivedList `json:"requests_received"`
	RequestsHandled  HttpRequestsHandledList  `json:"requests_handled"`
}

func GetHttpServices

func GetHttpServices(siteId string, info [][]qdr.HttpRequestInfo, targets []qdr.HttpEndpoint, listeners []qdr.HttpEndpoint, lookup NameMapping) []HttpService

type HttpServiceMap

type HttpServiceMap map[string]HttpService

func (HttpServiceMap) AddServices

func (index HttpServiceMap) AddServices(listeners []qdr.HttpEndpoint)

func (HttpServiceMap) AddTargets

func (index HttpServiceMap) AddTargets(connectors []qdr.HttpEndpoint, mapping NameMapping)

func (HttpServiceMap) AsList

func (index HttpServiceMap) AsList() []HttpService

func (HttpServiceMap) Update

func (index HttpServiceMap) Update(siteId string, requests []qdr.HttpRequestInfo, mapping NameMapping)

type IngressBinding

type IngressBinding struct {
	ListenerPorts   map[int]int       `json:"listener_ports"`
	ServicePorts    map[int]int       `json:"service_ports"`
	ServiceSelector map[string]string `json:"service_selector"`
}

type LegacySiteInfo

type LegacySiteInfo struct {
	SiteId    string
	SiteName  string
	Version   string
	Namespace string
	Url       string
}

Used for interacting with 0.4.x sites

type NameMapping

type NameMapping interface {
	Lookup(name string) string
}

func NewNullNameMapping

func NewNullNameMapping() NameMapping

type NullNameMapping

type NullNameMapping struct {
}

func (*NullNameMapping) Lookup

func (n *NullNameMapping) Lookup(name string) string

type Service

type Service struct {
	Address  string          `json:"address"`
	Protocol string          `json:"protocol"`
	Targets  []ServiceTarget `json:"targets"`
}

func (*Service) AddTarget

func (s *Service) AddTarget(name string, host string, siteId string, mapping NameMapping)

func (*Service) AddressUnqualified

func (s *Service) AddressUnqualified() string

type ServiceCheck

type ServiceCheck struct {
	Details      []ServiceDetail `json:"site_details"`
	Observations []string        `json:"observations,omitempty"`
}

func (*ServiceCheck) AddObservation

func (sc *ServiceCheck) AddObservation(message string)

func (*ServiceCheck) HasDetailObservations

func (sc *ServiceCheck) HasDetailObservations() bool

type ServiceDetail

type ServiceDetail struct {
	SiteId         string                 `json:"site_id"`
	Definition     types.ServiceInterface `json:"definition"`
	IngressBinding IngressBinding         `json:"ingress_binding"`
	EgressBindings []EgressBinding        `json:"egress_bindings"`
	Observations   []string               `json:"observations,omitempty"`
}

func (*ServiceDetail) AddObservation

func (sd *ServiceDetail) AddObservation(message string)

func (*ServiceDetail) ExtractHttpConnectorPorts

func (detail *ServiceDetail) ExtractHttpConnectorPorts(connectors []qdr.HttpEndpoint)

func (*ServiceDetail) ExtractHttpListenerPorts

func (detail *ServiceDetail) ExtractHttpListenerPorts(listeners []qdr.HttpEndpoint)

func (*ServiceDetail) ExtractTcpConnectorPorts

func (detail *ServiceDetail) ExtractTcpConnectorPorts(connectors []qdr.TcpEndpoint)

func (*ServiceDetail) ExtractTcpListenerPorts

func (detail *ServiceDetail) ExtractTcpListenerPorts(listeners []qdr.TcpEndpoint)

type ServiceTarget

type ServiceTarget struct {
	Name   string `json:"name"`
	Target string `json:"target"`
	SiteId string `json:"site_id"`
}

type Site

type Site struct {
	SiteName  string   `json:"site_name"`
	SiteId    string   `json:"site_id"`
	Version   string   `json:"version"`
	Connected []string `json:"connected"`
	Namespace string   `json:"namespace"`
	Url       string   `json:"url"`
	Edge      bool     `json:"edge"`
	Gateway   bool     `json:"gateway"`
}

func (*Site) AsLegacySiteInfo

func (s *Site) AsLegacySiteInfo() *LegacySiteInfo

func (*Site) IsConnectedTo

func (s *Site) IsConnectedTo(siteId string) bool

type SiteQueryData

type SiteQueryData struct {
	Site
	TcpServices  []TcpService  `json:"tcp_services"`
	HttpServices []HttpService `json:"http_services"`
}

type TcpConnectionStats

type TcpConnectionStats struct {
	Id        string `json:"id"`
	StartTime uint64 `json:"start_time"`
	LastOut   uint64 `json:"last_out"`
	LastIn    uint64 `json:"last_in"`
	BytesIn   int    `json:"bytes_in"`
	BytesOut  int    `json:"bytes_out"`
	Client    string `json:"client,omitempty"`
	Server    string `json:"server,omitempty"`
}

type TcpService

type TcpService struct {
	Service
	ConnectionsIngress TcpServiceEndpointsList `json:"connections_ingress,omitempty"`
	ConnectionsEgress  TcpServiceEndpointsList `json:"connections_egress,omitempty"`
}

func GetTcpServices

func GetTcpServices(siteId string, info [][]qdr.TcpConnection, targets []qdr.TcpEndpoint, lookup NameMapping) []TcpService

type TcpServiceEndpoints

type TcpServiceEndpoints struct {
	SiteId      string                        `json:"site_id"`
	Connections map[string]TcpConnectionStats `json:"connections"`
}

type TcpServiceEndpointsList

type TcpServiceEndpointsList []TcpServiceEndpoints

type TcpServiceMap

type TcpServiceMap map[string]TcpService

func (TcpServiceMap) AddTargets

func (s TcpServiceMap) AddTargets(connectors []qdr.TcpEndpoint, mapping NameMapping)

func (TcpServiceMap) AsList

func (s TcpServiceMap) AsList() []TcpService

func (TcpServiceMap) Update

func (index TcpServiceMap) Update(siteId string, connections []qdr.TcpConnection, mapping NameMapping)

Jump to

Keyboard shortcuts

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