service

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: BSD-2-Clause Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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