storage

package
v0.0.0-...-5f207f6 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine interface {
	Init() error
	AddPassport(series uint16, number uint32) (bool, error)
	CheckPassport(series uint16, number uint32) (bool, error)
	// ImportData  calls the engins standard import procedures if exists
	ImportData(fileName string) error
}

Engine represents interfaces of memory storage engine

type Storage

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

Storage - implementation storage of passport data

func (*Storage) CheckStorage

func (ms *Storage) CheckStorage(cfg *config.Configuration) (bool, error)

CheckStorage - self test memory storage. Usually after update procedure the function returns true if everythig is correct

func (*Storage) IsPassportInList

func (ms *Storage) IsPassportInList(series string, number string) (bool, error)

IsPassportInList - check is the passport number in the list

func (*Storage) StartStorage

func (ms *Storage) StartStorage(cfg *config.Configuration) error

StartStorage loads data from exising file if file doesnt exists then dowload it via UpdateStorage

func (*Storage) UpdateStorage

func (ms *Storage) UpdateStorage(cfg *config.Configuration) error

UpdateStorage implements regular update passport data with simple scheduling

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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