May the Force be with you

v0.0.8 v0.0.8
Vernon Keenan 2021-01-10 15:14:20 -08:00
parent c27f9e18f6
commit 98a20673a2
4 changed files with 34 additions and 1 deletions

View File

@ -3,4 +3,7 @@
Taxnexus Shared Types and Libraries
(c) 2018 - 2021 by Taxneuxs, Inc. All Rights Reserved
Proprietary license required. Please contact us at info@taxnexus.net
Proprietary license required.
Please contact us at info@taxnexus.net

26
app/force.go Normal file
View File

@ -0,0 +1,26 @@
package app
import (
"github.com/taxnexus/go-force/force"
)
// InitForce creates a salesforce connection using serviceAccountName
func InitForce(serviceAccountName string) *force.API {
sugar.Info("app.initForce: 📥 %s", serviceAccountName)
acct := GetServiceAccount(serviceAccountName)
theForce, err := force.Create(
"v45.0",
acct.ClientID,
acct.ClientSecret,
acct.Username,
acct.Password,
acct.SecurityToken,
"production",
)
if err != nil {
sugar.Errorf("app.InitForce: salesforce error: %s", err.Error())
return nil
}
sugar.Info("app.InitForce: 👍 📤")
return theForce
}

1
go.mod
View File

@ -12,5 +12,6 @@ require (
github.com/prometheus/client_golang v0.9.3
github.com/rs/cors v1.7.0
github.com/spf13/viper v1.7.1
github.com/taxnexus/go-force v1.0.7
go.uber.org/zap v1.16.0
)

3
go.sum
View File

@ -354,6 +354,8 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/taxnexus/go-force v1.0.7 h1:AhfmLToq3XIq5SkaC621uPu9kGjyTxwDi2k5XxuWws0=
github.com/taxnexus/go-force v1.0.7/go.mod h1:lJDnynWzSMNjYWpPzAMX4gGy+nwDxBFgdHd4z0U1BG0=
github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
@ -432,6 +434,7 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/LtIxf46G4fxeEz5KJr9U=