query

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package query implements querying through the Salesforce data service. It is a non-trivial problem because:

- The API response shape is weird - Subqueries can themselves be paginated.

The first is generally manageable and nothing so out of the ordinary. The second however is a big problem from an API/interface perspective. It doesn't make sense to paginate subqueries to a caller, because they probably don't have the context to use the subquery. It's also just incredibly difficult to program the caller-based pagination of subqueries.

So we choose to hide the subquery pagination as an implementation detail. Again, not ideal, but probably the best choice.

We do, however, still support top-level query pagination.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(o *Options)

func Query

func Query(cb PageCallback, options ...Option) error

func Tooling

func Tooling(o *Options)

Types

type HttpGetter

type HttpGetter func(string) ([]byte, error)

type Option

type Option func(*Options)

func ApiVersion

func ApiVersion(v string) Option

func HttpGet

func HttpGet(f HttpGetter) Option

func InstanceUrl

func InstanceUrl(url string) Option

func QS

func QS(v string) Option

func Tail

func Tail(tail string) Option

type Options

type Options struct {
	// contains filtered or unexported fields
}

func (Options) UrlTail

func (o Options) UrlTail() string

type PageCallback

type PageCallback func([]Record) bool

type Record

type Record struct {
	Attributes struct {
		Type string
		Url  string
	}
	Fields map[string]interface{}
	Raw    map[string]interface{}
}

func Eager

func Eager(options ...Option) ([]Record, error)

Jump to

Keyboard shortcuts

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