Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrSegmentIOUsernameEmpty = errors.New("username is empty") ErrSegmentIOEmailEmpty = errors.New("email is empty") ErrSegmentIOEventEmpty = errors.New("event is empty") ErrSendgridBodyEmpty = errors.New("email body is empty") )
View Source
var DateLayout = "Jan 2, 2006"
Functions ¶
This section is empty.
Types ¶
type Body ¶
Body is used to send text or html of event directly to 3rd party. Ideally none of html should exist in codebase so it's easy to change, however legacy html code still exists.
type Event ¶
type Event struct {
Name string // name of event
User *User // user who did event
Body *Body // body of event; text or html
Properties map[string]interface{} // any additional properties
}
Event represent an action in time that is done by an user, has body and optionally some properties.
type Exporter ¶
Exporter is the interface to export events to a 3rd party service. Currently third party services: SegementIO and Sendgrid are implemented.
type FakeExporter ¶
type FakeExporter struct {
Events []*Event
}
func NewFakeExporter ¶
func NewFakeExporter() *FakeExporter
func (*FakeExporter) Close ¶
func (l *FakeExporter) Close() error
func (*FakeExporter) Send ¶
func (l *FakeExporter) Send(event *Event) error
type SegmentIOExporter ¶
func NewSegmentIOExporter ¶
func NewSegmentIOExporter(key string, size int) *SegmentIOExporter
func (*SegmentIOExporter) Close ¶
func (s *SegmentIOExporter) Close() error
func (*SegmentIOExporter) Send ¶
func (s *SegmentIOExporter) Send(event *Event) error
Click to show internal directories.
Click to hide internal directories.