integration

package
v1.35.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorNotFound     = errors.New("Integration not found")
	ErrorTooMany      = errors.New("Too many of this Integration found")
	ErrorIdTypeNotSet = errors.New("Integration ID and Type not set")
)

Functions

func Decode

func Decode(src *Integration, dst *Integration) error

func Encode

func Encode(src *Integration, dst *Integration) error

Types

type Affiliate

type Affiliate struct {
	SuccessUrl string `json:"successUrl,omitempty"`
	ErrorUrl   string `json:"errorUrl,omitempty"`
}

Affiliate configuration

type AnalyticsCustom

type AnalyticsCustom struct {
	AnalyticsIntegration

	Code string `json:"code,omitempty"`
}

type AnalyticsFacebookConversions

type AnalyticsFacebookConversions struct {
	AnalyticsIntegration

	Value    string `json:"value,omitempty"`
	Currency string `json:"currency,omitempty"`
}

type AnalyticsFacebookPixel

type AnalyticsFacebookPixel struct {
	AnalyticsIntegration

	Values Values `json:"values,omitempty"`
}

type AnalyticsGoogleAdwords

type AnalyticsGoogleAdwords struct {
	AnalyticsIntegration
}

type AnalyticsGoogleAnalytics

type AnalyticsGoogleAnalytics struct {
	AnalyticsIntegration
}

type AnalyticsHeap

type AnalyticsHeap struct {
	AnalyticsIntegration
}

type AnalyticsIntegration

type AnalyticsIntegration struct {
	// Common to all integrations
	Event string `json:"event,omitempty"`
	Id    string `json:"id,omitempty"`

	// Sampling percentage
	Sampling float64 `json:"sampling,omitempty"`
}

Generic fields

type AnalyticsSentry

type AnalyticsSentry struct {
	AnalyticsIntegration
}

type AuthorizeNet

type AuthorizeNet struct {
	// For convenience duplicated
	Sandbox AuthorizeNetConnection `json:"sandbox"`
	Live    AuthorizeNetConnection `json:"live"`
}

type AuthorizeNetConnection

type AuthorizeNetConnection struct {
	LoginId        string `json:"loginId,omitempty"`
	TransactionKey string `json:"transactionKey,omitempty"`
	Key            string `json:"key,omitempty"`
}

Authorize.net connection

type Bitcoin

type Bitcoin struct {
	Address     string `json:"address,omitempty"`
	TestAddress string `json:"testAddress,omitempty"`
}

Bitcoin

type EOSSecurityToken

type EOSSecurityToken struct {
	TokenAccount    string `json:"tokenAccount,omitempty"`
	RegistryAccount string `json:"registryAccount,omitempty"`
	PrivateKey      string `json:"-"`
}

type Ethereum

type Ethereum struct {
	Address     string `json:"address,omitempty"`
	TestAddress string `json:"testAddress,omitempty"`
}

Ethereum

type EthereumSecurityToken

type EthereumSecurityToken struct {
	TokenAddress    string `json:"tokenAddress,omitempty"`
	RegistryAddress string `json:"registryAddress,omitempty"`
	PrivateKey      string `json:"-"`
}

Security Tokens

type Integration

type Integration struct {
	Type      Type            `json:"type,omitempty"`
	Enabled   bool            `json:"enabled,omitempty"`
	Show      bool            `json:"show,omitempty"`
	Id        string          `json:"id,omitempty"`
	Data      json.RawMessage `json:"data,omitempty"`
	CreatedAt time.Time       `json:"createdAt,omitempty"`
	UpdatedAt time.Time       `json:"updatedAt,omitempty"`

	// Analytics
	AnalyticsCustom              AnalyticsCustom              `json:"-"`
	AnalyticsFacebookPixel       AnalyticsFacebookPixel       `json:"-"`
	AnalyticsFacebookConversions AnalyticsFacebookConversions `json:"-"`
	AnalyticsGoogleAdwords       AnalyticsGoogleAdwords       `json:"-"`
	AnalyticsGoogleAnalytics     AnalyticsGoogleAnalytics     `json:"-"`
	AnalyticsHeap                AnalyticsHeap                `json:"-"`
	AnalyticsSentry              AnalyticsSentry              `json:"-"`

	// Others
	AuthorizeNet  AuthorizeNet  `json:"-"`
	Bitcoin       Bitcoin       `json:"-"`
	Ethereum      Ethereum      `json:"-"`
	Mailchimp     Mailchimp     `json:"-"`
	Mandrill      Mandrill      `json:"-"`
	Netlify       Netlify       `json:"-"`
	Paypal        Paypal        `json:"-"`
	Plaid         Plaid         `json:"-"`
	Reamaze       Reamaze       `json:"-"`
	Recaptcha     Recaptcha     `json:"-"`
	Salesforce    Salesforce    `json:"-"`
	Shipwire      Shipwire      `json:"-"`
	SendGrid      SendGrid      `json:"-"`
	SMTPRelay     SMTPRelay     `json:"-"`
	Stripe        Stripe        `json:"-"`
	SecurityToken SecurityToken `json:"-"`
	Woopra        Woopra        `json:"-"`
}

type Integrations

type Integrations []Integration

func (Integrations) Append

func (i Integrations) Append(src *Integration) (Integrations, error)

func (Integrations) EmailMarketingProvider

func (i Integrations) EmailMarketingProvider() (*Integration, error)

func (Integrations) EmailProvider

func (i Integrations) EmailProvider() (*Integration, error)

func (Integrations) FilterByType

func (i Integrations) FilterByType(typ Type) Integrations

func (Integrations) FindById

func (i Integrations) FindById(id string) (*Integration, error)

func (Integrations) FindByType

func (i Integrations) FindByType(typ Type) *Integration

func (Integrations) MustAppend

func (i Integrations) MustAppend(src *Integration) Integrations

func (Integrations) MustRemove

func (i Integrations) MustRemove(id string) Integrations

func (Integrations) MustUpdate

func (i Integrations) MustUpdate(in *Integration) Integrations

func (Integrations) Remove

func (i Integrations) Remove(id string) (Integrations, error)

func (Integrations) Update

func (i Integrations) Update(src *Integration) (Integrations, error)

type Mailchimp

type Mailchimp struct {
	ListId      string `json:"listId,omitempty"`
	APIKey      string `json:"apiKey,omitempty"`
	CheckoutUrl string `json:"checkoutUrl,omitempty"`
}

Mailchimp settings

type Mandrill

type Mandrill struct {
	APIKey string `json:"apiKey,omitempty"`
}

Mandrill settings

type Netlify

type Netlify struct {
	AccessToken string    `json:"accessToken,omitempty"`
	CreatedAt   time.Time `json:"createdAt,omitempty"`
	Email       string    `json:"email,omitempty"`
	Id          string    `json:"id,omitempty"`
	Uid         string    `json:"uId,omitempty"`
}

Netlify settings

type Paypal

type Paypal struct {
	Live struct {
		Email             string `json:"email,omitempty"`
		SecurityUserId    string `json:"securityUserId,omitempty"`
		SecurityPassword  string `json:"securityPassword,omitempty" datastore:",noindex"`
		SecuritySignature string `json:"SecuritySignature,omitempty" datastore:",noindex"`
		ApplicationId     string `json:"applicationId,omitempty"`
	} `json:"live,omitempty"`
	Test struct {
		Email             string `json:"email,omitempty"`
		SecurityUserId    string `json:"securityUserId,omitempty"`
		SecurityPassword  string `json:"securityPassword,omitempty" datastore:",noindex"`
		SecuritySignature string `json:"SecuritySignature,omitempty" datastore:",noindex"`
		ApplicationId     string `json:"applicationId,omitempty"`
	} `json:"test,omitempty"`

	ConfirmUrl string `json:"confirmUrl,omitempty" datastore:",noindex"`
	CancelUrl  string `json:"cancelUrl,omitempty" datastore:",noindex"`
}

Paypal connection

type Plaid

type Plaid struct {
	ClientId  string `json:"clientId,omitempty"`
	Secret    string `json:"secret,omitempty" datastore:",noindex"`
	PublicKey string `json:"pubKey,omitempty"`
}

Plaid keys

type Reamaze

type Reamaze struct {
	Secret string `json:"secret,omitempty"`
}

type Recaptcha

type Recaptcha struct {
	Enabled   bool   `json:"enabled,omitempty"`
	SecretKey string `json:"secretKey,omitempty"`
}

type SMTPRelay

type SMTPRelay struct {
	Username string   `json:"username"`
	Password string   `json:"password"`
	Host     string   `json:"host"`
	Port     string   `json:"port"`
	MailFrom string   `json:"mailFrom"`
	MailTo   []string `json:"mailTo"`
	Msg      string   `json:"msg"`
}

SMTP settings

type Salesforce

type Salesforce struct {
	AccessToken        string `json:"accessToken,omitempty"`
	DefaultPriceBookId string `json:"defaultPriceBookId,omitempty"`
	// personalized login url
	Id           string `json:"id,omitempty"`
	InstanceUrl  string `json:"instanceUrl,omitempty"`
	IssuedAt     string `json:"issuedAt,omitempty"`
	RefreshToken string `json:"refreshToken,omitempty"`
	Signature    string `json:"signature,omitempty" datastore:",noindex"`
}

Salesforce settings

type SecurityToken

type SecurityToken struct {
	Ethereum EthereumSecurityToken `json:"ethereum,omitempty"`
	EOS      EOSSecurityToken      `json:"eos,omitempty"`
}

type SendGrid

type SendGrid struct {
	APIKey string `json:"apiKey,omitempty"`
}

SendGrid settings

type Shipwire

type Shipwire struct {
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
}

type Square

type Square struct {
	WebhookSignatureKey string           `json:"webhookSignatureKey,omitempty"`
	Sandbox             SquareConnection `json:"sandbox"`
	Production          SquareConnection `json:"production"`
}

type SquareConnection

type SquareConnection struct {
	ApplicationId string `json:"applicationId,omitempty"`
	AccessToken   string `json:"accessToken,omitempty"`
	LocationId    string `json:"locationId,omitempty"`
}

Square connection

type Stripe

type Stripe struct {
	// For convenience duplicated
	AccessToken    string `json:"accessToken,omitempty"`
	PublishableKey string `json:"publishableKey,omitempty"`
	RefreshToken   string `json:"refreshToken,omitempty"`
	UserId         string `json:"userId,omitempty"`

	// Save entire live and test tokens
	Live stripe.Token `json:"live,omitempty" datastore:",noindex"`
	Test stripe.Token `json:"test,omitempty" datastore:",noindex"`
}

Stripe connection

type Type

type Type string
const (
	// Analytics
	AnalyticsCustomType              Type = "analytics-custom"
	AnalyticsFacebookPixelType       Type = "analytics-facebook-pixel"
	AnalyticsFacebookConversionsType Type = "analytics-facebook-conversions"
	AnalyticsGoogleAdwordsType       Type = "analytics-google-adwords"
	AnalyticsGoogleAnalyticsType     Type = "analytics-google-analytics"
	AnalyticsHeapType                Type = "analytics-heap"
	AnalyticsSentryType              Type = "analytics-sentry"

	// Others
	AuthorizeNetType  Type = "authorizeNet"
	BitcoinType       Type = "bitcoin"
	EthereumType      Type = "ethereum"
	MailchimpType     Type = "mailchimp"
	MandrillType      Type = "mandrill"
	NetlifyType       Type = "netlify"
	PaypalType        Type = "paypal"
	PlaidType         Type = "plaid"
	ReamazeType       Type = "reamaze"
	RecaptchaType     Type = "recaptcha"
	SalesforceType    Type = "salesforce"
	SecurityTokenType Type = "securityToken"
	SendGridType      Type = "sendgrid"
	ShipwireType      Type = "shipwire"
	SMTPRelayType     Type = "smtprelay"
	StripeType        Type = "stripe"
	WoopraType        Type = "woopra"
)

type Value

type Value analytics.Value

Override value for a given event

type Values

type Values analytics.Values

type Woopra

type Woopra struct {
	Domain string `json:"domain,omitempty"`
}

Jump to

Keyboard shortcuts

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