go-sfdc: github.com/g8rswimmer/go-sfdc Index | Files | Directories

package sfdc

import "github.com/g8rswimmer/go-sfdc"


Package Files

config.go error.go record.go time.go


const (
    // RecordAttributes is the attribute map from the record JSON
    RecordAttributes = "attributes"
const SalesforceDate = "2006-01-02"

SalesforceDate is the format returned by the Salesforce Date field type.

const SalesforceDateTime = "2006-01-02T15:04:05.000+0000"

SalesforceDateTime is the format returned by Salesforce TimeDate field type.

func ParseTime Uses

func ParseTime(salesforceTime string) (time.Time, error)

ParseTime attempts to parse a JSON time string from Salesforce. It will attempt to parse the time using RFC 3339, then Salesforce DateTime format and lastly Salesforce Date format.

type Configuration Uses

type Configuration struct {
    Credentials *credentials.Credentials
    Client      *http.Client
    Version     int

Configuration is the structure for goforce sessions.

Credentials is the credentials that will be used to form a session.

Client is the HTTP client that will be used.

Version is the Salesforce version for the APIs.

type Error Uses

type Error struct {
    ErrorCode string   `json:"errorCode"`
    Message   string   `json:"message"`
    Fields    []string `json:"fields"`

Error is the error structure defined by the Salesforce API.

func (*Error) UnmarshalJSON Uses

func (e *Error) UnmarshalJSON(data []byte) error

UnmarshalJSON will unmarshal a JSON byte array.

type Record Uses

type Record struct {
    // contains filtered or unexported fields

Record is a representation of a Salesforce record.

func RecordFromJSONMap Uses

func RecordFromJSONMap(jsonMap map[string]interface{}) (*Record, error)

RecordFromJSONMap creates a recrod from a JSON map.

func (*Record) FieldValue Uses

func (r *Record) FieldValue(field string) (interface{}, bool)

FieldValue returns the field's value. If there is no field for the field name, then false will be returned.

func (*Record) Fields Uses

func (r *Record) Fields() map[string]interface{}

Fields returns the map of field name to value relationships.

func (*Record) LookUp Uses

func (r *Record) LookUp(lookUp string) (*Record, bool)

LookUp returns the look up record

func (*Record) LookUps Uses

func (r *Record) LookUps() []*Record

LookUps returns all of the record's look ups

func (*Record) SObject Uses

func (r *Record) SObject() string

SObject returns attribute's Salesforce object name.

func (*Record) URL Uses

func (r *Record) URL() string

URL returns the record attribute's URL.

func (*Record) UnmarshalJSON Uses

func (r *Record) UnmarshalJSON(data []byte) error

UnmarshalJSON provides a custom unmarshaling of a JSON byte array.


sessionPackage session provides handles creation of a Salesforce session
sobject/collectionsPackage collections is the implementation of the SObject Collections API.

Package sfdc imports 5 packages (graph) and is imported by 8 packages. Updated 2019-10-16. Refresh now. Tools for package owners.