Skip to content

Commit

Permalink
move helper methods to top of file
Browse files Browse the repository at this point in the history
  • Loading branch information
k-capehart committed Mar 26, 2024
1 parent ac99fac commit ccf5032
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions salesforce/salesforce.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ type SObject struct {
Fields map[string]string
}

func Init(domain string, username string, password string, securityToken string, consumerKey string, consumerSecret string) *Salesforce {
auth := loginPassword(domain, username, password, securityToken, consumerKey, consumerSecret)
return &Salesforce{auth: auth}
}

func doRequest(method string, uri string, auth Auth, body []byte) (*http.Response, error) {
var reader *strings.Reader
var req *http.Request
Expand All @@ -62,6 +57,11 @@ func doRequest(method string, uri string, auth Auth, body []byte) (*http.Respons
return http.DefaultClient.Do(req)
}

func Init(domain string, username string, password string, securityToken string, consumerKey string, consumerSecret string) *Salesforce {
auth := loginPassword(domain, username, password, securityToken, consumerKey, consumerSecret)
return &Salesforce{auth: auth}
}

func (sf *Salesforce) QueryUnstructured(query string) *QueryResponse {
if sf.auth == nil {
fmt.Println("Not authenticated. Please use salesforce.Init().")
Expand Down

0 comments on commit ccf5032

Please sign in to comment.