wootric

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DisplayName      = "Wootric"
	HandlerKey       = "wootric"
	MessageDirection = "out"
	MessageBodyType  = models.URLEncodedRails // application/x-www-form-urlencoded

	//WootricFormatVarResponse = "wootricFormatResponse"
	WootricQryVarFormatResponse = "wootricFormatResponse"
	WootricQryVarSkipEmptyText  = "wootricSkipEmptyText"
	WootricFormatDefault        = `score[NPS Score],text[Why];firstName lastName[User name];email[User email];survey_id[Survey ID]`
)

Variables

This section is empty.

Functions

func ExampleMessage

func ExampleMessage(cfg config.Configuration, data util.ExampleData, eventSlug string) (cc.Message, error)

func NewHandler

func NewHandler() handlers.Handler

func Normalize

func Normalize(cfg config.Configuration, hReq handlers.HandlerRequest) (cc.Message, error)

Types

type Field

type Field struct {
	Property  string
	Display   string
	IsCustom  bool
	UseParens bool
}

type Line

type Line struct {
	Fields []Field
}

func ParseFields

func ParseFields(fields string) []Line

type WootricDecline

type WootricDecline struct {
	ID                json.Number       `json:"id"`
	Email             string            `json:"email"`
	ExternalID        string            `json:"external_id"`
	IPAddress         string            `json:"ip_address"`
	OriginURL         string            `json:"origin_url"`
	EndUserID         string            `json:"end_user_id"`
	EndUserProperties map[string]string `json:"end_user_properties"`
	SurveyID          string            `json:"survey_id"`
	CreatedAt         string            `json:"created_at"`
	UpdatedAt         string            `json:"updated_at"`
	CreatedAtTime     time.Time
	UpdatedAtTime     time.Time
}

type WootricEvent

type WootricEvent struct {
	Response      WootricResponse `json:"response"`
	Decline       WootricDecline  `json:"decline"`
	EventName     string          `json:"event_name"`
	Timestamp     string          `json:"timestamp"`
	AccountToken  string          `json:"account_token"`
	SurveyMode    string          `json:"survey_mode"`
	TimestampTime time.Time
}

func ParseQueryString

func ParseQueryString(raw string) (WootricEvent, error)

func (*WootricEvent) Activity

func (we *WootricEvent) Activity() string

func (*WootricEvent) IsDecline

func (we *WootricEvent) IsDecline() bool

func (*WootricEvent) IsResponse

func (we *WootricEvent) IsResponse() bool

type WootricResponse

type WootricResponse struct {
	ID                      string            `json:"id"`
	Email                   string            `json:"email"`
	ExternalID              string            `json:"external_id"`
	Score                   json.Number       `json:"score"`
	Text                    string            `json:"text"`
	IPAddress               string            `json:"ip_address"`
	OriginURL               string            `json:"origin_url"`
	EndUserID               string            `json:"end_user_id"`
	EndUserProperties       map[string]string `json:"end_user_properties"`
	SurveyID                string            `json:"survey_id"`
	CreatedAt               string            `json:"created_at"`
	UpdatedAt               string            `json:"updated_at"`
	ExcludeFromCalculations string            `json:"excluded_from_calculations"`
	CreatedAtTime           time.Time
	UpdatedAtTime           time.Time
}

func (*WootricResponse) Property

func (resp *WootricResponse) Property(key string) string

Jump to

Keyboard shortcuts

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