notify

package
v0.3.10-0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSuchMobile     = errors.Error("no such mobile")
	ErrIncompleteConfig = errors.Error("incomplete config")
)

Functions

This section is empty.

Types

type INotifyService

type INotifyService interface {
	InitAll() error
	StopAll()
	UpdateServices(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)
	UpdateConfig(ctx context.Context, service string, config SConfig) error
	Send(ctx context.Context, contactType string, args apis.SendParams) error
	ContactByMobile(ctx context.Context, mobile, serviceName, domainId string) (string, error)
	BatchSend(ctx context.Context, contactType string, args apis.BatchSendParams) ([]*apis.FailedRecord, error)
	SendRobotMessage(ctx context.Context, rType string, receivers []*apis.SReceiver, title string, message string) ([]*apis.FailedRecord, error)
	AddConfig(ctx context.Context, service string, config SConfig) error
	DeleteConfig(ctx context.Context, service, domainId string) error
	ValidateConfig(ctx context.Context, cType string, configs map[string]string) (isValid bool, message string, err error)
}

type IServiceConfigStore

type IServiceConfigStore interface {
	GetConfigs(service string) ([]SConfig, error)
	SetConfig(service string, config SConfig) error
}

type ITemplateStore

type ITemplateStore interface {
	// NotifyFilter(contactType, topic, msg, lang string) (params apis.SendParams, err error)
	FillWithTemplate(ctx context.Context, lang string, notification SNotification) (params apis.SendParams, err error)
}

type SBatchSendParams

type SBatchSendParams struct {
	ContactType string
	Contacts    []string
	Topic       string
	Message     string
	Priority    string
	Lang        string
}

type SConfig

type SConfig struct {
	Config   map[string]string
	DomainId string
}

type SNotification

type SNotification struct {
	ContactType string
	Topic       string
	Message     string
	Event       notify_apis.SNotifyEvent
	AdvanceDays int
}

type SSendParams

type SSendParams struct {
	ContactType string
	Contact     string
	Topic       string
	Message     string
	Priority    string
	Lang        string
}

Directories

Path Synopsis
rpc

Jump to

Keyboard shortcuts

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