-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ING-959: Refactored hostname handling when parsing configs.
This commit also refactors how we deal with remote hostnames and addresses with the various clients and connections inside of the library. Primarily with the intent of simplifying the interfaces that we expose, and ensuring the correct details are available in the right places.
- Loading branch information
Brett Lawson
committed
Oct 29, 2024
1 parent
b80f485
commit 7d767c4
Showing
23 changed files
with
403 additions
and
326 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
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,16 @@ | ||
package cbconfig | ||
|
||
import ( | ||
"bytes" | ||
"encoding/json" | ||
) | ||
|
||
func ParseTerseConfig(config []byte, sourceHostname string) (*TerseConfigJson, error) { | ||
config = bytes.ReplaceAll(config, []byte("$HOST"), []byte(sourceHostname)) | ||
var configOut *TerseConfigJson | ||
err := json.Unmarshal(config, &configOut) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return configOut, nil | ||
} |
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
Oops, something went wrong.