Skip to content

Commit 0057f39

Browse files
authored
Change repo name (g8rswimmer#26)
* Updated with new paths * updated the readme
1 parent 27609da commit 0057f39

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+160
-160
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# goforce
1+
# go-sfdc
22
This is a `golang` library for interfacing with `Salesforce` APIs.
33

44
## Usage
@@ -19,7 +19,7 @@ The configuration defines several parameters that can be used by the library. T
1919
* `Version` - is the `Salesforce` version. Please refer to [`Salesforce` documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_what_is_rest_api.htm) to make sure that `APIs` are supported in the version that is specified.
2020
### Example
2121
```go
22-
config := goforce.Configuration{
22+
config := sfdc.Configuration{
2323
Credentials: credentials.NewPasswordCredentials(creds),
2424
Client: salesforceHTTPClient,
2525
Version: 44,

composite/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The `sobject` package is an implementation of `Salesforce APIs` centered on `Com
1010
As a reference, see `Salesforce API` [documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_what_is_rest_api.htm)
1111

1212
## Examples
13-
The following are examples to access the `APIs`. It is assumed that a `goforce` [session](../session/README.md) has been created.
13+
The following are examples to access the `APIs`. It is assumed that a `sfdc` [session](../session/README.md) has been created.
1414
### Subrequest
1515
```go
1616
type compositeSubRequest struct {

composite/batch/batch.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"fmt"
88
"net/http"
99

10-
"github.com/g8rswimmer/goforce"
11-
"github.com/g8rswimmer/goforce/session"
10+
"github.com/g8rswimmer/go-sfdc"
11+
"github.com/g8rswimmer/go-sfdc/session"
1212
)
1313

1414
// Subrequester provides the composite batch API requests.
@@ -97,7 +97,7 @@ func (r *Resource) Retrieve(haltOnError bool, requesters []Subrequester) (Value,
9797
defer response.Body.Close()
9898

9999
if response.StatusCode != http.StatusOK {
100-
var insertErrs []goforce.Error
100+
var insertErrs []sfdc.Error
101101
err = decoder.Decode(&insertErrs)
102102
var errMsg error
103103
if err == nil {

composite/batch/batch_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"strings"
99
"testing"
1010

11-
"github.com/g8rswimmer/goforce/session"
11+
"github.com/g8rswimmer/go-sfdc/session"
1212
)
1313

1414
type mockSubrequester struct {

composite/composite.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"fmt"
88
"net/http"
99

10-
"github.com/g8rswimmer/goforce"
11-
"github.com/g8rswimmer/goforce/session"
10+
"github.com/g8rswimmer/go-sfdc"
11+
"github.com/g8rswimmer/go-sfdc/session"
1212
)
1313

1414
// Subrequester provides the composite API requests. The
@@ -104,7 +104,7 @@ func (r *Resource) Retrieve(allOrNone bool, requesters []Subrequester) (Value, e
104104
defer response.Body.Close()
105105

106106
if response.StatusCode != http.StatusOK {
107-
var insertErrs []goforce.Error
107+
var insertErrs []sfdc.Error
108108
err = decoder.Decode(&insertErrs)
109109
var errMsg error
110110
if err == nil {

composite/composite_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"strings"
88
"testing"
99

10-
"github.com/g8rswimmer/goforce/session"
10+
"github.com/g8rswimmer/go-sfdc/session"
1111
)
1212

1313
type mockSubrequester struct {

config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package goforce
1+
package sfdc
22

33
import (
44
"net/http"
55

6-
"github.com/g8rswimmer/goforce/credentials"
6+
"github.com/g8rswimmer/go-sfdc/credentials"
77
)
88

99
// Configuration is the structure for goforce sessions.

credentials/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Credentials
22
[back](../README.md)
33

4-
To access `Salesforce APIs`, there needs to be authentication between the client and the org. `goforce` uses [OAuth 2.0](https://help.salesforce.com/articleView?id=remoteaccess_oauth_web_server_flow.htm&type=5) and this package provides the credentials needed to authenticate.
4+
To access `Salesforce APIs`, there needs to be authentication between the client and the org. `go-sfdc` uses [OAuth 2.0](https://help.salesforce.com/articleView?id=remoteaccess_oauth_web_server_flow.htm&type=5) and this package provides the credentials needed to authenticate.
55

66
The user is able to use the `Providers` that are part of this package, or implement one of their own. This allows for extendability beyond what is currently supported.
77

@@ -18,7 +18,7 @@ creds := credentials.PasswordCredentails{
1818
ClientSecret: "12312573857105",
1919
}
2020

21-
config := goforce.Configuration{
21+
config := sfdc.Configuration{
2222
Credentials: credentials.NewPasswordCredentials(creds),
2323
Client: salesforceHTTPClient,
2424
Version: 44,

error.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package goforce
1+
package sfdc
22

33
import (
44
"encoding/json"

error_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package goforce
1+
package sfdc
22

33
import "testing"
44

record.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package goforce
1+
package sfdc
22

33
import (
44
"encoding/json"

record_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package goforce
1+
package sfdc
22

33
import (
44
"reflect"

session/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ creds := credentials.PasswordCredentails{
1414
ClientSecret: "12312573857105",
1515
}
1616

17-
config := goforce.Configuration{
17+
config := sfdc.Configuration{
1818
Credentials: credentials.NewPasswordCredentials(creds),
1919
Client: http.DefaultClient,
2020
Version: 44,

session/session.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import (
77
"fmt"
88
"net/http"
99

10-
"github.com/g8rswimmer/goforce"
11-
"github.com/g8rswimmer/goforce/credentials"
10+
"github.com/g8rswimmer/go-sfdc"
11+
"github.com/g8rswimmer/go-sfdc/credentials"
1212
)
1313

1414
// Session is the authentication response. This is used to generate the
1515
// authroization header for the Salesforce API calls.
1616
type Session struct {
1717
response *sessionPasswordResponse
18-
config goforce.Configuration
18+
config sfdc.Configuration
1919
}
2020

2121
// Clienter interface provides the HTTP client used by the
@@ -61,7 +61,7 @@ const oauthEndpoint = "/services/oauth2/token"
6161

6262
// Open is used to authenticate with Salesforce and open a session. The user will need to
6363
// supply the proper credentails and a HTTP client.
64-
func Open(config goforce.Configuration) (*Session, error) {
64+
func Open(config sfdc.Configuration) (*Session, error) {
6565
if config.Credentials == nil {
6666
return nil, errors.New("session: configuration crendentials can not be nil")
6767
}

session/session_test.go

+14-14
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"strings"
1010
"testing"
1111

12-
"github.com/g8rswimmer/goforce"
13-
"github.com/g8rswimmer/goforce/credentials"
12+
"github.com/g8rswimmer/go-sfdc"
13+
"github.com/g8rswimmer/go-sfdc/credentials"
1414
)
1515

1616
func TestPasswordSessionRequest(t *testing.T) {
@@ -230,13 +230,13 @@ func testNewPasswordCredentials(cred credentials.PasswordCredentails) *credentia
230230
func TestNewPasswordSession(t *testing.T) {
231231
scenarios := []struct {
232232
desc string
233-
config goforce.Configuration
233+
config sfdc.Configuration
234234
session *Session
235235
err error
236236
}{
237237
{
238238
desc: "Passing",
239-
config: goforce.Configuration{
239+
config: sfdc.Configuration{
240240
Credentials: testNewPasswordCredentials(credentials.PasswordCredentails{
241241
URL: "http://test.password.session",
242242
Username: "myusername",
@@ -278,7 +278,7 @@ func TestNewPasswordSession(t *testing.T) {
278278

279279
{
280280
desc: "Error Request",
281-
config: goforce.Configuration{
281+
config: sfdc.Configuration{
282282
Credentials: testNewPasswordCredentials(credentials.PasswordCredentails{
283283
URL: "123://test.password.session",
284284
Username: "myusername",
@@ -299,7 +299,7 @@ func TestNewPasswordSession(t *testing.T) {
299299
},
300300
{
301301
desc: "Error Response",
302-
config: goforce.Configuration{
302+
config: sfdc.Configuration{
303303
Credentials: testNewPasswordCredentials(credentials.PasswordCredentails{
304304
URL: "http://test.password.session",
305305
Username: "myusername",
@@ -370,7 +370,7 @@ func TestNewPasswordSession(t *testing.T) {
370370
func TestSession_ServiceURL(t *testing.T) {
371371
type fields struct {
372372
response *sessionPasswordResponse
373-
config goforce.Configuration
373+
config sfdc.Configuration
374374
}
375375
tests := []struct {
376376
name string
@@ -383,7 +383,7 @@ func TestSession_ServiceURL(t *testing.T) {
383383
response: &sessionPasswordResponse{
384384
InstanceURL: "https://www.my.salesforce.instance",
385385
},
386-
config: goforce.Configuration{
386+
config: sfdc.Configuration{
387387
Version: 43,
388388
},
389389
},
@@ -406,7 +406,7 @@ func TestSession_ServiceURL(t *testing.T) {
406406
func TestSession_AuthorizationHeader(t *testing.T) {
407407
type fields struct {
408408
response *sessionPasswordResponse
409-
config goforce.Configuration
409+
config sfdc.Configuration
410410
}
411411
type args struct {
412412
request *http.Request
@@ -424,7 +424,7 @@ func TestSession_AuthorizationHeader(t *testing.T) {
424424
TokenType: "Type",
425425
AccessToken: "Access",
426426
},
427-
config: goforce.Configuration{},
427+
config: sfdc.Configuration{},
428428
},
429429
args: args{
430430
request: &http.Request{
@@ -453,7 +453,7 @@ func TestSession_AuthorizationHeader(t *testing.T) {
453453
func TestSession_Client(t *testing.T) {
454454
type fields struct {
455455
response *sessionPasswordResponse
456-
config goforce.Configuration
456+
config sfdc.Configuration
457457
}
458458
tests := []struct {
459459
name string
@@ -464,7 +464,7 @@ func TestSession_Client(t *testing.T) {
464464
name: "Session Client",
465465
fields: fields{
466466
response: &sessionPasswordResponse{},
467-
config: goforce.Configuration{
467+
config: sfdc.Configuration{
468468
Client: http.DefaultClient,
469469
},
470470
},
@@ -487,7 +487,7 @@ func TestSession_Client(t *testing.T) {
487487
func TestSession_InstanceURL(t *testing.T) {
488488
type fields struct {
489489
response *sessionPasswordResponse
490-
config goforce.Configuration
490+
config sfdc.Configuration
491491
}
492492
tests := []struct {
493493
name string
@@ -500,7 +500,7 @@ func TestSession_InstanceURL(t *testing.T) {
500500
response: &sessionPasswordResponse{
501501
InstanceURL: "https://www.my.salesforce.instance",
502502
},
503-
config: goforce.Configuration{
503+
config: sfdc.Configuration{
504504
Version: 43,
505505
},
506506
},

sobject/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The `sobject` package is an implementation of `Salesforce APIs` centered on `SOb
2020
As a reference, see `Salesforce API` [documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_what_is_rest_api.htm)
2121

2222
## Examples
23-
The following are examples to access the `APIs`. It is assumed that a `goforce` [session](../session/README.md) has been created.
23+
The following are examples to access the `APIs`. It is assumed that a `go-sfdc` [session](../session/README.md) has been created.
2424
### Metadata
2525
```go
2626
sobjResources := sobject.NewResources(session)

sobject/collections/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The `collection` package is an implementation of `Salesforce APIs` centered on `
1010
As a reference, see `Salesforce API` [documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_sobjects_collections.htm)
1111

1212
## Examples
13-
The following are examples to access the `APIs`. It is assumed that a `goforce` [session](../../session/README.md) has been created.
13+
The following are examples to access the `APIs`. It is assumed that a `go-sfdc` [session](../../session/README.md) has been created.
1414

1515
```go
1616
type dml struct {

sobject/collections/collections.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import (
1111
"net/url"
1212
"regexp"
1313

14-
"github.com/g8rswimmer/goforce"
15-
"github.com/g8rswimmer/goforce/session"
16-
"github.com/g8rswimmer/goforce/sobject"
14+
"github.com/g8rswimmer/go-sfdc"
15+
"github.com/g8rswimmer/go-sfdc/session"
16+
"github.com/g8rswimmer/go-sfdc/sobject"
1717
)
1818

1919
const (
@@ -103,7 +103,7 @@ func (r *Resource) Update(allOrNone bool, records []sobject.Updater) ([]UpdateVa
103103

104104
// Query will retrieve a group of records from the Salesforce org. The records to retrieve must
105105
// be the same SObject.
106-
func (r *Resource) Query(sobject string, records []sobject.Querier) ([]*goforce.Record, error) {
106+
func (r *Resource) Query(sobject string, records []sobject.Querier) ([]*sfdc.Record, error) {
107107
if r.query == nil {
108108
return nil, errors.New("collections resource: collections may not have been initialized properly")
109109
}
@@ -148,7 +148,7 @@ func (c *collection) send(session session.ServiceFormatter, value interface{}) e
148148
defer response.Body.Close()
149149

150150
if response.StatusCode != http.StatusOK {
151-
var insertErrs []goforce.Error
151+
var insertErrs []sfdc.Error
152152
err = decoder.Decode(&insertErrs)
153153
var errMsg error
154154
if err == nil {

0 commit comments

Comments
 (0)