Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrDbNoAccess = errors.New("database could not be accessed") ErrDbNotExist = errors.New("database does not exist") ErrDbNotOpen = errors.New("database could not be opened") ErrInitDbAlreadyExist = errors.New("database already exists - the initialization was not forced") )
var (
ErrDatabaseNotOpen = errors.New("database not open")
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Address string DbPath string DbVariant string DbMaxLimit int ErrWriter io.Writer OutWriter io.Writer Port string Indexes map[platform.Variant]IndexConfig }
Config instructs Idx how to download source file and where to put it.
type GameTDBAdapter ¶
type GameTDBAdapter struct {
// contains filtered or unexported fields
}
GameTDBAdapter transforms data from GameTDB source to be usable by Index and DB packages This is the gluing component which should be used for transforming data provided by GameTDB source to fit any other package required As a result parsing, indexing and persistence packages can be decoupled using interfaces and are not dependent on the shape of GameTDB source
func NewGameTDBAdapter ¶
func NewGameTDBAdapter(platformID string, provider gametdb.ModelProvider) GameTDBAdapter
NewGameTDBAdapter returns new instance of GameTDB adapter
func (GameTDBAdapter) GameSources ¶
func (adapt GameTDBAdapter) GameSources() []index.GameSource
GameSources returns all games adapted to the format indexer accepts
func (GameTDBAdapter) PlatformProvider ¶
func (adapt GameTDBAdapter) PlatformProvider() db.PlatformProvider
PlatformProvider returns all data adapted to the format database accepts
type IndexConfig ¶
type IndexConfig struct { IndexFilepath string IndexVariant string Name string DocType string SourceFilepath string ArchiveFilepath string SourceFilename string }
IndexConfig instructs how unziping, parsing and indexing should be performed
type InitializeDbConfig ¶
type InitializeDbConfig struct {
// contains filtered or unexported fields
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) InitializeDatabase ¶
func (s *Server) InitializeDatabase(cfg InitializeDbConfig) error
func (*Server) OpenDatabase ¶
OpenDatabase opens the database pointed to by application config.
func (*Server) PreparePlatform ¶
PreparePlatform unzips and parses source file, creates Index related to the platfrom and populates the database.