service

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AwaitTermination

func AwaitTermination(logger log.Logger, terminationListener chan error)

func NewTerminationListener

func NewTerminationListener() chan error

Types

type Action

type Action struct {
	Delay      *time.Duration // e.g. "12h" or "10s"
	Copy       *Copy
	Correction *Correction
	Return     *Return
}

func (Action) Context added in v0.8.0

func (a Action) Context() map[string]log.Valuer

func (*Action) Validate added in v0.8.0

func (a *Action) Validate() error

type Amount

type Amount struct {
	Value int
	Min   int
	Max   int
}

func (*Amount) Empty added in v0.5.0

func (a *Amount) Empty() bool

type BindAddress

type BindAddress struct {
	Address string
}

BindAddress specifies where the http server should bind to.

type Config

type Config struct {
	Servers      ServerConfig
	ValidateOpts *ach.ValidateOpts
	Matching     Matching
	Responses    []Response
}

Config defines all the configuration for the app

func LoadConfig

func LoadConfig(logger log.Logger) (*Config, error)

func (*Config) Validate added in v0.8.0

func (cfg *Config) Validate() error

type Copy added in v0.3.0

type Copy struct {
	Path string
}

type Correction

type Correction struct {
	Code string
	Data string
}

type EntryType added in v0.4.0

type EntryType string
const (
	EntryTypeEmpty   EntryType = ""
	EntryTypeDebit   EntryType = "debit"
	EntryTypeCredit  EntryType = "credit"
	EntryTypePrenote EntryType = "prenote"
)

type Environment

type Environment struct {
	Logger      log.Logger
	Config      *Config
	TimeService stime.TimeService
	Router      *mux.Router

	// ftp or sftp server
	FTPServer *ftp.Server
	Shutdown  func()
}

Environment - Contains everything thats been instantiated for this service.

func NewEnvironment

func NewEnvironment(env *Environment) (*Environment, error)

NewEnvironment - Generates a new default environment. Overrides can be specified via configs.

func (*Environment) RunServers

func (env *Environment) RunServers(terminationListener chan error) func()

RunServers - Boots up all the servers and awaits till they are stopped.

type FTPAuth

type FTPAuth struct {
	Username string
	Password string
}

type FTPConfig

type FTPConfig struct {
	RootPath     string
	Hostname     string
	Auth         FTPAuth
	Port         int
	PassivePorts string
	Paths        Paths
}

FTPConfig configuration for running an FTP server

type GlobalConfig

type GlobalConfig struct {
	ACHTestHarness Config
}

func (*GlobalConfig) Validate added in v0.8.0

func (gc *GlobalConfig) Validate() error

type HTTPConfig

type HTTPConfig struct {
	Bind BindAddress
}

HTTPConfig configuration for running an http server

type Match

type Match struct {
	AccountNumber  string
	Amount         *Amount
	EntryType      EntryType
	IndividualName string
	RoutingNumber  string
	TraceNumber    string
}

func (Match) Context added in v0.8.0

func (m Match) Context() map[string]log.Valuer

func (Match) Empty added in v0.5.0

func (m Match) Empty() bool

type Matching added in v0.2.2

type Matching struct {
	Debug bool
}

type Paths

type Paths struct {
	// Incoming Files
	Files string

	// Outgoing Files
	Return string
}

type Response

type Response struct {
	Match  Match
	Action Action
}

func (*Response) Validate added in v0.8.0

func (r *Response) Validate() error

type Return

type Return struct {
	Code string
}

func (Return) Validate

func (r Return) Validate() error

type ServerConfig

type ServerConfig struct {
	FTP   *FTPConfig
	Admin HTTPConfig
}

ServerConfig - Groups all the http configs for the servers and ports that get opened.

Jump to

Keyboard shortcuts

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