Documentation ¶
Index ¶
- Constants
- Variables
- func Dump(i interface{}) (s string)
- type Audit
- type BlastEmailConfig
- type Campaign
- type CampaignRenderer
- type CampaignService
- func (c *CampaignService) Create(ctx context.Context, req CreateCampaignRequest) (campaign Campaign, err error)
- func (c *CampaignService) CreateBlastEmailEvent(ctx context.Context, req CreateBlastEmailEventRequest) (event Event, err error)
- func (c *CampaignService) Delete(ctx context.Context, id ulids.ULID) (campaign Campaign, err error)
- func (c *CampaignService) Find(ctx context.Context, id ulids.ULID) (campaign Campaign, err error)
- func (c *CampaignService) List(ctx context.Context) (campaigns []Campaign, err error)
- func (c *CampaignService) RenderByBodyAndTemplate(ctx context.Context, templateID ulids.ULID, body string) (result []byte, err error)
- func (c *CampaignService) RenderBytes(campaign Campaign) ([]byte, error)
- func (c *CampaignService) Update(ctx context.Context, req UpdateCampaignRequest) (_ Campaign, err error)
- type Config
- type CreateBlastEmailEventRequest
- type CreateCampaignRequest
- type CreateTemplateRequest
- type Event
- type EventStatus
- type File
- type FileService
- type Service
- type Template
- type TemplateService
- func (t *TemplateService) Create(ctx context.Context, req CreateTemplateRequest) (tpl Template, err error)
- func (t *TemplateService) FindAll(ctx context.Context) (tmplts []Template, err error)
- func (t *TemplateService) FindByID(ctx context.Context, id ulids.ULID) (tpl Template, err error)
- func (t *TemplateService) Update(ctx context.Context, req UpdateTemplateRequest) (tpl Template, err error)
- type UpdateCampaignRequest
- type UpdateTemplateRequest
Constants ¶
View Source
const CampaignBucket = "campaigns"
Variables ¶
View Source
var ErrNotFound = errors.New("not found error")
Functions ¶
Types ¶
type BlastEmailConfig ¶
type BlastEmailConfig struct { Sender string Concurrency uint Transporter mailmerger.Transporter }
type Campaign ¶
type Campaign struct { ID ulids.ULID `gorm:"primary_key"` FileID *ulids.ULID Name string Body string Subject string TemplateID *ulids.ULID Audit File File Events []Event Template *Template `gorm:"->;foreignKey:TemplateID"` }
func (Campaign) HasNoTemplate ¶
type CampaignRenderer ¶
type CampaignRenderer struct {
// contains filtered or unexported fields
}
func NewCampaignRenderer ¶
func NewCampaignRenderer(body string, template *Template) CampaignRenderer
type CampaignService ¶
type CampaignService struct {
// contains filtered or unexported fields
}
func (*CampaignService) Create ¶
func (c *CampaignService) Create(ctx context.Context, req CreateCampaignRequest) (campaign Campaign, err error)
func (*CampaignService) CreateBlastEmailEvent ¶
func (c *CampaignService) CreateBlastEmailEvent(ctx context.Context, req CreateBlastEmailEventRequest) (event Event, err error)
CreateBlastEmailEvent create an event
func (*CampaignService) List ¶
func (c *CampaignService) List(ctx context.Context) (campaigns []Campaign, err error)
func (*CampaignService) RenderByBodyAndTemplate ¶
func (*CampaignService) RenderBytes ¶
func (c *CampaignService) RenderBytes(campaign Campaign) ([]byte, error)
func (*CampaignService) Update ¶
func (c *CampaignService) Update(ctx context.Context, req UpdateCampaignRequest) (_ Campaign, err error)
type CreateCampaignRequest ¶
type CreateTemplateRequest ¶
type EventStatus ¶
type EventStatus string
const ( EventStatusSuccess EventStatus = "success" EventStatusFailed EventStatus = "failed" )
type FileService ¶
type FileService struct {
// contains filtered or unexported fields
}
func (*FileService) Find ¶
func (f *FileService) Find(ctx context.Context, fileName string) (rc io.ReadCloser, err error)
type Service ¶
type Service struct { CampaignService *CampaignService FileService *FileService TemplateService *TemplateService }
func NewService ¶
type TemplateService ¶
type TemplateService struct {
// contains filtered or unexported fields
}
func (*TemplateService) Create ¶
func (t *TemplateService) Create(ctx context.Context, req CreateTemplateRequest) (tpl Template, err error)
func (*TemplateService) FindAll ¶
func (t *TemplateService) FindAll(ctx context.Context) (tmplts []Template, err error)
func (*TemplateService) Update ¶
func (t *TemplateService) Update(ctx context.Context, req UpdateTemplateRequest) (tpl Template, err error)
type UpdateCampaignRequest ¶
Click to show internal directories.
Click to hide internal directories.