Documentation ¶
Index ¶
- Constants
- func BytesToUint32(bytes []byte) uint32
- func SearchResultsToJSONString(results engine.SearchResults) (string, error)
- type AbstractStruct
- type QueryStruct
- type Server
- func (s *Server) AcceptConnections() error
- func (s *Server) Address() string
- func (s *Server) GetAbstractStruct() *AbstractStruct
- func (s *Server) HandleRequest(connection net.Conn)
- func (s *Server) HandleResponse(response string, connection net.Conn)
- func (s *Server) InitializeDataDirectory() error
- func (s *Server) InitializeServer() error
- func (s *Server) ParseQuery(query []byte) (*QueryStruct, error)
- func (s *Server) Signature() string
- type ServerInterface
Constants ¶
View Source
const ( DataDirectory = "data" BaseIndexes = "indexes%s.json" BaseData = "data%s.json" BaseFile = "enwiki-latest-abstract%s.%s" BaseURL = "https://dumps.wikimedia.org/enwiki/latest/enwiki-latest-abstract%s.xml.gz" XMLExtension = "xml" GZExtension = "xml.gz" AbstractFilesCount = 28 )
View Source
const (
QUERY = byte(0)
)
Variables ¶
This section is empty.
Functions ¶
func BytesToUint32 ¶
func SearchResultsToJSONString ¶
func SearchResultsToJSONString(results engine.SearchResults) (string, error)
Types ¶
type AbstractStruct ¶
type QueryStruct ¶
type QueryStruct struct {
// contains filtered or unexported fields
}
type Server ¶
type Server struct { Host string Port string Network string Indexer *engine.Indexer QuitSignal bool Abstracts []*AbstractStruct FileIndex int CleanFlag bool }
func (*Server) AcceptConnections ¶
func (*Server) GetAbstractStruct ¶
func (s *Server) GetAbstractStruct() *AbstractStruct
func (*Server) HandleRequest ¶
func (*Server) HandleResponse ¶
func (*Server) InitializeDataDirectory ¶
func (*Server) InitializeServer ¶
func (*Server) ParseQuery ¶
func (s *Server) ParseQuery(query []byte) (*QueryStruct, error)
type ServerInterface ¶
type ServerInterface interface { Address() string Signature() string InitializeServer() error HandleRequest(connection net.Conn) HandleResponse(response string, connection net.Conn) ParseQuery(query []byte) (*QueryStruct, error) AcceptConnections() error GetAbstractStruct() *AbstractStruct InitializeDataDirectory() error }
Click to show internal directories.
Click to hide internal directories.