Versions in this module Expand all Collapse all v0 v0.1.0 Apr 19, 2019 Changes in this version + const AgentName + const ApplicationName + const MaxRetries + const ThreepidSessionValidationLifetime + const ThreepidSessionValidationTimeout + var InviteTpl = "/email/invite_template.eml" + var InviteVector = "/email/invite_template_vector.eml" + var VerificationTpl = "/email/verification_template.eml" + var VerificationVector = "/email/verification_template_vector.eml" + var VerifyResponsePage = "/email/verify_response_page_template" + var VerifyResponsePageVector = "/email/verify_response_page_template_vector_im" + func Empty(c *Matrix) bool + func EnsureConnected(driver, conn string) (db *sql.DB, err error) + func FormatDate(ts time.Time, local, useGMT bool) string + func IsValidEmail(email string) bool + func MergeTemplates(a, b []Template) map[string]Template + func ProcessFile(src []byte) []byte + type Client interface + Host func() string + Send func(from string, to []string, msg []byte) error + type Container struct + Name string + Settings map[string]interface{} + State string + type Crypto struct + Algorithm string + SingingKey string + VerifyKey string + Version string + func (c Crypto) Key() *signedjson.Key + func (c Crypto) Valid() *Validation + type DB struct + Conn string + Driver string + func (db DB) Valid() *Validation + type Email struct + Invite Invite + Providers []Provider + Verification Verification + func (e Email) Provider(templates *template.Template) (EmailProvider, error) + func (e Email) Valid(templates *template.Template) *Validation + type EmailProvider interface + type Field struct + Name string + Value string + type HTTPClient interface + Do func(*http.Request) (*http.Response, error) + type Invite struct + From string + Template string + func (i Invite) Valid() *Validation + type Key struct + ID string + Value string + type Kmail struct + func New(client Client, tpl *template.Template) (*Kmail, error) + func (k *Kmail) SendMail(ctx context.Context, tmpl, from string, to []string, data map[string]string) error + func (k *Kmail) Valid() *Validation + type Mail interface + SendMail func(ctx context.Context, tmpl, from string, to []string, data map[string]string) error + type Matrix struct + DB DB + Email Email + Mode string + Peers []Peer + Server Server + Templates []Template + func LoadFile(src []byte) (*Matrix, error) + func LoadFromEnv() *Matrix + func Sample() *Matrix + func (m *Matrix) GetTemplate() *template.Template + func (m *Matrix) LoadTemplates() error + func (m *Matrix) Valid() *Validation + func (m *Matrix) Validate(lg logger.Logger) (ok bool) + func (m *Matrix) WriteToFile(filename string) error + type NoopMail struct + func (n NoopMail) SendMail(ctx context.Context, tmpl, from string, to []string, data map[string]string) error + func (n NoopMail) Valid() *Validation + type Peer struct + BaseReplicationURL string + Name string + type Provider Container + type SMTPClient struct + func NewSMAPCLient(cfg SMTPEmail) *SMTPClient + func (s *SMTPClient) Host() string + func (s *SMTPClient) Send(from string, to []string, msg []byte) error + func (s *SMTPClient) Valid() *Validation + type SMTPEmail struct + Enabled bool + Host string + Password string + Port int64 + Username string + func (s SMTPEmail) Valid() *Validation + type Server struct + ClientHTTPBase string + Crypto Crypto + Name string + Port string + func (s Server) Address() string + func (s Server) Valid() *Validation + type Template struct + Name string + Path string + func EmbedTemplates() []Template + type Validation struct + Children []*Validation + Fields []Field + Namespace string + func (v *Validation) Set(name, value string) + func (v Validation) IsValid() bool + func (v Validation) String() string + type Validator interface + Valid func() *Validation + type Verification struct + From string + ResponsePage string + Template string + func (i Verification) Valid() *Validation