-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #465 from uselagoon/fix-metrics
fix: move NATS message definitions into separate package
- Loading branch information
Showing
6 changed files
with
48 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Package bus contains the definitions of the messages passed across NATS. | ||
package bus | ||
|
||
import "log/slog" | ||
|
||
const ( | ||
// SubjectSSHAccessQuery defines the NATS subject for SSH access queries. | ||
SubjectSSHAccessQuery = "lagoon.sshportal.api" | ||
) | ||
|
||
// SSHAccessQuery defines the structure of an SSH access query. | ||
type SSHAccessQuery struct { | ||
SSHFingerprint string | ||
NamespaceName string | ||
ProjectID int | ||
EnvironmentID int | ||
SessionID string | ||
} | ||
|
||
// LogValue implements the slog.LogValuer interface. | ||
func (q SSHAccessQuery) LogValue() slog.Value { | ||
return slog.GroupValue( | ||
slog.String("sshFingerprint", q.SSHFingerprint), | ||
slog.String("namespaceName", q.NamespaceName), | ||
slog.Int("projectID", q.ProjectID), | ||
slog.Int("environmentID", q.EnvironmentID), | ||
slog.String("sessionID", q.SessionID), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters