# README
Session
The session is used to authenticate with Salesforce
and retrieve the org's information. The session will be used by the API packages to properly access the Salesforce org
. The credentials will need to be will be used to properly create the session.
Example
The following example demonstrates how to create a session.
pwdCreds, err := credentials.NewPasswordCredentials(credentials.PasswordCredentials{
URL: "https://login.salesforce.com",
Username: "[email protected]",
Password: "greatpassword",
ClientID: "asdfnapodfnavppe",
ClientSecret: "12312573857105",
})
if err != nil {
fmt.Printf("error %v\n", err)
return
}
config := sfdc.Configuration{
Credentials: pwdCreds,
Client: http.DefaultClient,
Version: 44,
}
session, err := session.Open(config)
if err != nil {
fmt.Printf("Error %v\n", err)
return
}
// access Salesforce APIs
# Functions
Open is used to authenticate with Salesforce and open a session.
# Interfaces
Clienter interface provides the HTTP client used by the the resources.
InstanceFormatter is the session interface that formaters the session instance information used by the resources.
ServiceFormatter is the session interface that formats the session for service resources.