service

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DisableValidateAttrs = "disable_attrs"
	GenerateAttrs        = "generate_attrs"
	Format               = "format"
	JsonFormat           = "json"
	XmlFormat            = "xml"
)

Variables

This section is empty.

Functions

func AwaitTermination

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

func ConfigureHandlers

func ConfigureHandlers(r *mux.Router) error

configure handlers

func NewInternalClient

func NewInternalClient(logger log.Logger, config *ClientConfig, name string) *http.Client

func NewTerminationListener

func NewTerminationListener() chan error

Types

type BindAddress

type BindAddress struct {
	Address string
}

BindAddress specifies where the http server should bind to.

type ClientConfig

type ClientConfig struct {
	Timeout             time.Duration
	MaxIdleConns        int
	MaxIdleConnsPerHost int
	MaxConnsPerHost     int
}

type Config

type Config struct {
	Servers ServerConfig
	Clients *ClientConfig
}

Config defines all the configuration for the app

func LoadConfig

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

type Environment

type Environment struct {
	Logger         log.Logger
	Config         *Config
	TimeService    stime.TimeService
	DB             *sql.DB
	InternalClient *http.Client

	PublicRouter *mux.Router
	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 GlobalConfig

type GlobalConfig struct {
	Fincen Config
}

type HTTPConfig

type HTTPConfig struct {
	Bind BindAddress
}

HTTPConfig configuration for running an http server

type Response

type Response struct {
	Code    int
	Message string
	Format  string
	Report  *batch.EFilingBatchXML
}

type ServerConfig

type ServerConfig struct {
	Public *HTTPConfig
	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