mailfx

package
v0.0.0-...-8a99b67 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MailClientModule = fx.Provide(
	func(
		a MailSettingParams,
		sSetting sfx.SecuritySettingsParams,
	) (out MailClientResult, err error) {
		err = out.Execute(a, sSetting)
		return
	},
)
View Source
var MailClientPrivateModule = fx.Provide(
	func(
		a MailSettingParams,
		sSetting sfx.SecuritySettingsParams,
	) (out MailClientPrivateResult, err error) {
		err = out.Execute(a, sSetting)
		return
	},
)
View Source
var MailSettingsModule = fx.Provide(
	func() (out MailSettingsResult, err error) {
		err = out.LoadFromEnv()
		return
	},
)

Functions

func NewMailClient

func NewMailClient(target string, sSetting sfx.SecuritySettingsParams) (pb.MailServiceClient, error)

func NewMailPrivateClient

func NewMailPrivateClient(target string, sSetting sfx.SecuritySettingsParams) (pb.MailPrivateServiceClient, error)

Types

type MailClientParams

type MailClientParams struct {
	fx.In
	MailClient pb.MailServiceClient `name:"MailClient"`
}

type MailClientPrivateParams

type MailClientPrivateParams struct {
	fx.In
	MailClient pb.MailPrivateServiceClient `name:"MailPrivateClient"`
}

type MailClientPrivateResult

type MailClientPrivateResult struct {
	fx.Out
	MailClient pb.MailPrivateServiceClient `name:"MailPrivateClient"`
}

func (*MailClientPrivateResult) Execute

type MailClientResult

type MailClientResult struct {
	fx.Out
	MailClient pb.MailServiceClient `name:"MailClient"`
}

func (*MailClientResult) Execute

func (g *MailClientResult) Execute(
	a MailSettingParams,
	sSetting sfx.SecuritySettingsParams,
) (err error)

type MailSettingParams

type MailSettingParams struct {
	fx.In
	MailStoreName     string `name:"MailStoreName"`
	MailUrl           string `name:"MailUrl"`
	MailNumMax        int    `name:"MailNumMax"`
	MailDefaultExpire int32  `name:"MailDefaultExpire"`
	MailEncryptionKey string `name:"MailEncryptionKey"`
}

type MailSettingsResult

type MailSettingsResult struct {
	fx.Out
	MailStoreName string `name:"MailStoreName" envconfig:"MAIL_STORE_NAME" default:"mail"`
	MailUrl       string `name:"MailUrl" envconfig:"MAIL_URL" default:"localhost:8081"`
	// MailNumMax is the max number of mail that can be stored in the mail store
	MailNumMax int `name:"MailNumMax" envconfig:"MAIL_NUM_MAX" default:"99"`
	// MailDefaultExpire is the default expire time of mail (day)
	MailDefaultExpire int32 `name:"MailDefaultExpire" envconfig:"MAIL_DEFAULT_EXPIRE" default:"90"`
	// MailEncryptionKey is the key used to encrypt mail data
	MailEncryptionKey string `name:"MailEncryptionKey" envconfig:"MAIL_ENCRYPTION_KEY" default:"CTeGahnbQWfAr5hW"`
}

func (*MailSettingsResult) LoadFromEnv

func (msl *MailSettingsResult) LoadFromEnv() (err error)

Jump to

Keyboard shortcuts

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