service

package
v0.0.0-...-0314968 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErr

func NewErr(statusCode int, systemCode, message, internal string, isFatal bool) domain.IError

Types

type CreateTemplateRequest

type CreateTemplateRequest struct {
	Pattern string `json:"pattern"`
	Type    string `json:"type"`
}

type GetProviderReqeuest

type GetProviderReqeuest struct {
	Token string              `header:"X-Notifier-Token"`
	Type  domain.ProviderType `param:"provider"`
}

type GetProviderResponse

type GetProviderResponse struct {
	Type   string                 `json:"type"`
	Values map[string]interface{} `json:"values"`
}

type MessageService

type MessageService interface {
	Send(ctx context.Context, request *SendMessageRequest) (domain.Messages, domain.IError)
}

func NewMessageService

func NewMessageService(templateRepository domain.TemplateRepository) MessageService

type ProviderService

type ProviderService interface {
	GetProvider(context.Context, *GetProviderReqeuest) (*GetProviderResponse, domain.IError)
}

func NewProviderService

func NewProviderService() ProviderService

type SendMessageRequest

type SendMessageRequest struct {
	TenantID   string                  `param:"tenant_id"`
	Payload    *map[string]interface{} `json:"payload"`
	Recipients []struct {
		Notifier *domain.Notifier `json:"notifier"`
		Template *domain.Template `json:"template"`
	} `json:"recipients"`
}

func (*SendMessageRequest) Validate

func (r *SendMessageRequest) Validate() domain.IError

type TemplateService

type TemplateService interface {
	Create(ctx context.Context, request *CreateTemplateRequest) (*domain.Template, error)
}

func NewTemplateService

func NewTemplateService(repository domain.TemplateRepository) TemplateService

Jump to

Keyboard shortcuts

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