go-salesforce-sdk

command
v0.0.1-alpha.0...-700cb3a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 20 Imported by: 0

README

go-salesforce-sdk CLI

This command line tool is used to executing the ls and generate commands with the go-salesforce-sdk.

ls will list available Salesforce objects in your organization that can be generated.

generate will generate a golang package containing one or more type definitions for your object.

Usage

git clone https://github.com/beeekind/go-salesforce-sdk
go install go-salesforce-sdk/cmd/go-salesforce-sdk

go-salesforce-sdk ls

go-salesforce-sdk generate Lead ./ leads 0 
go-salesforce-sdk generate Account ./ accounts 0 
go-salesforce-sdk generate Contact ./ contacts 1

Arguments passed to the generate command

args[0] the name of the installed program which defaults to the directory found in go-salesforce-sdk/cmd args[1] the initial command {ls|generate} args[2] the object name case-sensitive args[3] the output directory args[4] the output package name args[5] the recursionLevel - indicating how many levels of relations we should generate types for (useful when doing subqueries on generated types)

Documentation

Overview

Package chromedp renders javascript web pages for the Salesforce documentation website using the chromedp/chromedp and PuerkitoBio/goquery libraries.

Data scraped from the documentation pages is used to provide comments and docstrings for code generated in other packages.

Example documentation pages: * https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_lead.htm * https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_fielddefinition.htm

Performance could be improved further by querying only parts of the page we care about such as https://developer.salesforce.com/docs/get_document_content/object_reference/sforce_api_objects_account.htm/en-us/230.0 however I prefer the more publicly available root documentation page even if it is more resource intensive.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL