storages

package
Version: v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessagesStorage

type MessagesStorage interface {
	// PutMessage puts MessageStorageValue to storage.
	// If message with specified id already exists in storage it will be overwritten.
	PutMessage(id string, value *models.MessagesStorageValue) error

	// GetMessage returns value by specified ID.
	GetMessage(id string) (*models.MessagesStorageValue, error)

	// GetValue returns all messages.
	GetMessageList(page int, perPage int) (*models.MessageListResponse, error)

	io.Closer
}

MessagesStorage used to store sent emails.

type TemplateStorage

type TemplateStorage interface {
	// PutTemplate puts template to storage.
	PutTemplate(templateName, templateVersion, templateData, templateSubject string, new bool) error

	// GetTemplate returns specified version of template.
	GetTemplate(templateName, templateVersion string) (*models.Template, error)

	// GetLatestVersionTemplate returns latest version of template and it`s value using semver to compare versions.
	GetLatestVersionTemplate(templateName string) (*string, *models.Template, error)

	// GetTemplates returns all versions of templates in map (key is version, value is template).
	GetTemplates(templateName string) (map[string]*models.Template, error)

	// DeleteTemplate deletes specified version of template. Returns nil on successful delete.
	DeleteTemplate(templateName, templateVersion string) error

	// DeleteTemplates deletes all versions of template. Returns nil on successful delete.
	DeleteTemplates(templateName string) error

	// GetTemplatesList returns list of all of templates.
	GetTemplatesList() (*models.TemplatesListResponse, error)

	io.Closer
}

TemplateStorage used to store email templates. Implementation must support tagging and versioning with "semantic versioning 2.0"

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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