Newer
Older
sisyphe-go / struct.go
@Nacim Nacim on 9 Mar 2022 2 KB refactoring logging
package main

import "encoding/json"

type MetadataPDF struct {
	Author           string
	Creator          string
	CreationDate     string
	PDFFormatVersion string
}
type PDFInfo struct {
	pdfWordCount  int
	pdfPageTotal  int
	pdfWordByPage int
	pdfError      string
	pdfMetadata   MetadataPDF
}

type DoctypeXML struct {
	Name  string `json:"name"`
	Pubid string `json:"pubid"`
	Sysid string `json:"sysid"`
}

type ErrorXML struct {
	Message string `json:"message"`
	Line    string `json:"line"`
}

type XMLInfo struct {
	data             string
	isWellFormed     bool
	wellFormedErrors ErrorXML
	doctype          DoctypeXML
}

type XpathStructure struct {
	ContentType       string `json:"content-type"`
	PublicationYear   string `json:"publicationYear"`
	Doi               int    `json:"doi"`
	Pmid              string `json:"pmid"`
	Issn              string `json:"issn"`
	Eissn             string `json:"eissn"`
	Isbn              string `json:"isbn"`
	Eisbn             string `json:"eisbn"`
	HasAbstract       bool   `json:"hasAbstract"`
	Issue             int    `json:"issue"`
	Volume            int    `json:"volume"`
	PublisherId       string `json:"publisherId"`
	PublisherLoc      string `json:"publisherLoc"`
	HostTitle         string `json:"hostTitle"`
	Title             string `json:"title"`
	NbRefBibs         int    `json:"nbRefBibs"`
	NbElementInBody   int    `json:"nbElementInBody"`
	NbParagraphInBody int    `json:"nbParagraphInBody"`
	NbSectionInBody   int    `json:"nbSectionInBody"`
	CodeLanguage      string `json:"codeLanguage"`
	ArticleType       string `json:"article-type"`
	PubIdType         string `json:"pub-id-type"`
	ContribType       string `json:"contrib-type"`
	Rid               string `json:"rid"`
	Id                string `json:"id"`
	SubjGroupType     string `json:"subj-group-type"`
	Subject           string `json:"subject"`
}

type DetailledAnalysis struct {
	isValidAgainstDTD  bool
	validationDTDInfos string
	//	validationsErrors      []ErrorXML
	validationsErrors      string
	isValidAgainstSchema   bool
	validationSchemaErrors []string
	xpath                  json.RawMessage
}

type GeneralInfo struct {
	corpusName   string
	name         string
	startAt      int64
	extension    string
	path         string
	mimetype     string
	mimeEncoding string
	size         int64
}

type ConfigDetailledAnalyze struct {
	XML struct {
		ListDTD []string                         `json:"dtd"`
		ListXSD []string                         `json:"xsd"`
		XPATH   []MetadataConfigDetailledAnalyze `json:"metadata"`
	} `json:"xml"`
}

type MetadataConfigDetailledAnalyze struct {
	Name  string   `json:"name"`
	Type  string   `json:"type"`
	Regex string   `json:"regex"`
	Xpath []string `json:"xpath"`
}