config

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI added in v0.11.0

type CLI struct {
	Config        *string `name:"config" help:"Path to config file." type:"string"`
	DataDirectory string  `name:"data-directory" help:"Path to data directory." type:"path"`
	SMTPDisable   *bool   `name:"smtp-disable" help:"Disable SMTP server."`
	SMTPHost      *string `name:"smtp-host" help:"SMTP host address to listen on."`
	SMTPPort      *uint16 `name:"smtp-port" help:"SMTP port to listen on."`
	HTTPDisable   *bool   `name:"http-disable" help:"Disable HTTP server."`
	HTTPHost      *string `name:"http-host" help:"HTTP host address to listen on."`
	HTTPPort      *uint16 `name:"http-port" help:"HTTP port to listen on."`
	Version       bool    `name:"version" help:"Show version."`
}

func ReadAndParseCLI added in v0.11.0

func ReadAndParseCLI() CLI

type Config

type Config struct {
	DatabasePath         string
	AttachmentsDirectory string
	HTTPDisable          bool
	HTTPAddress          string
	HTTPBodyLimit        int
	SMTPDisable          bool
	SMTPAddress          string
	SMTPMaxMessageBytes  int
	Endpoints            []endpoints.Endpoint
	Rules                []rules.Rule
	RuleEndpoints        map[string][]string
	RetentionPolicy      models.RetentionPolicy
}

func Parse added in v0.11.0

func Parse(raw Raw) (Config, error)

type Raw added in v0.11.0

type Raw struct {
	MaxPayloadSize string `name:"max_payload_size" default:"25 MB"`
	DataDirectory  string `name:"data_directory" default:"smtpbridge_data" arg:""`
	Retention      struct {
		EnvelopeCount  *int    `name:"envelope_count"`
		EnvelopeAge    *string `name:"envelope_age"`
		AttachmentSize *string `name:"attachment_size"`
	} `embed:"" prefix:"retention-"`
	HTTP struct {
		Disable bool
		Host    string
		Port    int `default:"8080"`
	} `embed:"" prefix:"http-"`
	SMTP struct {
		Disable bool
		Host    string
		Port    int `default:"1025"`
	} `embed:"" prefix:"smtp-"`
	Endpoints map[string]RawEndpoint
	Rules     map[string]RawRule
}

func Read added in v0.11.0

func Read(cli CLI) (Raw, error)

type RawEndpoint added in v0.11.0

type RawEndpoint struct {
	Name               string
	Kind               string
	Text_Disable       bool
	Body_Template      string
	Attachment_Disable bool
	Config             map[string]string
}

type RawRule added in v0.11.0

type RawRule struct {
	Name       string
	Expression string
	Endpoints  []string
}

Jump to

Keyboard shortcuts

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