Code cleanup for remote client

This commit is contained in:
Dane Everitt
2021-02-01 21:43:04 -08:00
parent e3b0b91912
commit 065da77afa
9 changed files with 161 additions and 175 deletions

View File

@@ -137,11 +137,12 @@ func rootCmdRun(cmd *cobra.Command, _ []string) {
"gid": config.Get().System.User.Gid,
}).Info("configured system user successfully")
pclient := remote.CreateClient(
pclient := remote.New(
config.Get().PanelLocation,
config.Get().AuthenticationTokenId,
config.Get().AuthenticationToken,
remote.WithTimeout(time.Second*time.Duration(config.Get().RemoteQuery.Timeout)),
remote.WithCredentials(config.Get().AuthenticationTokenId, config.Get().AuthenticationToken),
remote.WithHttpClient(&http.Client{
Timeout: time.Second * time.Duration(config.Get().RemoteQuery.Timeout),
}),
)
manager, err := server.NewManager(cmd.Context(), pclient)