Documentation ¶
Index ¶
- func Client(miniconfig minimarketo.ClientConfig) (minimarketo.Client, error)
- func Miniconfig(config Config) minimarketo.ClientConfig
- type Config
- type Connector
- func (m *Connector) CreateListMembershipForUser(newUser User)
- func (m *Connector) FindLead(listEmail string) (int, bool, error)
- func (m *Connector) IsAvailable() bool
- func (m *Connector) TypeForUser(user User) string
- func (m *Connector) UpdateListMembershipForUser(oldUser User, newUser User)
- func (m *Connector) UpsertListMember(role string, listEmail string, newEmail string) error
- func (m *Connector) UpsertListMembership(oldUser User, newUser User) error
- type CreateData
- type Input
- type LeadResult
- type Manager
- type RecordResult
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Client ¶
func Client(miniconfig minimarketo.ClientConfig) (minimarketo.Client, error)
Client defines client
func Miniconfig ¶
func Miniconfig(config Config) minimarketo.ClientConfig
Miniconfig handles the connection to the client through mini marketo
Types ¶
type Config ¶
type Config struct { // ID: Marketo client ID ID string // Secret: Marketo client secret Secret string // Endpoint: https://xxx-xxx-xxx.mktorest.com URL string ClinicRole string PatientRole string Timeout uint }
Config is the env config
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
Connector manages the connection to the client
func (*Connector) CreateListMembershipForUser ¶
CreateListMembershipForUser is an asynchronous function that creates a user
func (*Connector) IsAvailable ¶
IsAvailable is a function used to test if the Parameters in connector are there and that you have a connection to marketo ready
func (*Connector) TypeForUser ¶
TypeForUser Identifies if the user is a clinic or patient
func (*Connector) UpdateListMembershipForUser ¶
UpdateListMembershipForUser is an asynchronous function that updates a user
func (*Connector) UpsertListMember ¶
UpsertListMember creates or updates lead based on if lead already exists
type CreateData ¶
type CreateData struct { Action string `json:"action"` LookupField string `json:"lookupField"` Input []Input `json:"input"` }
CreateData is the full marketo request format
type Input ¶
type Input struct { ID int `json:"id,omitempty"` Email string `json:"email"` UserType string `json:"userType"` }
Input type is the request user information format sent to marketo
type LeadResult ¶
type LeadResult struct { ID int `json:"id"` FirstName string `json:"firstName"` LastName string `json:"lastName"` Email string `json:"email"` UserType string `json:"userType"` Created string `json:"createdAt"` Updated string `json:"updatedAt"` }
LeadResult Find lead returns "result" in this format
type Manager ¶
type Manager interface { CreateListMembershipForUser(newUser User) UpdateListMembershipForUser(oldUser User, newUser User) IsAvailable() bool }
Manager interface for managing leads