sisito

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2017 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConfig = "sisito-api.toml"
)

Variables

This section is empty.

Functions

func MergeRecipientAliases added in v0.2.5

func MergeRecipientAliases(recipientAlieses []Recipient) (merged []string)

func NormalizeRecipient added in v0.2.5

func NormalizeRecipient(recipient string) (normalized string)

Types

type AuthzConfig added in v0.2.4

type AuthzConfig struct {
	Recent    bool
	Listed    bool
	Blacklist bool
}

type BounceMail

type BounceMail struct {
	Id             int32
	Timestamp      time.Time
	Lhost          string
	Rhost          string
	Alias          string
	Listid         string
	Reason         string
	Action         string
	Subject        string
	Messageid      string
	Smtpagent      string
	Softbounce     uint8
	Smtpcommand    string
	Destination    string
	Senderdomain   string
	Feedbacktype   string
	Diagnosticcode string
	Deliverystatus string
	Timezoneoffset string
	Addresser      string
	Addresseralias string
	Recipient      string
	Digest         string
	CreatedAt      time.Time `db:"created_at"`
	UpdatedAt      time.Time `db:"updated_at"`
	Whitelisted    uint8
}

type Config

type Config struct {
	Server   ServerConfig
	Database DatabaseConfig
	User     []UserConfig
	Filter   []FilterConfig
	Authz    AuthzConfig
}

func LoadConfig

func LoadConfig(flags *Flags) (config *Config, err error)

type DatabaseConfig

type DatabaseConfig struct {
	Host     string
	Port     int64
	Database string
	Username string
	Password string
	Timezone string
}

type Driver

type Driver struct {
	Config *Config
	DbMap  *gorp.DbMap
}

func NewDriver

func NewDriver(config *Config, debug bool, out io.Writer) (driver *Driver, err error)

func (*Driver) BlacklistRecipients added in v0.1.6

func (driver *Driver) BlacklistRecipients(senderdomain string, reasons []string, softbounce *bool, limit uint64, offset uint64, useFilter bool) (recipients []string, err error)

func (*Driver) Close

func (driver *Driver) Close()

func (*Driver) Listed added in v0.1.8

func (driver *Driver) Listed(name string, value string, senderdomain string, useFilter bool) (listed bool, err error)

func (*Driver) RecentlyListed added in v0.1.7

func (driver *Driver) RecentlyListed(name string, value string, senderdomain string, useFilter bool) (listed []BounceMail, err error)

type FilterConfig added in v0.1.8

type FilterConfig struct {
	Key      string
	Operator string
	Value    string
	Values   []string
	Join     string
	Sql      string
}

type Flags

type Flags struct {
	Config string
}

func ParseFlag

func ParseFlag() (flags *Flags)

type Recipient added in v0.1.2

type Recipient struct {
	Recipient string
	Alias     string
}

type Server

type Server struct {
	Engine *gin.Engine
	Driver *Driver
}

func NewServer

func NewServer(config *Config, driver *Driver, out io.Writer) (server *Server)

func (*Server) Blacklist added in v0.1.6

func (server *Server) Blacklist(c *gin.Context)

func (*Server) Listed added in v0.1.7

func (server *Server) Listed(c *gin.Context)

func (*Server) Ping added in v0.1.6

func (server *Server) Ping(c *gin.Context)

func (*Server) Recent added in v0.1.6

func (server *Server) Recent(c *gin.Context)

func (*Server) Run

func (server *Server) Run()

type ServerConfig added in v0.2.1

type ServerConfig struct {
	Log    string
	Gzip   bool
	Prefix string
}

type UserConfig added in v0.1.6

type UserConfig struct {
	Userid   string
	Password string
}

Jump to

Keyboard shortcuts

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