From 0111ba706dc261e6cd1131a1d7934c440accf15f Mon Sep 17 00:00:00 2001 From: Saxon Date: Mon, 14 Oct 2019 16:05:38 +1030 Subject: [PATCH] input/gvctrl: using login or Login rather than logIn or LogIn --- input/gvctrl/gvctrl.go | 6 +++--- input/gvctrl/request.go | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/input/gvctrl/gvctrl.go b/input/gvctrl/gvctrl.go index b27c805d..51fbfae1 100644 --- a/input/gvctrl/gvctrl.go +++ b/input/gvctrl/gvctrl.go @@ -81,15 +81,15 @@ func Set(host string, options ...Option) error { } // Get the request body required for log in. - body, err := genLogIn(client, id, host) + body, err := getLogin(client, id, host) if err != nil { return fmt.Errorf("could not generate log in request data: %v", err) } // Log in using generated log in request body. - err = logIn(client, id, host, body) + err = login(client, id, host, body) if err != nil { - return fmt.Errorf("could not logIn: %v", err) + return fmt.Errorf("could not login: %v", err) } // Apply the options to the settings specified by the user. diff --git a/input/gvctrl/request.go b/input/gvctrl/request.go index d4b6f530..662cff32 100644 --- a/input/gvctrl/request.go +++ b/input/gvctrl/request.go @@ -48,10 +48,10 @@ const ( pass = "admin" ) -// genLogIn gets the log in page and extracts the randomly generated cc values +// getLogin gets the log in page and extracts the randomly generated cc values // from which (as well as username and password) two hashes are generated. // The generated hex is encoded into a url encoded form and returned as a string. -func genLogIn(c *http.Client, id, host string) (string, error) { +func getLogin(c *http.Client, id, host string) (string, error) { req, err := http.NewRequest("GET", "https://"+host+loginSubDir, nil) if err != nil { return "", fmt.Errorf("can't create GET request for log in page: %v", err) @@ -100,8 +100,8 @@ func genLogIn(c *http.Client, id, host string) (string, error) { return f.Encode(), nil } -// logIn will submit the form b generated by genLogIn. -func logIn(c *http.Client, id, host, b string) error { +// login will submit the form b generated by genLogin. +func login(c *http.Client, id, host, b string) error { req, err := http.NewRequest("POST", "http://"+host+loggedInSubDir, bytes.NewBuffer([]byte(b))) if err != nil { return fmt.Errorf("could not create log in request: %v", err)