Documentation ¶
Overview ¶
Package session provides handles creation of a Salesforce session
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InstanceFormatter ¶
type InstanceFormatter interface { InstanceURL() string AuthorizationHeader(*http.Request) Refresh() error Clienter }
InstanceFormatter is the session interface that formaters the session instance information used by the resources.
InstanceURL will return the Salesforce instance.
AuthorizationHeader will add the authorization to the HTTP request's header.
type ServiceFormatter ¶
type ServiceFormatter interface { InstanceFormatter // Version will return the Salesforce API version for this session. Version() int // ServiceURL will return the Salesforce instance for the service URL. ServiceURL() string }
ServiceFormatter is the session interface that formats the session for service resources.
ServiceURL provides the service URL for resources to user.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is the authentication response. This is used to generate the authorization header for the Salesforce API calls.
func Open ¶
Open is used to authenticate with Salesforce and open a session. The user will need to supply the proper credentials and a HTTP client.
func (*Session) AuthorizationHeader ¶
AuthorizationHeader will add the authorization to the HTTP request's header.
func (*Session) InstanceURL ¶
InstanceURL will return the Salesforce instance from the session authentication.
func (*Session) Refresh ¶ added in v3.1.0
Refresh check if session is expired and refresh it if needed.
func (*Session) ServiceURL ¶
ServiceURL will return the Salesforce instance for the service URL.