config

package
v0.8.0-rc5 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultFilenameTemplate is paygate's standard filename format for ACH files which are uploaded to an ODFI
	//
	// The format consists of a few parts: "year month day" timestamp, routing number, and sequence number
	//
	// Examples:
	//  - 20191010-987654320-1.ach
	//  - 20191010-987654320-1.ach.gpg (GPG encrypted)
	DefaultFilenameTemplate = `{{ date "20060102" }}-{{ .RoutingNumber }}-{{ .N }}.ach{{ if .GPG }}.gpg{{ end }}`
)

Functions

This section is empty.

Types

type Accounts

type Accounts struct {
	Decryptor Decryptor `yaml:"decryptor"`
}

type Admin

type Admin struct {
	BindAddress string `yaml:"bind_address"`
}

type Config

type Config struct {
	Logger    log.Logger
	LogFormat string `yaml:"log_format"`

	Http  HTTP  `yaml:"http"`
	Admin Admin `yaml:"admin"`

	ODFI     ODFI     `yaml:"odfi"`
	Pipeline Pipeline `yaml:"pipeline"`

	Customers Customers `yaml:"customers"`
}

func Empty

func Empty() *Config

func FromFile

func FromFile(path string) (*Config, error)

func Read

func Read(data []byte) (*Config, error)

func (*Config) Validate

func (cfg *Config) Validate() error

Validate checks a Config fields and performs various confirmations their values conform to expectations.

type Customers

type Customers struct {
	Endpoint string   `yaml:"endpoint"`
	Accounts Accounts `yaml:"accounts"`
}

type Cutoffs

type Cutoffs struct {
	Timezone string   `yaml:"timezone"`
	Windows  []string `yaml:"windows"`
}

func (Cutoffs) Validate

func (cfg Cutoffs) Validate() error

type Decryptor

type Decryptor struct {
	Symmetric *Symmetric `yaml:"symmetric"`
}

type FTP

type FTP struct {
	Hostname string `yaml:"hostname"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`

	CAFilepath   string        `yaml:"ca_file"`
	DialTimeout  time.Duration `yaml:"dial_timeout"`
	DisabledEPSV bool          `yaml:"disabled_epsv"`
}

func (*FTP) CAFile

func (cfg *FTP) CAFile() string

func (*FTP) DisableEPSV

func (cfg *FTP) DisableEPSV() bool

func (*FTP) String

func (cfg *FTP) String() string

func (*FTP) Timeout

func (cfg *FTP) Timeout() time.Duration

type Gateway

type Gateway struct {
	Origin          string `yaml:"origin"`
	OriginName      string `yaml:"origin_name"`
	Destination     string `yaml:"destination"`
	DestinationName string `yaml:"destination_name"`
}

type HTTP

type HTTP struct {
	BindAddress string `yaml:"bind_address"`
}

type InMemPipeline

type InMemPipeline struct {
	URL string `yaml:"url"`
}

type KafkaPipeline

type KafkaPipeline struct {
	Brokers []string `yaml:"brokers"`
	Group   string   `yaml:"group"`
	Topic   string   `yaml:"topic"`
}

type Local

type Local struct {
	Directory string `yaml:"directory"`
}

type Merging

type Merging struct {
	Directory string `yaml:"directory"`
}

type ODFI

type ODFI struct {
	// RoutingNumber is a valid ABA routing number
	RoutingNumber string `yaml:"routing_number"`

	// Gateway holds FileHeader information which the ODFI requires is set
	// on all files uploaded.
	Gateway Gateway `yaml:"gateway"`

	Cutoffs Cutoffs

	InboundPath  string `yaml:"inbound_path"`
	OutboundPath string `yaml:"outbound_path"`
	ReturnPath   string `yaml:"return_path"`

	// AllowedIPs is a comma separated list of IP addresses and CIDR ranges
	// where connections are allowed. If this value is non-empty remote servers
	// not within these ranges will not be connected to.
	AllowedIPs string `yaml:"allowed_ips"`

	OutboundFilenameTemplate string `yaml:"outbound_filename_template"`

	FTP  *FTP  `yaml:"ftp"`
	SFTP *SFTP `yaml:"sftp"`

	Storage *Storage `yaml:"storage"`
}

ODFI holds all the configuration for sending and retrieving ACH files with a financial institution to originate files.

func (*ODFI) FilenameTemplate

func (cfg *ODFI) FilenameTemplate() string

func (*ODFI) SplitAllowedIPs

func (cfg *ODFI) SplitAllowedIPs() []string

func (*ODFI) Validate

func (cfg *ODFI) Validate() error

type Pipeline

type Pipeline struct {
	Merging *Merging        `yaml:"merging"`
	Stream  *StreamPipeline `yaml:"stream"`
}

type SFTP

type SFTP struct {
	Hostname string `yaml:"hostname"`
	Username string `yaml:"username"`

	Password         string `yaml:"password"`
	ClientPrivateKey string `yaml:"clientPrivateKey"`

	HostPublicKey string `yaml:"hostPublicKey"`

	DialTimeout           time.Duration `yaml:"dial_timeout"`
	MaxConnectionsPerFile int           `yaml:"max_connections_per_file"`
	MaxPacketSize         int           `yaml:"max_packet_size"`
}

func (*SFTP) MaxConnections

func (cfg *SFTP) MaxConnections() int

func (*SFTP) PacketSize

func (cfg *SFTP) PacketSize() int

func (*SFTP) String

func (cfg *SFTP) String() string

func (*SFTP) Timeout

func (cfg *SFTP) Timeout() time.Duration

type Storage

type Storage struct {
	// CleanupLocalDirectory determines if we delete the local directory after
	// processing is finished. Leaving these files around helps debugging, but
	// also exposes customer information.
	CleanupLocalDirectory bool `yaml:"cleanup_local_directory"`

	// KeepRemoteFiles determines if we delete the remote file on an ODFI's server
	// after downloading and processing of each file.
	KeepRemoteFiles bool `yaml:"keep_remote_files"`

	Local *Local `json:"local"`
}

type StreamPipeline

type StreamPipeline struct {
	InMem *InMemPipeline `yaml:"inmem"`
	Kafka *KafkaPipeline `yaml:"kafka"`
}

type Symmetric

type Symmetric struct {
	KeyURI string `yaml:"keyURI"`
}

Jump to

Keyboard shortcuts

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