Documentation ¶
Index ¶
- Constants
- func CheckAlertTable(db *sql.DB, alert string) time.Time
- func Close(db *sql.DB)
- func DeleteComment(db *sql.DB, comment Comment)
- func FormatIfNotEmpty(anullTime null.Time) string
- func InitDB(db *sql.DB)
- func InsertComuni(db *sql.DB, comuni []Comune)
- func InsertFornitori(db *sql.DB, fornitori []Fornitore)
- func IntValue(t null.Time) *int64
- func IsPresent(db *sql.DB, sqlSelect string) bool
- func OpenDB(dbName string) *sql.DB
- func SaveOrUpdateComment(db *sql.DB, comment Comment)
- func SaveOrUpdateLastUpdate(db *sql.DB, time int64)
- func SaveOrUpdateSubentro(db *sql.DB, comune Comune)
- func TimeStampOrNull(time null.Time) null.Int
- func UpdateAlertsTable(db *sql.DB, alert string)
- func UpdateAnomalieSchedeSoggettoDate(db *sql.DB, anomalie []Anomalie)
- func UpdateComuneCheckListDate(db *sql.DB, comuni []Comune)
- func UpdateComuneFornitore(db *sql.DB, codiceIstat string, fornitore int)
- type Alerting
- type Anomalie
- type AnomalieSearchFilter
- type Comment
- type Comune
- type ComuneFornitore
- type ComuneInfo
- type Exclusion
- type ExclusionType
- type Fornitore
- type Indirizzo
- type LastUpdate
- type Order
- type OrderType
- type Responsible
- type SearchFilter
- type Subentro
- type SubentroInfo
Constants ¶
View Source
const ( PROACTIVE = "ProactiveEmailAlert" REACTIVE = "ReactiveEmailAlert" )
internal conts
Variables ¶
This section is empty.
Functions ¶
func CheckAlertTable ¶
CheckAlertTable utility function to check for a specific alert type the last_date sent a bit like a NOSQL case squeezed int sqlite... :-/
func DeleteComment ¶
func FormatIfNotEmpty ¶
func FormatIfNotEmpty(anullTime null.Time) string
func InsertComuni ¶
func InsertFornitori ¶
func SaveOrUpdateComment ¶
func SaveOrUpdateLastUpdate ¶
func SaveOrUpdateSubentro ¶
func TimeStampOrNull ¶
func TimeStampOrNull(time null.Time) null.Int
func UpdateAlertsTable ¶
UpdateAlertsTable utility function to update the last_date of an executed process a bit like a NOSQL case squeezed int sqlite... :-/
Types ¶
type Alerting ¶
type Anomalie ¶
type Anomalie struct { Description string CodiceIstat string Name string Population int Code string Number int ClassAnomalia string TipoAnomalia string }
func SearchAnomalie ¶
func SearchAnomalie(db *sql.DB, searchFilter AnomalieSearchFilter) []Anomalie
type AnomalieSearchFilter ¶
type Comment ¶
func SearchComment ¶
to avoid to resend mails on reloads
type Comune ¶
type Comune struct { Id int CodiceIstat string Name string Region string // Non esistente in schede monitoraggio. Province string Population int PopulationAIRE int Postazioni null.Int Lat float64 Lon float64 Fornitore Fornitore Responsible Responsible `json:"-"` Indirizzo Indirizzo `json:"-"` Subentro Subentro DataSubentro null.Time DataAbilitazione null.Time DataPresubentro null.Time AbilitazionePrefettura null.Bool UtentiAbilitati null.Int DataConsegnaSm null.Time NumeroLettori null.Int IPProvenienza null.Bool EmailPec null.Bool SCConsegnate null.Int DataRitiroSm null.Time DataPrimoPresubentro null.Time DataCessazione null.Time TipoCessazione null.String ComuneConfluenza null.String }
A base structure for Comune including basic contact information
func NewComuneFromCSVRecord ¶
func SearchComuni ¶
func SearchComuni(db *sql.DB, searchFilter SearchFilter) []Comune
func (*Comune) AsCSVRecord ¶
func (*Comune) AsCSVRecordForNotify ¶
func (*Comune) AsDetailedCSVRecord ¶
func (*Comune) ToComuneInfo ¶
func (c *Comune) ToComuneInfo() ComuneInfo
Convert a Comune into ComuneInfo holding just the information needed in order to show at the frontend
type ComuneFornitore ¶
type ComuneInfo ¶
type ComuneInfo struct { CodiceIstat string Name string DataSubentro null.Time DataAbilitazione null.Time DataPresubentro null.Time PianificazioneIntervalloSubentro Subentro }
Holds just the basic information about a Comue
type Exclusion ¶
type Exclusion struct {
ExclusionType ExclusionType
}
type ExclusionType ¶
type ExclusionType int
const ( ExcludeWithoutFinalDate ExclusionType = iota ExcludeWithoutSubentro ExcludeAlreadyWithSubentro ExcludeInactive )
type LastUpdate ¶
type LastUpdate struct {
Timestamp int64 `json:"timestamp"`
}
func GetLastUpdate ¶
func GetLastUpdate(db *sql.DB) LastUpdate
type Responsible ¶
type SearchFilter ¶
type Subentro ¶
type Subentro struct { From null.Time To null.Time PreferredDate null.Time IP null.String }
func (*Subentro) HasValidDates ¶
HasValidDates one date is valid
type SubentroInfo ¶
type SubentroInfo struct { DateFinal null.Time Comuni null.Int Population null.Int }
func GetSubentroInfo ¶
func GetSubentroInfo(db *sql.DB, aDate null.Time) SubentroInfo
Click to show internal directories.
Click to hide internal directories.