Documentation
¶
Index ¶
Constants ¶
View Source
const ( DisplayName = "Enchant" HandlerKey = "enchant" MessageDirection = "out" )
Variables ¶
This section is empty.
Functions ¶
func ExampleMessage ¶
func ExampleMessage(cfg config.Configuration, data util.ExampleData) (cc.Message, error)
Types ¶
type EnchantData ¶
type EnchantModel ¶
type EnchantModel struct {
Id string `json:"id,omitempty"`
Number int64 `json:"number,omitempty"`
UserId string `json:"user_id,omitempty"`
State string `json:"state,omitempty"`
Subject string `json:"subject,omitempty"`
LabelIds []string `json:"label_ids,omitempty"`
CustomerId string `json:"customer_id,omitempty"`
Type string `json:"type,omitempty"`
ReplyTo string `json:"reply_to,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
}
type EnchantOutMessage ¶
type EnchantOutMessage struct {
Id string `json:"id,omitempty"`
AccountId string `json:"account_id,omitempty"`
AccountURL string `json:"account_url,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
Type string `json:"type,omitempty"`
Data EnchantData `json:"data,omitempty"`
ActorType string `json:"actor_type,omitempty"`
ActorId string `json:"actor_id,omitempty"`
ActorName string `json:"actor_name,omitempty"`
ModelType string `json:"model_type,omitempty"`
ModelId string `json:"model_id,omitempty"`
Model EnchantModel `json:"model,omitempty"`
}
func EnchantOutMessageFromBytes ¶
func EnchantOutMessageFromBytes(bytes []byte) (EnchantOutMessage, error)
type Handler ¶
type Handler struct {
Config config.Configuration
Adapter adapters.Adapter
}
FastHttp request handler for outbound webhook https://dev.enchant.com/webhooks
func NewHandler ¶
func NewHandler(cfg config.Configuration, adapter adapters.Adapter) Handler
FastHttp request handler constructor for outbound webhook
func (*Handler) HandleFastHTTP ¶
func (h *Handler) HandleFastHTTP(ctx *fasthttp.RequestCtx)
HandleFastHTTP is the method to respond to a fasthttp request.
func (Handler) HandlerKey ¶
func (Handler) MessageDirection ¶
Click to show internal directories.
Click to hide internal directories.