application

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrApplicationRun is the error of the run of the application.
	ErrApplicationRun = errors.New("application: run error")
)

Functions

This section is empty.

Types

type Application

type Application interface {
	// Run runs the application.
	Run() (err error)
}

Application is an interface of an application.

type ApplicationDefault

type ApplicationDefault struct {
	// contains filtered or unexported fields
}

ApplicationDefault is the default implementation of Application.

func NewApplicationDefault

func NewApplicationDefault(cfg *Config) (a *ApplicationDefault)

NewApplicationDefault creates a new application.

func (*ApplicationDefault) Run

func (a *ApplicationDefault) Run() (err error)

Run runs the application.

type CasesConfig

type CasesConfig struct {
	Reader struct {
		// cases file path
		FilePath string
		// batch size
		BatchSize int
	}
	Reporter struct {
		// excluded headers
		ExcludedHeaders []string
	}
}

type Config

type Config struct {
	// server
	Server ServerConfig
	// database
	Database *DatabaseConfig
	// Cases
	Cases CasesConfig
}

Config is the config of the application.

func NewConfigApplicationDefaultFromYAML

func NewConfigApplicationDefaultFromYAML(filePath string) (cfg *Config, err error)

ConfigApplicationDefault is the config of the default application.

type ConfigApplicationDefaultYAML

type ConfigApplicationDefaultYAML struct {
	// server config
	Server struct {
		// server address
		Address string `yaml:"address"`
	} `yaml:"server"`
	// database config
	Database struct {
		// database address
		Address string `yaml:"address"`
		// database user
		User string `yaml:"user"`
		// database password
		Password string `yaml:"password"`
		// database name
		Name string `yaml:"name"`
	} `yaml:"database"`
	// cases config
	Cases struct {
		Reader struct {
			FilePath  string `yaml:"file_path"`
			BatchSize int    `yaml:"batch_size"`
		} `yaml:"reader"`
		Reporter struct {
			ExcludedHeaders []string `yaml:"excluded_headers"`
		} `yaml:"reporter"`
	} `yaml:"cases"`
}

ConfigApplicationDefaultYAML is the config of the default application from yaml file.

type DatabaseConfig

type DatabaseConfig struct {
	// database address
	Address string
	// database user
	User string
	// database password
	Password string
	// database name
	Name string
}

type ServerConfig

type ServerConfig struct {
	// server address
	Address string
}

Config is the config of the application.

Jump to

Keyboard shortcuts

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