Skip to content

Commit

Permalink
lowercase JSON response for agentInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
skandragon committed Aug 11, 2022
1 parent 9ce329f commit 6857115
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion examples/local-deploy/config/agent/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ outgoingServices:
type: whoami
enabled: true
config:
url: http://localhost:8300
url: https://whoami.rpi.flame.org
- name: whoami-loop
type: whoami
enabled: true
Expand Down
18 changes: 4 additions & 14 deletions internal/tunnelroute/directconnect.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,18 @@ func (s *DirectlyConnectedRoute) Close() {
close(s.InCancelRequest)
}

//
// Send sends a message to a specific Route
//
func (s *DirectlyConnectedRoute) Send(message interface{}) string {
s.InRequest <- message
return s.Session
}

//
// Cancel cancels a specific stream
//
func (s *DirectlyConnectedRoute) Cancel(id string) {
s.InCancelRequest <- id
}

//
// HasEndpoint returns true if the endpoint is presend and configured.
//
func (s *DirectlyConnectedRoute) HasEndpoint(endpointType string, endpointName string) bool {
for _, ep := range s.Endpoints {
if ep.Type == endpointType && ep.Name == endpointName {
Expand All @@ -92,20 +86,16 @@ func (s *DirectlyConnectedRoute) HasEndpoint(endpointType string, endpointName s
return false
}

//
// DirectlyConnectedRouteStatistics describes statistics for a directly connected route.
//
type DirectlyConnectedRouteStatistics struct {
BaseStatistics
ConnectedAt uint64 `json:"connectedAt"`
LastPing uint64 `json:"lastPing"`
LastUse uint64 `json:"lastUse"`
AgentInfo tunnel.AgentInfo
ConnectedAt uint64 `json:"connectedAt,omitempty"`
LastPing uint64 `json:"lastPing,omitempty"`
LastUse uint64 `json:"lastUse,omitempty"`
AgentInfo tunnel.AgentInfo `json:"agentInfo,omitempty"`
}

//
// GetStatistics returns a set of stats for connected routes.
//
func (s *DirectlyConnectedRoute) GetStatistics() interface{} {
ret := &DirectlyConnectedRouteStatistics{
ConnectedAt: s.ConnectedAt,
Expand Down

0 comments on commit 6857115

Please sign in to comment.