Skip to content

Commit

Permalink
all snake case (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelquigley committed Sep 17, 2024
1 parent 7244bda commit edf40ca
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion agent/access.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,16 @@ func (a *access) tail(data []byte) {
if !a.booted {
in := make(map[string]interface{})
if err := json.Unmarshal([]byte(line), &in); err == nil {
if v, found := in["frontend-token"]; found {
if v, found := in["frontend_token"]; found {
if str, ok := v.(string); ok {
a.frontendToken = str
}
}
if v, found := in["bind_address"]; found {
if str, ok := v.(string); ok {
a.bindAddress = str
}
}
a.booted = true
} else {
a.bootErr = errors.New(line)
Expand Down
4 changes: 2 additions & 2 deletions cmd/zrok/accessPrivate.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ func (cmd *accessPrivateCommand) run(_ *cobra.Command, args []string) {

if cmd.agent {
data := make(map[string]interface{})
data["frontend-token"] = accessResp.Payload.FrontendToken
data["bind-address"] = cmd.bindAddress
data["frontend_token"] = accessResp.Payload.FrontendToken
data["bind_address"] = cmd.bindAddress
jsonData, err := json.Marshal(data)
if err != nil {
panic(err)
Expand Down
2 changes: 1 addition & 1 deletion cmd/zrok/sharePrivate.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ func (cmd *sharePrivateCommand) run(_ *cobra.Command, args []string) {
select {
case req := <-requests:
data := make(map[string]interface{})
data["remote-address"] = req.RemoteAddr
data["remote_address"] = req.RemoteAddr
data["method"] = req.Method
data["path"] = req.Path
jsonData, err := json.Marshal(data)
Expand Down
2 changes: 1 addition & 1 deletion cmd/zrok/sharePublic.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func (cmd *sharePublicCommand) run(_ *cobra.Command, args []string) {
select {
case req := <-requests:
data := make(map[string]interface{})
data["remote-address"] = req.RemoteAddr
data["remote_address"] = req.RemoteAddr
data["method"] = req.Method
data["path"] = req.Path
jsonData, err := json.Marshal(data)
Expand Down

0 comments on commit edf40ca

Please sign in to comment.