hmsg

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: Apache-2.0 Imports: 24 Imported by: 8

Documentation

Index

Constants

View Source
const (
	MsgActionPostOK      uint32 = 1 << 1
	MsgActionPostError   uint32 = 1 << 2
	MsgActionPostTimeout uint32 = 1 << 3
)

Variables

View Source
var (
	MsgIdRE            = regexp.MustCompile("^[a-f0-9]{16,32}$")
	MailTemplateNameRE = regexp.MustCompile("^[a-z]{1,1}[a-z0-9/]{2,32}$")
)
View Source
var (
	MsgContentType_name = map[int32]string{
		0: "TextPlain",
		1: "TextHtml",
	}
	MsgContentType_value = map[string]int32{
		"TextPlain": 0,
		"TextHtml":  1,
	}
)

Enum value maps for MsgContentType.

Functions

This section is empty.

Types

type HashSeed

type HashSeed string

type MailManager

type MailManager struct {
	// contains filtered or unexported fields
}

func NewMailManager

func NewMailManager() *MailManager

func (*MailManager) LocaleLangSet

func (it *MailManager) LocaleLangSet(v string)

func (*MailManager) TemplateFlush

func (it *MailManager) TemplateFlush(args ...interface{}) error

func (*MailManager) TemplateLoad

func (it *MailManager) TemplateLoad(args ...interface{}) error

func (*MailManager) TemplateRender

func (it *MailManager) TemplateRender(name string, lang string, data interface{}) (*MailTemplateLang, error)

func (*MailManager) TemplateSet

func (it *MailManager) TemplateSet(set *MailTemplateEntry) error

type MailManagerConfig

type MailManagerConfig struct {
	Templates []*MailTemplateEntry `json:"templates" toml:"templates"`
}

type MailTemplateEntry

type MailTemplateEntry struct {
	Name        string              `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty" toml:"name,omitempty"`
	Description string              `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty" toml:"description,omitempty"`
	Items       []*MailTemplateLang `protobuf:"bytes,9,rep,name=items,proto3" json:"items,omitempty" toml:"items,omitempty"`
	// contains filtered or unexported fields
}

func (*MailTemplateEntry) Descriptor deprecated

func (*MailTemplateEntry) Descriptor() ([]byte, []int)

Deprecated: Use MailTemplateEntry.ProtoReflect.Descriptor instead.

func (*MailTemplateEntry) GetDescription

func (x *MailTemplateEntry) GetDescription() string

func (*MailTemplateEntry) GetItems

func (x *MailTemplateEntry) GetItems() []*MailTemplateLang

func (*MailTemplateEntry) GetName

func (x *MailTemplateEntry) GetName() string

func (*MailTemplateEntry) Item

func (it *MailTemplateEntry) Item(lang string) *MailTemplateLang

func (*MailTemplateEntry) ProtoMessage

func (*MailTemplateEntry) ProtoMessage()

func (*MailTemplateEntry) ProtoReflect

func (x *MailTemplateEntry) ProtoReflect() protoreflect.Message

func (*MailTemplateEntry) Reset

func (x *MailTemplateEntry) Reset()

func (*MailTemplateEntry) String

func (x *MailTemplateEntry) String() string

func (*MailTemplateEntry) Valid

func (it *MailTemplateEntry) Valid() error

type MailTemplateLang

type MailTemplateLang struct {
	Lang     string         `protobuf:"bytes,1,opt,name=lang,proto3" json:"lang,omitempty" toml:"lang,omitempty"`
	Title    string         `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty" toml:"title,omitempty"`
	Body     string         `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty" toml:"body,omitempty"`
	BodyType MsgContentType `` /* 147-byte string literal not displayed */
	Version  uint64         `protobuf:"varint,13,opt,name=version,proto3" json:"version,omitempty" toml:"version,omitempty"`
	// contains filtered or unexported fields
}

func (*MailTemplateLang) Descriptor deprecated

func (*MailTemplateLang) Descriptor() ([]byte, []int)

Deprecated: Use MailTemplateLang.ProtoReflect.Descriptor instead.

func (*MailTemplateLang) Equal

func (it *MailTemplateLang) Equal(v *MailTemplateLang) bool

func (*MailTemplateLang) GetBody

func (x *MailTemplateLang) GetBody() string

func (*MailTemplateLang) GetBodyType

func (x *MailTemplateLang) GetBodyType() MsgContentType

func (*MailTemplateLang) GetLang

func (x *MailTemplateLang) GetLang() string

func (*MailTemplateLang) GetTitle

func (x *MailTemplateLang) GetTitle() string

func (*MailTemplateLang) GetVersion

func (x *MailTemplateLang) GetVersion() uint64

func (*MailTemplateLang) ProtoMessage

func (*MailTemplateLang) ProtoMessage()

func (*MailTemplateLang) ProtoReflect

func (x *MailTemplateLang) ProtoReflect() protoreflect.Message

func (*MailTemplateLang) Reset

func (x *MailTemplateLang) Reset()

func (*MailTemplateLang) String

func (x *MailTemplateLang) String() string

func (*MailTemplateLang) Valid

func (it *MailTemplateLang) Valid() error

type MsgContentType

type MsgContentType int32
const (
	MsgContentType_TextPlain MsgContentType = 0
	MsgContentType_TextHtml  MsgContentType = 1
)

func (MsgContentType) Descriptor

func (MsgContentType) Enum

func (x MsgContentType) Enum() *MsgContentType

func (MsgContentType) EnumDescriptor deprecated

func (MsgContentType) EnumDescriptor() ([]byte, []int)

Deprecated: Use MsgContentType.Descriptor instead.

func (MsgContentType) Number

func (MsgContentType) String

func (x MsgContentType) String() string

func (MsgContentType) Type

type MsgItem

type MsgItem struct {
	Id        string         `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" toml:"id,omitempty"`
	Action    uint32         `protobuf:"varint,2,opt,name=action,proto3" json:"action,omitempty" toml:"action,omitempty"`
	ToUser    string         `protobuf:"bytes,3,opt,name=to_user,json=toUser,proto3" json:"to_user,omitempty" toml:"to_user,omitempty"`
	ToEmail   string         `protobuf:"bytes,4,opt,name=to_email,json=toEmail,proto3" json:"to_email,omitempty" toml:"to_email,omitempty"`
	FromUser  string         `protobuf:"bytes,5,opt,name=from_user,json=fromUser,proto3" json:"from_user,omitempty" toml:"from_user,omitempty"`
	FromEmail string         `protobuf:"bytes,6,opt,name=from_email,json=fromEmail,proto3" json:"from_email,omitempty" toml:"from_email,omitempty"`
	Priority  uint32         `protobuf:"varint,7,opt,name=priority,proto3" json:"priority,omitempty" toml:"priority,omitempty"`
	Title     string         `protobuf:"bytes,8,opt,name=title,proto3" json:"title,omitempty" toml:"title,omitempty"`
	Body      string         `protobuf:"bytes,9,opt,name=body,proto3" json:"body,omitempty" toml:"body,omitempty"`
	Retry     uint32         `protobuf:"varint,10,opt,name=retry,proto3" json:"retry,omitempty" toml:"retry,omitempty"`
	Type      MsgContentType `protobuf:"varint,11,opt,name=type,proto3,enum=hooto.hmsg.v1.MsgContentType" json:"type,omitempty" toml:"type,omitempty"`
	Log       string         `protobuf:"bytes,12,opt,name=log,proto3" json:"log,omitempty" toml:"log,omitempty"`
	Posted    uint32         `protobuf:"varint,13,opt,name=posted,proto3" json:"posted,omitempty" toml:"posted,omitempty"`
	Created   uint32         `protobuf:"varint,14,opt,name=created,proto3" json:"created,omitempty" toml:"created,omitempty"`
	Updated   uint32         `protobuf:"varint,15,opt,name=updated,proto3" json:"updated,omitempty" toml:"updated,omitempty"`
	// contains filtered or unexported fields
}

func NewMsgItem

func NewMsgItem(args ...interface{}) *MsgItem

func (*MsgItem) Descriptor deprecated

func (*MsgItem) Descriptor() ([]byte, []int)

Deprecated: Use MsgItem.ProtoReflect.Descriptor instead.

func (*MsgItem) GetAction

func (x *MsgItem) GetAction() uint32

func (*MsgItem) GetBody

func (x *MsgItem) GetBody() string

func (*MsgItem) GetCreated

func (x *MsgItem) GetCreated() uint32

func (*MsgItem) GetFromEmail

func (x *MsgItem) GetFromEmail() string

func (*MsgItem) GetFromUser

func (x *MsgItem) GetFromUser() string

func (*MsgItem) GetId

func (x *MsgItem) GetId() string

func (*MsgItem) GetLog

func (x *MsgItem) GetLog() string

func (*MsgItem) GetPosted

func (x *MsgItem) GetPosted() uint32

func (*MsgItem) GetPriority

func (x *MsgItem) GetPriority() uint32

func (*MsgItem) GetRetry

func (x *MsgItem) GetRetry() uint32

func (*MsgItem) GetTitle

func (x *MsgItem) GetTitle() string

func (*MsgItem) GetToEmail

func (x *MsgItem) GetToEmail() string

func (*MsgItem) GetToUser

func (x *MsgItem) GetToUser() string

func (*MsgItem) GetType

func (x *MsgItem) GetType() MsgContentType

func (*MsgItem) GetUpdated

func (x *MsgItem) GetUpdated() uint32

func (*MsgItem) ProtoMessage

func (*MsgItem) ProtoMessage()

func (*MsgItem) ProtoReflect

func (x *MsgItem) ProtoReflect() protoreflect.Message

func (*MsgItem) Reset

func (x *MsgItem) Reset()

func (*MsgItem) SentId

func (it *MsgItem) SentId() string

func (*MsgItem) String

func (x *MsgItem) String() string

func (*MsgItem) Valid

func (it *MsgItem) Valid() error

Jump to

Keyboard shortcuts

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