sftool

package
v0.0.0-...-2c52839 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildURL

func BuildURL(salesforceInstance string, resource int) string

buildURL builds any URL resource (API resource). No need of duplicate functions per each resource.

func CraftPayload

func CraftPayload(userValue, passwordValue, clientIDvalue, clientSecretvalue, securityKeyvalue string, purpose string) io.Reader

craftPayload prepares the payload used in the http requests.

func CraftRequest

func CraftRequest(m string, u string, t string, p io.Reader) *http.Request

craftRequest crafts a valid HTTP request with the passed http.Method, url(u), token(t) and payload(p).

func EnvHandler

func EnvHandler() (sfi, user, pass, clid, clse, seck string)

envHandler gets the needed environment variables: EMAIL, PASS, SF, CLID, CLSE, SECK.

func ExtractAuthToken

func ExtractAuthToken(r string) string

extractAuthToken extracts the access_token value from the response sent by the server

func PrettyPrintBacklog

func PrettyPrintBacklog(output map[int][]string)

func SendRequest

func SendRequest(r *http.Request) string

sendRequest executes the so far crafted Request.

func UnmarshalSF

func UnmarshalSF(cr string) map[int][]string

unmarshalSF unmarshals the listview response from Salesforce and returns a map.

Types

type Columns

type Columns struct {
	FieldNameOrPath string `json:"fieldNameOrPath"`
	Value           string `json:"value"`
}

type Records

type Records struct {
	Columns []Columns `json:"columns"`
}

Jump to

Keyboard shortcuts

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