Skip to content

Salesforce REST & SOQL client for Golang. Note: Mostly tailored to Stellar's specific needs, but should work for others.

License

Notifications You must be signed in to change notification settings

stellaraf/go-sfdc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stellar

go-sfdc

Tests Go Reference GitHub Tag

Installation

go get -u go.stellar.af/go-sfdc

Testing Environment Variables

The following environment variables must be set (and valid) for tests to run.

Key Description
SFDC_CLIENT_ID Connected App OAuth2 Client ID (Consumer Key)
SFDC_CLIENT_SECRET Connected App OAuth2 Client Secret (Consumer Secret)
SFDC_ENCRYPTION_PASSPHRASE AES-256 key for encrypting cache values
SFDC_AUTH_URL Salesforce Authentication URL
SFDC_TEST_DATA JSON string of test data, see below

Test Data

The following values are used in unit tests to fetch and validate data through the go-sfdc client methods.

Key Description
accountId ID of pre-existing Account object
userId ID of pre-existing User account
groupId ID of pre-existing group (Queue)
accountName Name of Account used in the accountId field
contactId ID of pre-existing contact that is associated with the Account used in the accountId field
accountCustomFieldKey Field name of a custom field on the Account object
caseCustomFieldKey Field name of a custom field on the Case object
userEmail Email address of the User used in the userId field
serviceContractId ID of pre-existing Service Contract object
leadId ID of pre-existing Lead object
picklistField API Name of pre-existing Picklist. Cannot be a managed Picklist.
picklistObject API Name of pre-existing object that contains the Picklist referenced in picklistField.

Example

{
    "accountId": "001A000001abcde123",
    "userId": "005A000001xyz7890",
    "groupId": "00G1A00000abcdef12",
    "accountName": "Acme Corp, Inc.",
    "contactId": "003A000001pqrst456",
    "accountCustomFieldKey": "go_sfdc_Test_Field__c",
    "caseCustomFieldKey": "go_sfdc_Test_Field__c",
    "userEmail": "person@example.com",
    "serviceContractId": "0SCA00000lmnop789"
}

About

Salesforce REST & SOQL client for Golang. Note: Mostly tailored to Stellar's specific needs, but should work for others.

Topics

Resources

License

Stars

Watchers

Forks

Languages