model

package
v0.0.0-...-896db50 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const Charac_InsertStr = "\"parent_id\", \"order\", \"author_user_id\", \"ark_id\", \"pactols_id\", \"aat_id\", \"created_at\", \"updated_at\""
View Source
const Charac_InsertValuesStr = ":parent_id, :order, :author_user_id, :ark_id, :pactols_id, :aat_id, now(), now()"
View Source
const Charac_UpdateStr = "" /* 182-byte string literal not displayed */
View Source
const Charac_root_InsertStr = "\"admin_group_id\", \"cached_langs\""
View Source
const Charac_root_InsertValuesStr = ":admin_group_id, :cached_langs"
View Source
const Charac_root_UpdateStr = "\"admin_group_id\" = :admin_group_id, \"cached_langs\" = :cached_langs"
View Source
const Charac_tr_InsertStr = "\"name\", \"description\""
View Source
const Charac_tr_InsertValuesStr = ":name, :description"
View Source
const Charac_tr_UpdateStr = "\"name\" = :name, \"description\" = :description"
View Source
const Chronology_InsertStr = "\"parent_id\", \"start_date\", \"end_date\", \"color\", \"created_at\", \"updated_at\""
View Source
const Chronology_InsertValuesStr = ":parent_id, :start_date, :end_date, :color, now(), now()"
View Source
const Chronology_UpdateStr = "" /* 126-byte string literal not displayed */
View Source
const Chronology_root_InsertStr = "\"admin_group_id\", \"author_user_id\", \"credits\", \"active\", \"geom\", \"cached_langs\""
View Source
const Chronology_root_InsertValuesStr = ":admin_group_id, :author_user_id, :credits, :active, :geom, :cached_langs"
View Source
const Chronology_root_UpdateStr = "" /* 172-byte string literal not displayed */
View Source
const Chronology_tr_InsertStr = "\"name\", \"description\""
View Source
const Chronology_tr_InsertValuesStr = ":name, :description"
View Source
const Chronology_tr_UpdateStr = "\"name\" = :name, \"description\" = :description"
View Source
const City_InsertStr = "\"country_geonameid\", \"geom\", \"geom_centroid\", \"created_at\", \"updated_at\""
View Source
const City_InsertValuesStr = ":country_geonameid, :geom, :geom_centroid, now(), now()"
View Source
const City_UpdateStr = "\"country_geonameid\" = :country_geonameid, \"geom\" = :geom, \"geom_centroid\" = :geom_centroid, \"updated_at\" = now()"
View Source
const City_tr_InsertStr = "\"name\", \"name_ascii\""
View Source
const City_tr_InsertValuesStr = ":name, :name_ascii"
View Source
const City_tr_UpdateStr = "\"name\" = :name, \"name_ascii\" = :name_ascii"
View Source
const Company_InsertStr = "\"name\", \"city_geonameid\""
View Source
const Company_InsertValuesStr = ":name, :city_geonameid"
View Source
const Company_UpdateStr = "\"name\" = :name, \"city_geonameid\" = :city_geonameid"
View Source
const Continent_InsertStr = "\"iso_code\", \"geom\", \"created_at\", \"updated_at\""
View Source
const Continent_InsertValuesStr = ":iso_code, :geom, now(), now()"
View Source
const Continent_UpdateStr = "\"iso_code\" = :iso_code, \"geom\" = :geom, \"updated_at\" = now()"
View Source
const Continent_tr_InsertStr = "\"name\", \"name_ascii\""
View Source
const Continent_tr_InsertValuesStr = ":name, :name_ascii"
View Source
const Continent_tr_UpdateStr = "\"name\" = :name, \"name_ascii\" = :name_ascii"
View Source
const Country_InsertStr = "\"iso_code\", \"geom\", \"created_at\", \"updated_at\""
View Source
const Country_InsertValuesStr = ":iso_code, :geom, now(), now()"
View Source
const Country_UpdateStr = "\"iso_code\" = :iso_code, \"geom\" = :geom, \"updated_at\" = now()"
View Source
const Country_tr_InsertStr = "\"name\", \"name_ascii\""
View Source
const Country_tr_InsertValuesStr = ":name, :name_ascii"
View Source
const Country_tr_UpdateStr = "\"name\" = :name, \"name_ascii\" = :name_ascii"
View Source
const Database_InsertStr = "" /* 335-byte string literal not displayed */
View Source
const Database_InsertValuesStr = "" /* 263-byte string literal not displayed */
View Source
const Database_UpdateStr = "" /* 596-byte string literal not displayed */
View Source
const Database__authors_InsertStr = ""
View Source
const Database__authors_InsertValuesStr = ""
View Source
const Database__authors_UpdateStr = ""
View Source
const Database__continent_InsertStr = ""
View Source
const Database__continent_InsertValuesStr = ""
View Source
const Database__continent_UpdateStr = ""
View Source
const Database__country_InsertStr = ""
View Source
const Database__country_InsertValuesStr = ""
View Source
const Database__country_UpdateStr = ""
View Source
const Database_context_InsertStr = "\"database_id\", \"context\""
View Source
const Database_context_InsertValuesStr = ":database_id, :context"
View Source
const Database_context_UpdateStr = "\"database_id\" = :database_id, \"context\" = :context"
View Source
const Database_handle_InsertStr = "\"database_id\", \"import_id\", \"identifier\", \"url\", \"declared_creation_date\", \"created_at\""
View Source
const Database_handle_InsertValuesStr = ":database_id, :import_id, :identifier, :url, :declared_creation_date, now()"
View Source
const Database_handle_UpdateStr = "" /* 158-byte string literal not displayed */
View Source
const Database_tr_InsertStr = "" /* 167-byte string literal not displayed */
View Source
const Database_tr_InsertValuesStr = "" /* 140-byte string literal not displayed */
View Source
const Database_tr_UpdateStr = "" /* 318-byte string literal not displayed */
View Source
const Group_InsertStr = "\"type\", \"created_at\", \"updated_at\""
View Source
const Group_InsertValuesStr = ":type, now(), now()"
View Source
const Group_UpdateStr = "\"type\" = :type, \"updated_at\" = now()"
View Source
const Group__permission_InsertStr = "\"created_at\", \"updated_at\""
View Source
const Group__permission_InsertValuesStr = "now(), now()"
View Source
const Group__permission_UpdateStr = "\"updated_at\" = now()"
View Source
const Group_tr_InsertStr = "\"name\", \"description\""
View Source
const Group_tr_InsertValuesStr = ":name, :description"
View Source
const Group_tr_UpdateStr = "\"name\" = :name, \"description\" = :description"
View Source
const Import_InsertStr = "\"database_id\", \"user_id\", \"md5sum\", \"filename\", \"number_of_lines\", \"number_of_sites\", \"created_at\""
View Source
const Import_InsertValuesStr = ":database_id, :user_id, :md5sum, :filename, :number_of_lines, :number_of_sites, now()"
View Source
const Import_UpdateStr = "" /* 182-byte string literal not displayed */
View Source
const Lang_InsertStr = "\"active\""
View Source
const Lang_InsertValuesStr = ":active"
View Source
const Lang_UpdateStr = "\"active\" = :active"
View Source
const Lang_tr_InsertStr = "\"name\""
View Source
const Lang_tr_InsertValuesStr = ":name"
View Source
const Lang_tr_UpdateStr = "\"name\" = :name"
View Source
const License_InsertStr = "\"name\", \"url\""
View Source
const License_InsertValuesStr = ":name, :url"
View Source
const License_UpdateStr = "\"name\" = :name, \"url\" = :url"
View Source
const Map_layer_InsertStr = "" /* 318-byte string literal not displayed */
View Source
const Map_layer_InsertValuesStr = "" /* 249-byte string literal not displayed */
View Source
const Map_layer_UpdateStr = "" /* 564-byte string literal not displayed */
View Source
const Map_layer__authors_InsertStr = ""
View Source
const Map_layer__authors_InsertValuesStr = ""
View Source
const Map_layer__authors_UpdateStr = ""
View Source
const Map_layer_tr_InsertStr = "\"name\", \"attribution\", \"copyright\", \"description\""
View Source
const Map_layer_tr_InsertValuesStr = ":name, :attribution, :copyright, :description"
View Source
const Map_layer_tr_UpdateStr = "\"name\" = :name, \"attribution\" = :attribution, \"copyright\" = :copyright, \"description\" = :description"
View Source
const Permission_InsertStr = "\"name\", \"created_at\", \"updated_at\""
View Source
const Permission_InsertValuesStr = ":name, now(), now()"
View Source
const Permission_UpdateStr = "\"name\" = :name, \"updated_at\" = now()"
View Source
const Permission_tr_InsertStr = "\"name\", \"description\""
View Source
const Permission_tr_InsertValuesStr = ":name, :description"
View Source
const Permission_tr_UpdateStr = "\"name\" = :name, \"description\" = :description"
View Source
const Photo_InsertStr = "\"photo\""
View Source
const Photo_InsertValuesStr = ":photo"
View Source
const Photo_UpdateStr = "\"photo\" = :photo"
View Source
const Project_InsertStr = "\"name\", \"user_id\", \"created_at\", \"updated_at\", \"start_date\", \"end_date\", \"geom\""
View Source
const Project_InsertValuesStr = ":name, :user_id, now(), now(), :start_date, :end_date, :geom"
View Source
const Project_UpdateStr = "" /* 138-byte string literal not displayed */
View Source
const Project__charac_InsertStr = ""
View Source
const Project__charac_InsertValuesStr = ""
View Source
const Project__charac_UpdateStr = ""
View Source
const Project__chronology_InsertStr = ""
View Source
const Project__chronology_InsertValuesStr = ""
View Source
const Project__chronology_UpdateStr = ""
View Source
const Project__database_InsertStr = ""
View Source
const Project__database_InsertValuesStr = ""
View Source
const Project__database_UpdateStr = ""
View Source
const Project__map_layer_InsertStr = ""
View Source
const Project__map_layer_InsertValuesStr = ""
View Source
const Project__map_layer_UpdateStr = ""
View Source
const Project__shapefile_InsertStr = ""
View Source
const Project__shapefile_InsertValuesStr = ""
View Source
const Project__shapefile_UpdateStr = ""
View Source
const Project_hidden_characs_InsertStr = ""
View Source
const Project_hidden_characs_InsertValuesStr = ""
View Source
const Project_hidden_characs_UpdateStr = ""
View Source
const Saved_query_InsertStr = "\"params\""
View Source
const Saved_query_InsertValuesStr = ":params"
View Source
const Saved_query_UpdateStr = "\"params\" = :params"
View Source
const Session_InsertStr = "\"value\""
View Source
const Session_InsertValuesStr = ":value"
View Source
const Session_UpdateStr = "\"value\" = :value"
View Source
const Shapefile_InsertStr = "" /* 245-byte string literal not displayed */
View Source
const Shapefile_InsertValuesStr = "" /* 191-byte string literal not displayed */
View Source
const Shapefile_UpdateStr = "" /* 428-byte string literal not displayed */
View Source
const Shapefile__authors_InsertStr = ""
View Source
const Shapefile__authors_InsertValuesStr = ""
View Source
const Shapefile__authors_UpdateStr = ""
View Source
const Shapefile_tr_InsertStr = "\"name\", \"attribution\", \"copyright\", \"description\""
View Source
const Shapefile_tr_InsertValuesStr = ":name, :attribution, :copyright, :description"
View Source
const Shapefile_tr_UpdateStr = "\"name\" = :name, \"attribution\" = :attribution, \"copyright\" = :copyright, \"description\" = :description"
View Source
const Site_InsertStr = "" /* 233-byte string literal not displayed */
View Source
const Site_InsertValuesStr = "" /* 173-byte string literal not displayed */
View Source
const Site_UpdateStr = "" /* 400-byte string literal not displayed */
View Source
const Site_range_InsertStr = "\"site_id\", \"start_date1\", \"start_date2\", \"end_date1\", \"end_date2\", \"created_at\", \"updated_at\""
View Source
const Site_range_InsertValuesStr = ":site_id, :start_date1, :start_date2, :end_date1, :end_date2, now(), now()"
View Source
const Site_range_UpdateStr = "" /* 166-byte string literal not displayed */
View Source
const Site_range__charac_InsertStr = "\"site_range_id\", \"charac_id\", \"exceptional\", \"knowledge_type\""
View Source
const Site_range__charac_InsertValuesStr = ":site_range_id, :charac_id, :exceptional, :knowledge_type"
View Source
const Site_range__charac_UpdateStr = "" /* 132-byte string literal not displayed */
View Source
const Site_range__charac_tr_InsertStr = "\"comment\", \"bibliography\""
View Source
const Site_range__charac_tr_InsertValuesStr = ":comment, :bibliography"
View Source
const Site_range__charac_tr_UpdateStr = "\"comment\" = :comment, \"bibliography\" = :bibliography"
View Source
const Site_tr_InsertStr = "\"description\""
View Source
const Site_tr_InsertValuesStr = ":description"
View Source
const Site_tr_UpdateStr = "\"description\" = :description"
View Source
const User_InsertStr = "" /* 210-byte string literal not displayed */
View Source
const User_InsertValuesStr = "" /* 159-byte string literal not displayed */
View Source
const User_UpdateStr = "" /* 360-byte string literal not displayed */
View Source
const User__company_InsertStr = ""
View Source
const User__company_InsertValuesStr = ""
View Source
const User__company_UpdateStr = ""
View Source
const User__group_InsertStr = ""
View Source
const User__group_InsertValuesStr = ""
View Source
const User__group_UpdateStr = ""
View Source
const User_preferences_InsertStr = "\"value\""
View Source
const User_preferences_InsertValuesStr = ":value"
View Source
const User_preferences_UpdateStr = "\"value\" = :value"

Variables

This section is empty.

Functions

func GetAllCharacPathIDsFromLangIsocode

func GetAllCharacPathIDsFromLangIsocode(langIsocode string) (caracs map[int]string, err error)

func GetAllCharacsRootFromLangIsocode

func GetAllCharacsRootFromLangIsocode(langIsocode string) (caracsRoot map[string]int, err error)

func GetCharacPathsFromLang

func GetCharacPathsFromLang(name string, lang string) (caracs map[string]int, err error)

func GetCharacPathsFromLangID

func GetCharacPathsFromLangID(name string, langIsocode string) (caracs map[string]int, err error)

func GetQueryTranslationsAsJSON

func GetQueryTranslationsAsJSON(tableName, where, wrapTo string, fields ...string) string

GetQueryTranslationsAsJSON load translations from database

func GetQueryTranslationsAsJSONObject

func GetQueryTranslationsAsJSONObject(tableName, where string, wrapTo string, noBrace bool, fields ...string) string

GetQueryTranslationsAsJSONObject load translations from database

func IntJoin

func IntJoin(a []int, hackempty bool) string

IntJoin Return a joined string of an int array (usefull for IN sql operator) Exemple: [ 1, 3, 12 ] become: "1,3,12" if hackemtpy is set to true, "-1" will be returned for an empty array

func MapSqlTranslations

func MapSqlTranslations(src interface{}, isofieldname string, valuefieldname string) map[string]string

MapSqlTranslations return a mapped isocode:translation of a [{ isocode: translation }] array from sql

Types

type Charac

type Charac struct {
	Id             int       `db:"id" json:"id" xmltopsql:"ondelete:cascade"`
	Parent_id      int       `db:"parent_id" json:"parent_id" xmltopsql:"ondelete:cascade"` // Charac.Id
	Order          int       `db:"order" json:"order"`
	Author_user_id int       `db:"author_user_id" json:"author_user_id"` // User.Id
	Ark_id         string    `db:"ark_id" json:"ark_id"`
	Pactols_id     string    `db:"pactols_id" json:"pactols_id"`
	Aat_id         string    `db:"aat_id" json:"aat_id"`
	Created_at     time.Time `db:"created_at" json:"created_at"`
	Updated_at     time.Time `db:"updated_at" json:"updated_at"`
}

func (*Charac) Childs

func (u *Charac) Childs(tx *sqlx.Tx) (answer []Charac, err error)

Childs return Charac childs

func (*Charac) Create

func (u *Charac) Create(tx *sqlx.Tx) (err error)

Create the charac by inserting it in the database

func (*Charac) Delete

func (u *Charac) Delete(tx *sqlx.Tx) (err error)

Delete the charac from the database

func (*Charac) Get

func (u *Charac) Get(tx *sqlx.Tx) (err error)

Get the charac from the database

func (*Charac) Update

func (u *Charac) Update(tx *sqlx.Tx) (err error)

Update the charac in the database

type Charac_root

type Charac_root struct {
	Root_charac_id int    `db:"root_charac_id" json:"root_charac_id" xmltopsql:"ondelete:cascade"` // Charac.Id
	Admin_group_id int    `db:"admin_group_id" json:"admin_group_id"`                              // Group.Id
	Cached_langs   string `db:"cached_langs" json:"cached_langs"`
}

func (*Charac_root) Create

func (u *Charac_root) Create(tx *sqlx.Tx) (err error)

Create the charac_root by inserting it in the database

func (*Charac_root) Delete

func (u *Charac_root) Delete(tx *sqlx.Tx) (err error)

Delete the charac_root from the database

func (*Charac_root) Get

func (u *Charac_root) Get(tx *sqlx.Tx) (err error)

Get the charac_root from the database

func (*Charac_root) Update

func (u *Charac_root) Update(tx *sqlx.Tx) (err error)

Update the charac_root in the database

type Charac_tr

type Charac_tr struct {
	Lang_isocode string `db:"lang_isocode" json:"lang_isocode"`                        // Lang.Isocode
	Charac_id    int    `db:"charac_id" json:"charac_id" xmltopsql:"ondelete:cascade"` // Charac.Id
	Name         string `db:"name" json:"name"`
	Description  string `db:"description" json:"description"`
}

func (*Charac_tr) Create

func (u *Charac_tr) Create(tx *sqlx.Tx) error

Create the charac_tr by inserting it in the database

func (*Charac_tr) Delete

func (u *Charac_tr) Delete(tx *sqlx.Tx) error

Delete the charac_tr from the database

func (*Charac_tr) Get

func (u *Charac_tr) Get(tx *sqlx.Tx) error

Get the charac_tr from the database

func (*Charac_tr) Update

func (u *Charac_tr) Update(tx *sqlx.Tx) error

Update the charac_tr in the database

type Chronology

type Chronology struct {
	Id         int       `db:"id" json:"id" xmltopsql:"ondelete:cascade"`
	Parent_id  int       `db:"parent_id" json:"parent_id" xmltopsql:"ondelete:cascade"` // Chronology.Id
	Start_date int       `db:"start_date" json:"start_date"`
	End_date   int       `db:"end_date" json:"end_date"`
	Color      string    `db:"color" json:"color"`
	Created_at time.Time `db:"created_at" json:"created_at"`
	Updated_at time.Time `db:"updated_at" json:"updated_at"`
}

func (*Chronology) Childs

func (u *Chronology) Childs(tx *sqlx.Tx) ([]Chronology, error)

Childs return Chronology childs

func (*Chronology) Create

func (u *Chronology) Create(tx *sqlx.Tx) error

Create the chronology by inserting it in the database

func (*Chronology) Delete

func (u *Chronology) Delete(tx *sqlx.Tx) error

Delete the chronology from the database

func (*Chronology) Get

func (u *Chronology) Get(tx *sqlx.Tx) error

Get the chronology from the database

func (*Chronology) Update

func (u *Chronology) Update(tx *sqlx.Tx) error

Update the chronology in the database

type Chronology_root

type Chronology_root struct {
	Root_chronology_id int    `db:"root_chronology_id" json:"root_chronology_id" xmltopsql:"ondelete:cascade"` // Chronology.Id
	Admin_group_id     int    `db:"admin_group_id" json:"admin_group_id"`                                      // Group.Id
	Author_user_id     int    `db:"author_user_id" json:"author_user_id"`                                      // User.Id
	Credits            string `db:"credits" json:"credits"`
	Active             bool   `db:"active" json:"active"`
	Geom               string `db:"geom" json:"geom"`
	Cached_langs       string `db:"cached_langs" json:"cached_langs"`
}

func (*Chronology_root) Create

func (u *Chronology_root) Create(tx *sqlx.Tx) error

Create the chronology_root by inserting it in the database

func (*Chronology_root) Delete

func (u *Chronology_root) Delete(tx *sqlx.Tx) error

Delete the chronology_root from the database

func (*Chronology_root) Get

func (u *Chronology_root) Get(tx *sqlx.Tx) error

Get the chronology_root from the database

func (*Chronology_root) Update

func (u *Chronology_root) Update(tx *sqlx.Tx) error

Update the chronology_root in the database

type Chronology_tr

type Chronology_tr struct {
	Lang_isocode  string `db:"lang_isocode" json:"lang_isocode"`                                // Lang.Isocode
	Chronology_id int    `db:"chronology_id" json:"chronology_id" xmltopsql:"ondelete:cascade"` // Chronology.Id
	Name          string `db:"name" json:"name" xmltopsql:"ondelete:cascade"`
	Description   string `db:"description" json:"description"`
}

func (*Chronology_tr) Create

func (u *Chronology_tr) Create(tx *sqlx.Tx) error

Create the chronology_tr by inserting it in the database

func (*Chronology_tr) Delete

func (u *Chronology_tr) Delete(tx *sqlx.Tx) error

Delete the chronology_tr from the database

func (*Chronology_tr) Get

func (u *Chronology_tr) Get(tx *sqlx.Tx) error

Get the chronology_tr from the database

func (*Chronology_tr) Update

func (u *Chronology_tr) Update(tx *sqlx.Tx) error

Update the chronology_tr in the database

type City

type City struct {
	Geonameid         int            `db:"geonameid" json:"geonameid"`
	Country_geonameid int            `db:"country_geonameid" json:"country_geonameid"` // Country.Geonameid
	Geom              sql.NullString `db:"geom" json:"geom"`
	Geom_centroid     string         `db:"geom_centroid" json:"geom_centroid"`
	Created_at        time.Time      `db:"created_at" json:"created_at"`
	Updated_at        time.Time      `db:"updated_at" json:"updated_at"`
}

func (*City) Create

func (u *City) Create(tx *sqlx.Tx) error

Create the city by inserting it in the database

func (*City) Delete

func (u *City) Delete(tx *sqlx.Tx) error

Delete the city from the database

func (*City) Get

func (u *City) Get(tx *sqlx.Tx) error

Get the city from the database

func (*City) Update

func (u *City) Update(tx *sqlx.Tx) error

Update the city in the database

type CityAndCountry_wtr

type CityAndCountry_wtr struct {
	City    City_wtr    `json:"city"`
	Country Country_wtr `json:"country"`
}

func (*CityAndCountry_wtr) Get

func (u *CityAndCountry_wtr) Get(tx *sqlx.Tx, cityId int) error

type City_tr

type City_tr struct {
	City_geonameid int    `db:"city_geonameid" json:"city_geonameid"` // City.Geonameid
	Lang_isocode   string `db:"lang_isocode" json:"lang_isocode"`     // Lang.Isocode
	Name           string `db:"name" json:"name"`
	Name_ascii     string `db:"name_ascii" json:"name_ascii"`
}

type City_wtr

type City_wtr struct {
	City
	Tr map[string]string `json:"tr"`
}

func (*City_wtr) Get

func (u *City_wtr) Get(tx *sqlx.Tx) error

Get the city from the database

type Company

type Company struct {
	Id             int    `db:"id" json:"id"`
	Name           string `db:"name" json:"name"`
	City_geonameid int    `db:"city_geonameid" json:"city_geonameid"` // City.Geonameid
}

func (*Company) Create

func (u *Company) Create(tx *sqlx.Tx) error

Create the company by inserting it in the database

func (*Company) Delete

func (u *Company) Delete(tx *sqlx.Tx) error

Delete the company from the database

func (*Company) Get

func (u *Company) Get(tx *sqlx.Tx) error

Get the company from the database

func (*Company) Update

func (u *Company) Update(tx *sqlx.Tx) error

Update the company in the database

type Continent

type Continent struct {
	Geonameid  int            `db:"geonameid" json:"geonameid"`
	Iso_code   string         `db:"iso_code" json:"iso_code"`
	Geom       sql.NullString `db:"geom" json:"geom"`
	Created_at time.Time      `db:"created_at" json:"created_at"`
	Updated_at time.Time      `db:"updated_at" json:"updated_at"`
}

type ContinentInfos

type ContinentInfos struct {
	Continent
	Continent_tr
	Continent_geonameid int            `json:"-"`
	Lang_isocode        string         `json:"-"`
	Created_at          time.Time      `json:"-"`
	Updated_at          time.Time      `json:"-"`
	Geom                sql.NullString `json:"-"`
}

ContinentInfos store country info and translations

type Continent_tr

type Continent_tr struct {
	Continent_geonameid int            `db:"continent_geonameid" json:"continent_geonameid"`
	Lang_isocode        sql.NullString `db:"lang_isocode" json:"lang_isocode"` // Lang.Isocode
	Name                string         `db:"name" json:"name"`
	Name_ascii          string         `db:"name_ascii" json:"name_ascii"`
}

type Country

type Country struct {
	Geonameid  int            `db:"geonameid" json:"geonameid"`
	Iso_code   sql.NullString `db:"iso_code" json:"iso_code"`
	Geom       sql.NullString `db:"geom" json:"geom"`
	Created_at time.Time      `db:"created_at" json:"created_at"`
	Updated_at time.Time      `db:"updated_at" json:"updated_at"`
}

func (*Country) Create

func (u *Country) Create(tx *sqlx.Tx) error

Create the country by inserting it in the database

func (*Country) Delete

func (u *Country) Delete(tx *sqlx.Tx) error

Delete the country from the database

func (*Country) Get

func (u *Country) Get(tx *sqlx.Tx) error

Get the country from the database

func (*Country) Update

func (u *Country) Update(tx *sqlx.Tx) error

Update the country in the database

type CountryInfos

type CountryInfos struct {
	Country
	Country_tr
	Country_geonameid int            `json:"-"`
	Lang_isocode      string         `json:"-"`
	Created_at        time.Time      `json:"-"`
	Updated_at        time.Time      `json:"-"`
	Geom              sql.NullString `json:"-"`
}

CountryInfos store country info and translations

type Country_tr

type Country_tr struct {
	Country_geonameid int    `db:"country_geonameid" json:"country_geonameid"` // Country.Geonameid
	Lang_isocode      string `db:"lang_isocode" json:"lang_isocode"`           // Lang.Isocode
	Name              string `db:"name" json:"name"`
	Name_ascii        string `db:"name_ascii" json:"name_ascii"`
}

type Country_wtr

type Country_wtr struct {
	Country
	Tr map[string]string `json:"tr"`
}

func (*Country_wtr) Get

func (u *Country_wtr) Get(tx *sqlx.Tx) error

Get the country from the database

type Database

type Database struct {
	Id                       int       `db:"id" json:"id"`
	Name                     string    `db:"name" json:"name" min:"1" max:"255" error:"DATABASE.FIELD_NAME.T_CHECK_MANDATORY"`
	Scale_resolution         string    `` /* 186-byte string literal not displayed */
	Geographical_extent      string    `` /* 174-byte string literal not displayed */
	Type                     string    `db:"type" json:"type" enum:"undefined,inventory,research,literary-work" error:"DATABASE.FIELD_TYPE.T_CHECK_INCORRECT"`
	Owner                    int       `db:"owner" json:"owner"` // User.Id
	Editor                   string    `db:"editor" json:"editor"`
	Editor_url               string    `db:"editor_url" json:"editor_url"`
	Contributor              string    `db:"contributor" json:"contributor"`
	Default_language         string    `db:"default_language" json:"default_language"` // Lang.Isocode
	State                    string    `db:"state" json:"state" enum:"undefined,in-progress,finished" error:"DATABASE.FIELD_STATE.T_CHECK_INCORRECT"`
	License_id               int       `db:"license_id" json:"license_id"` // License.Id
	Published                bool      `db:"published" json:"published"`
	Soft_deleted             bool      `db:"soft_deleted" json:"soft_deleted"`
	Geographical_extent_geom string    `db:"geographical_extent_geom" json:"geographical_extent_geom"`
	Start_date               int       `db:"start_date" json:"start_date"`
	End_date                 int       `db:"end_date" json:"end_date"`
	Declared_creation_date   time.Time `db:"declared_creation_date" json:"declared_creation_date"`
	Public                   bool      `db:"public" json:"public"`
	Created_at               time.Time `db:"created_at" json:"created_at"`
	Updated_at               time.Time `db:"updated_at" json:"updated_at"`
}

func (*Database) AddContinents

func (d *Database) AddContinents(tx *sqlx.Tx, continentIds []int) (err error)

AddContinents links continents to a database

func (*Database) AddCountries

func (d *Database) AddCountries(tx *sqlx.Tx, countryIds []int) (err error)

AddCountries links countries to a database

func (*Database) AddHandle

func (d *Database) AddHandle(tx *sqlx.Tx, handle *Database_handle) (id int, err error)

AddHandle links a handle to a database

func (*Database) AnotherExistsWithSameName

func (d *Database) AnotherExistsWithSameName(tx *sqlx.Tx) (exists bool, err error)

AnotherExistsWithSameName checks if database already exists with same name and owned by another user

func (*Database) CacheDates

func (d *Database) CacheDates(tx *sqlx.Tx) (err error)

CacheDates get database sites extend and cache enveloppe

func (*Database) CacheGeom

func (d *Database) CacheGeom(tx *sqlx.Tx) (err error)

CacheGeom get database sites extend and cache enveloppe

func (*Database) Create

func (d *Database) Create(tx *sqlx.Tx) (err error)

Create insert the database into arkeogis db

func (*Database) Delete

func (d *Database) Delete(tx *sqlx.Tx) (err error)

Delete database and all infos associated

func (*Database) DeleteAuthors

func (d *Database) DeleteAuthors(tx *sqlx.Tx) (err error)

DeleteAuthors deletes the author linked to a database

func (*Database) DeleteContexts

func (d *Database) DeleteContexts(tx *sqlx.Tx) error

DeleteContexts deletes the context linked to a database

func (*Database) DeleteContinents

func (d *Database) DeleteContinents(tx *sqlx.Tx) (err error)

DeleteContinents unlinks countries to a database

func (*Database) DeleteCountries

func (d *Database) DeleteCountries(tx *sqlx.Tx) (err error)

DeleteCountries unlinks countries to a database

func (*Database) DeleteHandles

func (d *Database) DeleteHandles(tx *sqlx.Tx) error

func (*Database) DeleteImports

func (d *Database) DeleteImports(tx *sqlx.Tx) error

DeleteImports unlinks database import logs

func (*Database) DeleteSites

func (d *Database) DeleteSites(tx *sqlx.Tx) (err error)

DeleteSites deletes all sites linked to a database

func (*Database) DeleteSpecificHandle

func (d *Database) DeleteSpecificHandle(tx *sqlx.Tx, id int) error

DeleteHandles unlinks handles

func (*Database) DoesExist

func (d *Database) DoesExist(tx *sqlx.Tx) (exists bool, err error)

DoesExist check if database exist with a name and an owner

func (*Database) Get

func (d *Database) Get(tx *sqlx.Tx) (err error)

Get retrieves informations about a database stored in the main table

func (*Database) GetAuthorsList

func (d *Database) GetAuthorsList(tx *sqlx.Tx) (authors []DatabaseAuthor, err error)

GetAuthorsList lists all user designed as author of a database

func (*Database) GetContextsList

func (d *Database) GetContextsList(tx *sqlx.Tx) (contexts []Database_context, err error)

GetContextsList lists all user designed as context of a database

func (*Database) GetContinentList

func (d *Database) GetContinentList(tx *sqlx.Tx, langIsocode string) (continents []ContinentInfos, err error)

GetContinentList lists all continents linked to a database

func (*Database) GetCountryList

func (d *Database) GetCountryList(tx *sqlx.Tx, langIsocode string) ([]CountryInfos, error)

GetCountryList lists all countries linked to a database

func (*Database) GetFullInfos

func (d *Database) GetFullInfos(tx *sqlx.Tx, langIsocode string) (db DatabaseFullInfos, err error)

GetFullInfos returns all informations about a database

func (*Database) GetHandles

func (d *Database) GetHandles(tx *sqlx.Tx) (handles []Database_handle, err error)

GetHandles lists all handles linked to a database

func (*Database) GetImportList

func (d *Database) GetImportList(tx *sqlx.Tx) (imports []ImportFullInfos, err error)

GetImportList lists all informations about an import (date, filename, etc)

func (*Database) GetLastHandle

func (d *Database) GetLastHandle(tx *sqlx.Tx) (handle *Database_handle, err error)

GetHandles get last handle linked to a database

func (*Database) GetLastImport

func (d *Database) GetLastImport(tx *sqlx.Tx) (imp Import, err error)

GetLastImport lists last import informations

func (*Database) GetOwnerInfos

func (d *Database) GetOwnerInfos(tx *sqlx.Tx) (owner DatabaseAuthor, err error)

GetOwnerInfos get all informations about the owner of the database

func (*Database) IsLinkedToProject

func (d *Database) IsLinkedToProject(tx *sqlx.Tx, project_ID int) (linked bool, err error)

IsLinkedToProject returns true or false if database is linked or not to user project

func (*Database) LinkToUserProject

func (d *Database) LinkToUserProject(tx *sqlx.Tx, project_ID int) (err error)

LinkToUserProject links database to project

func (*Database) SetAuthors

func (d *Database) SetAuthors(tx *sqlx.Tx, authors []int) (err error)

SetAuthors links users as authors to a database

func (*Database) SetContexts

func (d *Database) SetContexts(tx *sqlx.Tx, contexts []string) error

SetContexts links users as contexts to a database

func (*Database) SetTranslations

func (d *Database) SetTranslations(tx *sqlx.Tx, field string, translations []struct {
	Lang_Isocode string
	Text         string
}) (err error)

func (*Database) Update

func (d *Database) Update(tx *sqlx.Tx) (err error)

Update database informations

func (*Database) UpdateFields

func (d *Database) UpdateFields(tx *sqlx.Tx, params interface{}, fields ...string) (err error)

UpdateFields updates "database" fields (crazy isn't it ?)

func (*Database) UpdateHandle

func (d *Database) UpdateHandle(tx *sqlx.Tx, handle *Database_handle) (err error)

UpdateHandle links continents to a database

type DatabaseAuthor

type DatabaseAuthor struct {
	Id        string `json:"id"`
	Firstname string `json:"firstname"`
	Lastname  string `json:"lastname"`
	Fullname  string `json:"fullname"`
}

DatabaseAuthor stores essential informations about an author

type DatabaseFullInfos

type DatabaseFullInfos struct {
	Database
	Imports             []ImportFullInfos  `json:"imports"`
	Countries           []CountryInfos     `json:"countries"`
	Continents          []ContinentInfos   `json:"continents"`
	Handles             []Database_handle  `json:"handles"`
	Authors             []DatabaseAuthor   `json:"authors"`
	Contexts            []Database_context `json:"contexts"`
	Owner_name          string             `json:"owner_name"`
	License             string             `json:"license"`
	License_uri         string             `json:"license_uri"`
	Description         map[string]string  `json:"description"`
	Geographical_limit  map[string]string  `json:"geographical_limit"`
	Bibliography        map[string]string  `json:"bibliography"`
	Re_use              map[string]string  `json:"re_use"`
	Context_description map[string]string  `json:"context_description"`
	Source_description  map[string]string  `json:"source_description"`
	Source_relation     map[string]string  `json:"source_relation"`
	Copyright           map[string]string  `json:"copyright"`
	Subject             map[string]string  `json:"subject"`
}

DatabaseFullInfos stores all informations about a database

func (*DatabaseFullInfos) GetAuthorsString

func (dfi *DatabaseFullInfos) GetAuthorsString() string

func (*DatabaseFullInfos) GetAuthorsStrings

func (dfi *DatabaseFullInfos) GetAuthorsStrings() []string

func (*DatabaseFullInfos) GetTranslations

func (d *DatabaseFullInfos) GetTranslations(tx *sqlx.Tx) (err error)

GetTranslations lists all translated fields from database

type Database__authors

type Database__authors struct {
	Database_id int `db:"database_id" json:"database_id"` // Database.Id
	User_id     int `db:"user_id" json:"user_id"`         // User.Id
}

type Database__continent

type Database__continent struct {
	Database_id         int `db:"database_id" json:"database_id" xmltopsql:"ondelete:cascade"` // Database.Id
	Continent_geonameid int `db:"continent_geonameid" json:"continent_geonameid"`              // Continent.Geonameid
}

type Database__country

type Database__country struct {
	Database_id       int `db:"database_id" json:"database_id" xmltopsql:"ondelete:cascade"` // Database.Id
	Country_geonameid int `db:"country_geonameid" json:"country_geonameid"`                  // Country.Geonameid
}

type Database_context

type Database_context struct {
	Id          int    `db:"id" json:"id"`
	Database_id int    `db:"database_id" json:"database_id"` // Database.Id
	Context     string `db:"context" json:"context"`
}

type Database_handle

type Database_handle struct {
	Id                     int       `db:"id" json:"id"`
	Database_id            int       `db:"database_id" json:"database_id" xmltopsql:"ondelete:cascade"` // Database.Id
	Import_id              int       `db:"import_id" json:"import_id"`                                  // Import.Id
	Identifier             string    `db:"identifier" json:"identifier"`
	Url                    string    `db:"url" json:"url"`
	Declared_creation_date time.Time `db:"declared_creation_date" json:"declared_creation_date"`
	Created_at             time.Time `db:"created_at" json:"created_at"`
}

type Database_tr

type Database_tr struct {
	Database_id         int    `db:"database_id" json:"database_id" xmltopsql:"ondelete:cascade"` // Database.Id
	Lang_isocode        string `db:"lang_isocode" json:"lang_isocode"`                            // Lang.Isocode
	Description         string `db:"description" json:"description"`
	Geographical_limit  string `db:"geographical_limit" json:"geographical_limit"`
	Bibliography        string `db:"bibliography" json:"bibliography"`
	Context_description string `db:"context_description" json:"context_description"`
	Source_description  string `db:"source_description" json:"source_description"`
	Source_relation     string `db:"source_relation" json:"source_relation"`
	Copyright           string `db:"copyright" json:"copyright"`
	Subject             string `db:"subject" json:"subject"`
	Re_use              string `db:"re_use" json:"re_use"`
}

type Group

type Group struct {
	Id         int       `db:"id" json:"id"`
	Type       string    `db:"type" json:"type"`
	Created_at time.Time `db:"created_at" json:"created_at"`
	Updated_at time.Time `db:"updated_at" json:"updated_at"`
}

func (*Group) Create

func (g *Group) Create(tx *sqlx.Tx) error

Create the group by inserting it in the database

func (*Group) Delete

func (g *Group) Delete(tx *sqlx.Tx) error

Delete the group from the database

func (*Group) Get

func (g *Group) Get(tx *sqlx.Tx) error

Get the group from the database

func (*Group) GetPermissions

func (g *Group) GetPermissions(tx *sqlx.Tx) (permissions []Permission, err error)

GetPermissions return an array of Permissions that the group have

func (*Group) GetUsers

func (g *Group) GetUsers(tx *sqlx.Tx) (users []User, err error)

GetUsers return an array of groups of the User

func (*Group) SetUsers

func (g *Group) SetUsers(tx *sqlx.Tx, users []User) error

SetUsers of the group

func (*Group) Update

func (g *Group) Update(tx *sqlx.Tx) error

Update the group in the database

type Group__permission

type Group__permission struct {
	Group_id      int       `db:"group_id" json:"group_id" xmltopsql:"ondelete:cascade"` // Group.Id
	Permission_id int       `db:"permission_id" json:"permission_id"`                    // Permission.Id
	Created_at    time.Time `db:"created_at" json:"created_at"`
	Updated_at    time.Time `db:"updated_at" json:"updated_at"`
}

type Group_tr

type Group_tr struct {
	Group_id     int    `db:"group_id" json:"group_id" xmltopsql:"ondelete:cascade"` // Group.Id
	Lang_isocode string `db:"lang_isocode" json:"lang_isocode"`                      // Lang.Isocode
	Name         string `db:"name" json:"name"`
	Description  string `db:"description" json:"description"`
}

func (*Group_tr) Create

func (u *Group_tr) Create(tx *sqlx.Tx) error

Create the group_tr by inserting it in the database

func (*Group_tr) Delete

func (u *Group_tr) Delete(tx *sqlx.Tx) error

Delete the group_tr from the database

func (*Group_tr) Get

func (u *Group_tr) Get(tx *sqlx.Tx) error

Get the group_tr from the database

func (*Group_tr) Update

func (u *Group_tr) Update(tx *sqlx.Tx) error

Update the group_tr in the database

type Import

type Import struct {
	Id              int       `db:"id" json:"id"`
	Database_id     int       `db:"database_id" json:"database_id"` // Database.Id
	User_id         int       `db:"user_id" json:"user_id"`         // User.Id
	Md5sum          string    `db:"md5sum" json:"md5sum"`
	Filename        string    `db:"filename" json:"filename"`
	Number_of_lines int       `db:"number_of_lines" json:"number_of_lines"`
	Number_of_sites int       `db:"number_of_sites" json:"number_of_sites"`
	Created_at      time.Time `db:"created_at" json:"created_at"`
}

func (*Import) Create

func (i *Import) Create(tx *sqlx.Tx) error

type ImportFullInfos

type ImportFullInfos struct {
	Import
	Fullname string `json:"fullname"`
}

ImportFullInfos stores all informations about an import

type Lang

type Lang struct {
	Isocode string `db:"isocode" json:"isocode"`
	Active  bool   `db:"active" json:"active"`
}

func GetActiveLangs

func GetActiveLangs() ([]Lang, error)

GetActiveLangs returns an array of Lang object which are actives only

func GetLangs

func GetLangs() ([]Lang, error)

GetLangs returns an array of Lang objects

func (*Lang) Get

func (l *Lang) Get(tx *sqlx.Tx) error

Get the lang from the database

type Lang_tr

type Lang_tr struct {
	Lang_isocode    string `db:"lang_isocode" json:"lang_isocode"`       // Lang.Isocode
	Lang_isocode_tr string `db:"lang_isocode_tr" json:"lang_isocode_tr"` // Lang.Isocode
	Name            string `db:"name" json:"name"`
}

type LayerFullInfos

type LayerFullInfos struct {
	Id                       int               `json:"id"`
	Geographical_extent_geom string            `json:"geographical_extent_geom"`
	Creator_user_id          int               `json:"creator_user_id"`
	Published                bool              `json:"published"`
	Updated_at               time.Time         `json:"updated_at"`
	Created_at               time.Time         `json:"created_at"`
	Author                   string            `json:"author"`
	Type                     string            `json:"type"`
	Start_date               int               `json:"start_date"`
	End_date                 int               `json:"end_date"`
	Min_scale                int               `json:"min_scale"`
	Max_scale                int               `json:"max_scale"`
	Uniq_code                string            `json:"uniq_code"`
	Tile_matrix_set          string            `json:"tile_matrix_set"`
	Tile_matrix_string       string            `json:"tile_matrix_string"`
	Use_proxy                bool              `json:"use_proxy"`
	Name                     map[string]string `json:"name"`
	Attribution              map[string]string `json:"attribution"`
	Copyright                map[string]string `json:"copyright"`
	Description              map[string]string `json:"description"`
}

type License

type License struct {
	Id   int    `db:"id" json:"id"`
	Name string `db:"name" json:"name"`
	Url  string `db:"url" json:"url"`
}

type Map_layer

type Map_layer struct {
	Id                       int       `db:"id" json:"id"`                           // Map_layer__authors.Map_layer_id
	Creator_user_id          int       `db:"creator_user_id" json:"creator_user_id"` // User.Id
	Type                     string    `db:"type" json:"type"`
	Url                      string    `db:"url" json:"url" min:"1" error:"WMS_MAP.FIELD_URL.T_CHECK_MANDATORY" max:"255" error:"WMS_MAP.FIELD_URL.T_CHECK_INCORRECT"`
	Identifier               string    `db:"identifier" json:"identifier"`
	Min_scale                int       `db:"min_scale" json:"min_scale"`
	Max_scale                int       `db:"max_scale" json:"max_scale"`
	Start_date               int       `db:"start_date" json:"start_date"`
	End_date                 int       `db:"end_date" json:"end_date"`
	Image_format             string    `db:"image_format" json:"image_format"`
	Geographical_extent_geom string    `db:"geographical_extent_geom" json:"geographical_extent_geom"`
	Published                bool      `db:"published" json:"published"`
	License                  string    `db:"license" json:"license"`
	License_id               int       `db:"license_id" json:"license_id"` // License.Id
	Max_usage_date           time.Time `db:"max_usage_date" json:"max_usage_date"`
	Created_at               time.Time `db:"created_at" json:"created_at"`
	Updated_at               time.Time `db:"updated_at" json:"updated_at"`
	Tile_matrix_set          string    `db:"tile_matrix_set" json:"tile_matrix_set"`
	Tile_matrix_string       string    `db:"tile_matrix_string" json:"tile_matrix_string"`
	Use_proxy                bool      `db:"use_proxy" json:"use_proxy"`
}

func (*Map_layer) Create

func (u *Map_layer) Create(tx *sqlx.Tx) error

Create a map layer by inserting it in the database

func (*Map_layer) Delete

func (u *Map_layer) Delete(tx *sqlx.Tx) error

Delete the map layer from the database

func (*Map_layer) DeleteAuthors

func (u *Map_layer) DeleteAuthors(tx *sqlx.Tx) (err error)

DeleteAuthors deletes the author linked to a wms layer

func (*Map_layer) Get

func (u *Map_layer) Get(tx *sqlx.Tx) error

Get the map layer from the database

func (*Map_layer) SetAuthors

func (u *Map_layer) SetAuthors(tx *sqlx.Tx, authors []int) (err error)

SetAuthors links users as authors to a wms layer

func (*Map_layer) SetPublicationState

func (u *Map_layer) SetPublicationState(tx *sqlx.Tx) error

Set publication state of the map layer

func (*Map_layer) SetTranslations

func (u *Map_layer) SetTranslations(tx *sqlx.Tx, field string, translations []struct {
	Lang_Isocode string
	Text         string
}) (err error)

SetTranslation set translations !

func (*Map_layer) Update

func (u *Map_layer) Update(tx *sqlx.Tx) error

Update the map layer in the database

type Map_layer__authors

type Map_layer__authors struct {
	User_id      int `db:"user_id" json:"user_id"` // User.Id
	Map_layer_id int `db:"map_layer_id" json:"map_layer_id"`
}

type Map_layer_tr

type Map_layer_tr struct {
	Map_layer_id int    `db:"map_layer_id" json:"map_layer_id"` // Map_layer.Id
	Lang_isocode string `db:"lang_isocode" json:"lang_isocode"` // Lang.Isocode
	Name         string ``                                      /* 132-byte string literal not displayed */
	Attribution  string `db:"attribution" json:"attribution"`
	Copyright    string `db:"copyright" json:"copyright"`
	Description  string `db:"description" json:"description"`
}

type Permission

type Permission struct {
	Id         int       `db:"id" json:"id"`
	Name       string    `db:"name" json:"name"`
	Created_at time.Time `db:"created_at" json:"created_at"`
	Updated_at time.Time `db:"updated_at" json:"updated_at"`
}

type Permission_tr

type Permission_tr struct {
	Permission_id int    `db:"permission_id" json:"permission_id"` // Permission.Id
	Lang_isocode  string `db:"lang_isocode" json:"lang_isocode"`   // Lang.Isocode
	Name          string `db:"name" json:"name"`
	Description   string `db:"description" json:"description"`
}

type Photo

type Photo struct {
	Id    int    `db:"id" json:"id"`
	Photo string `db:"photo" json:"photo"`
}

func (*Photo) Create

func (u *Photo) Create(tx *sqlx.Tx) error

Create the photo by inserting it in the database

func (*Photo) Delete

func (u *Photo) Delete(tx *sqlx.Tx) error

Delete the photo from the database

func (*Photo) Get

func (u *Photo) Get(tx *sqlx.Tx) error

Get the photo from the database

func (*Photo) Update

func (u *Photo) Update(tx *sqlx.Tx) error

Update the photo in the database

type Project

type Project struct {
	Id         int       `db:"id" json:"id"`           // Project__charac.Project_id
	Name       string    ``                            /* 129-byte string literal not displayed */
	User_id    int       `db:"user_id" json:"user_id"` // User.Id
	Created_at time.Time `db:"created_at" json:"created_at"`
	Updated_at time.Time `db:"updated_at" json:"updated_at"`
	Start_date int       `db:"start_date" json:"start_date"`
	End_date   int       `db:"end_date" json:"end_date"`
	Geom       string    `db:"geom" json:"geom"`
}

type ProjectFullInfos

type ProjectFullInfos struct {
	Project
	Chronologies []struct {
		Root_chronology_id int `json:"id"`
	} `json:"chronologies"`
	Layers  []LayerFullInfos `json:"layers"`
	Characs []struct {
		Root_charac_id int `json:"id"`
	} `json:"characs"`
	Databases []struct {
		Database_id int `json:"id"`
	} `json:"databases"`
}

func (*ProjectFullInfos) Get

func (pfi *ProjectFullInfos) Get(tx *sqlx.Tx) (err error)

type Project__charac

type Project__charac struct {
	Project_id     int `db:"project_id" json:"project_id" xmltopsql:"ondelete:cascade"`
	Root_charac_id int `db:"root_charac_id" json:"root_charac_id"` // Charac.Id
}

type Project__chronology

type Project__chronology struct {
	Project_id         int `db:"project_id" json:"project_id" xmltopsql:"ondelete:cascade"` // Project.Id
	Root_chronology_id int `db:"root_chronology_id" json:"root_chronology_id"`              // Chronology.Id
}

type Project__database

type Project__database struct {
	Project_id  int `db:"project_id" json:"project_id" xmltopsql:"ondelete:cascade"` // Project.Id
	Database_id int `db:"database_id" json:"database_id"`                            // Database.Id
}

type Project__map_layer

type Project__map_layer struct {
	Project_id   int `db:"project_id" json:"project_id" xmltopsql:"ondelete:cascade"` // Project.Id
	Map_layer_id int `db:"map_layer_id" json:"map_layer_id"`                          // Map_layer.Id
}

type Project__shapefile

type Project__shapefile struct {
	Project_id   int `db:"project_id" json:"project_id"`     // Project.Id
	Shapefile_id int `db:"shapefile_id" json:"shapefile_id"` // Shapefile.Id
}

type Project_hidden_characs

type Project_hidden_characs struct {
	Project_id int `db:"project_id" json:"project_id" xmltopsql:"ondelete:cascade"` // Project.Id
	Charac_id  int `db:"charac_id" json:"charac_id" xmltopsql:"ondelete:cascade"`   // Charac.Id
}

func (*Project_hidden_characs) Create

func (u *Project_hidden_characs) Create(tx *sqlx.Tx) error

Create the project_hidden_characs by inserting it in the database

func (*Project_hidden_characs) Delete

func (u *Project_hidden_characs) Delete(tx *sqlx.Tx) error

Delete the project_hidden_characs from the database

func (*Project_hidden_characs) Get

func (u *Project_hidden_characs) Get(tx *sqlx.Tx) error

Get the project_hidden_characs from the database

func (*Project_hidden_characs) List

List return Project_hidden_characs of a Project

type Saved_query

type Saved_query struct {
	Project_id int    `db:"project_id" json:"project_id" xmltopsql:"ondelete:cascade"` // Project.Id
	Name       string `db:"name" json:"name" min:"1"`
	Params     string `db:"params" json:"params"`
}

type Session

type Session struct {
	Token string `db:"token" json:"token"`
	Value string `db:"value" json:"value"`
}

type Shapefile

type Shapefile struct {
	Id                       int       `db:"id" json:"id"`
	Creator_user_id          int       `db:"creator_user_id" json:"creator_user_id"` // User.Id
	Filename                 string    `db:"filename" json:"filename"`
	Md5sum                   string    `db:"md5sum" json:"md5sum"`
	Geojson                  string    `db:"geojson" json:"geojson"`
	Geojson_with_data        string    `db:"geojson_with_data" json:"geojson_with_data"`
	Start_date               int       `db:"start_date" json:"start_date"`
	End_date                 int       `db:"end_date" json:"end_date"`
	Geographical_extent_geom string    `db:"geographical_extent_geom" json:"geographical_extent_geom"`
	Published                bool      `db:"published" json:"published" enum:"0,1" error:"SHAPEFILE.FIELD_PUBLISHED.T_CHECK_INCORRECT"`
	License                  string    `db:"license" json:"license"`
	License_id               int       `db:"license_id" json:"license_id"` // License.Id
	Declared_creation_date   time.Time `db:"declared_creation_date" json:"declared_creation_date"`
	Created_at               time.Time `db:"created_at" json:"created_at"`
	Updated_at               time.Time `db:"updated_at" json:"updated_at"`
}

func (*Shapefile) Create

func (u *Shapefile) Create(tx *sqlx.Tx) error

Create a shapefile by inserting it in the shapefile

func (*Shapefile) Delete

func (u *Shapefile) Delete(tx *sqlx.Tx) error

Delete the shapefile from the database

func (*Shapefile) DeleteAuthors

func (u *Shapefile) DeleteAuthors(tx *sqlx.Tx) (err error)

DeleteAuthors deletes the author linked to a shapefile

func (*Shapefile) Get

func (u *Shapefile) Get(tx *sqlx.Tx) error

Get the shapefile from the shapefile

func (*Shapefile) SetAuthors

func (u *Shapefile) SetAuthors(tx *sqlx.Tx, authors []int) (err error)

SetAuthors links users as authors to a shapefile

func (*Shapefile) SetPublicationState

func (u *Shapefile) SetPublicationState(tx *sqlx.Tx) error

Set publication state of the shapefile

func (*Shapefile) SetTranslations

func (u *Shapefile) SetTranslations(tx *sqlx.Tx, field string, translations []struct {
	Lang_Isocode string
	Text         string
}) (err error)

SetTranslation set translations !

func (*Shapefile) Update

func (u *Shapefile) Update(tx *sqlx.Tx) error

Update the shapefile in the shapefile

type Shapefile__authors

type Shapefile__authors struct {
	User_id      int `db:"user_id" json:"user_id"`           // User.Id
	Shapefile_id int `db:"shapefile_id" json:"shapefile_id"` // Shapefile.Id
}

type Shapefile_tr

type Shapefile_tr struct {
	Shapefile_id int    `db:"shapefile_id" json:"shapefile_id"` // Shapefile.Id
	Lang_isocode string `db:"lang_isocode" json:"lang_isocode"` // Lang.Isocode
	Name         string ``                                      /* 136-byte string literal not displayed */
	Attribution  string `db:"attribution" json:"attribution"`
	Copyright    string `db:"copyright" json:"copyright"`
	Description  string `db:"description" json:"description"`
}

type Site

type Site struct {
	Id             int       `db:"id" json:"id"`
	Code           string    `db:"code" json:"code" min:"1" error:"SITE.FIELD_CODE.T_CHECK_MANDATORY" max:"255" error:"SITE.FIELD_CODE.T_CHECK_INCORRECT"`
	Name           string    `db:"name" json:"name" min:"1" error:"SITE.FIELD_NAME.T_CHECK_MANDATORY" max:"255" error:"SITE.FIELD_NAME.T_CHECK_INCORRECT"`
	City_name      string    `db:"city_name" json:"city_name"`
	City_geonameid int       `db:"city_geonameid" json:"city_geonameid"`
	Geom           string    `db:"geom" json:"geom"`
	Geom_3d        string    `db:"geom_3d" json:"geom_3d"`
	Centroid       bool      `db:"centroid" json:"centroid" enum:"0,1" error:"SITE.FIELD_CENTROID.T_CHECK_MANDATORY"`
	Occupation     string    ``                                    /* 130-byte string literal not displayed */
	Database_id    int       `db:"database_id" json:"database_id"` // Database.Id
	Created_at     time.Time `db:"created_at" json:"created_at"`
	Updated_at     time.Time `db:"updated_at" json:"updated_at"`
	Altitude       float64   `db:"altitude" json:"altitude"`
	Start_date1    int       `db:"start_date1" json:"start_date1"`
	Start_date2    int       `db:"start_date2" json:"start_date2"`
	End_date1      int       `db:"end_date1" json:"end_date1"`
	End_date2      int       `db:"end_date2" json:"end_date2"`
}

func (*Site) Get

func (s *Site) Get(tx *sqlx.Tx) (err error)

type SiteInfos

type SiteInfos struct {
	Site
	Site_tr
	//NbSiteRanges     int
	HasError  bool
	Point     *geo.Point
	Latitude  string
	Longitude string
	GeonameID string
	Created   bool
	EPSG      int
}

SiteInfos is a meta struct which stores all the informations about a site

func (*SiteInfos) CacheDates

func (s *SiteInfos) CacheDates(tx *sqlx.Tx) (err error)

CacheDates get database sites extend and cache enveloppe

func (*SiteInfos) Create

func (s *SiteInfos) Create(tx *sqlx.Tx) (err error)

func (*SiteInfos) Update

func (s *SiteInfos) Update(tx *sqlx.Tx) (err error)

type Site_range

type Site_range struct {
	Id          int       `db:"id" json:"id"`
	Site_id     int       `db:"site_id" json:"site_id" xmltopsql:"ondelete:cascade"` // Site.Id
	Start_date1 int       `db:"start_date1" json:"start_date1"`
	Start_date2 int       `db:"start_date2" json:"start_date2"`
	End_date1   int       `db:"end_date1" json:"end_date1"`
	End_date2   int       `db:"end_date2" json:"end_date2"`
	Created_at  time.Time `db:"created_at" json:"created_at"`
	Updated_at  time.Time `db:"updated_at" json:"updated_at"`
}

func (*Site_range) Create

func (sr *Site_range) Create(tx *sqlx.Tx) (err error)

type Site_range__charac

type Site_range__charac struct {
	Id             int    `db:"id" json:"id"`
	Site_range_id  int    `db:"site_range_id" json:"site_range_id" xmltopsql:"ondelete:cascade"` // Site_range.Id
	Charac_id      int    `db:"charac_id" json:"charac_id"`                                      // Charac.Id
	Exceptional    bool   `db:"exceptional" json:"exceptional"`
	Knowledge_type string `` /* 183-byte string literal not displayed */
}

type Site_range__charac_tr

type Site_range__charac_tr struct {
	Site_range__charac_id int    `db:"site_range__charac_id" json:"site_range__charac_id" xmltopsql:"ondelete:cascade"` // Site_range__charac.Id
	Lang_isocode          string `db:"lang_isocode" json:"lang_isocode"`                                                // Lang.Isocode
	Comment               string `db:"comment" json:"comment"`
	Bibliography          string `db:"bibliography" json:"bibliography"`
}

type Site_tr

type Site_tr struct {
	Site_id      int    `db:"site_id" json:"site_id" xmltopsql:"ondelete:cascade"` // Site.Id
	Lang_isocode string `db:"lang_isocode" json:"lang_isocode"`                    // Lang.Isocode
	Description  string `db:"description" json:"description"`
}

type User

type User struct {
	Id                  int       `db:"id" json:"id"`
	Username            string    `db:"username" json:"username" min:"2" max:"32" error:"USER.FIELD_USERNAME.T_CHECK_INCORRECT"`
	Firstname           string    `db:"firstname" json:"firstname"`
	Lastname            string    `` /* 138-byte string literal not displayed */
	Email               string    `db:"email" json:"email" email:"1" error:"USER.FIELD_EMAIL.T_CHECK_INCORRECT"`
	Password            string    `db:"password" json:"password" min:"6" max:"32" error:"USER.FIELD_PASSWORD.T_CHECK_INCORRECT"`
	Description         string    `db:"description" json:"description" min:"1" max:"2048" error:"USER.FIELD_DESCRIPTION.T_CHECK_MANDATORY"`
	Active              bool      `db:"active" json:"active"`
	First_lang_isocode  string    `db:"first_lang_isocode" json:"first_lang_isocode"`   // Lang.Isocode
	Second_lang_isocode string    `db:"second_lang_isocode" json:"second_lang_isocode"` // Lang.Isocode
	City_geonameid      int       `db:"city_geonameid" json:"city_geonameid"`           // City.Geonameid
	Photo_id            int       `db:"photo_id" json:"photo_id"`                       // Photo.Id
	Created_at          time.Time `db:"created_at" json:"created_at"`
	Updated_at          time.Time `db:"updated_at" json:"updated_at"`
}

func (*User) Create

func (u *User) Create(tx *sqlx.Tx) error

Create the user by inserting it in the database

func (*User) Delete

func (u *User) Delete(tx *sqlx.Tx) error

Delete the user from the database

func (*User) Get

func (u *User) Get(tx *sqlx.Tx) error

Get the user from the database

func (*User) GetCompanies

func (u *User) GetCompanies(tx *sqlx.Tx) (companies []Company, err error)

GetCompanies return an array of companies of the User

func (*User) GetGroups

func (u *User) GetGroups(tx *sqlx.Tx) (groups []Group, err error)

GetGroups return an array of groups of the User

func (*User) GetLimited

func (u *User) GetLimited(tx *sqlx.Tx) error

Get the user from the database

func (*User) GetPermissions

func (u *User) GetPermissions(tx *sqlx.Tx) (permissions []Permission, err error)

GetPermissions return an array of Permissions that the user have

func (*User) GetProjectId

func (u *User) GetProjectId(tx *sqlx.Tx) (projectID int, err error)

GetProjectId get the project of the user

func (*User) HaveAtLeastOnePermission

func (u *User) HaveAtLeastOnePermission(tx *sqlx.Tx, permissions ...string) (ok bool, err error)

HavePermissions return true if the user have all the wanted permissions

func (*User) HaveGroups

func (u *User) HaveGroups(tx *sqlx.Tx, groups ...Group) (ok bool, err error)

HaveGroups return true if the user have all the wanted groups

func (*User) HavePermissions

func (u *User) HavePermissions(tx *sqlx.Tx, permissions ...string) (ok bool, err error)

HavePermissions return true if the user have all the wanted permissions

func (*User) Login

func (u *User) Login(password string) (ok bool)

Login test the username/password couple, and return true if it is ok, false if not

func (*User) MakeNewPassword

func (u *User) MakeNewPassword(password string) (err error)

MakeNewPassword

func (*User) SetCompanies

func (u *User) SetCompanies(tx *sqlx.Tx, companies []Company) error

SetCompanies set user companies

func (*User) SetGroups

func (u *User) SetGroups(tx *sqlx.Tx, groups []Group) error

SetGroups set user groups

func (*User) Update

func (u *User) Update(tx *sqlx.Tx) error

Update the user in the database

type User__company

type User__company struct {
	User_id    int `db:"user_id" json:"user_id"`       // User.Id
	Company_id int `db:"company_id" json:"company_id"` // Company.Id
}

type User__group

type User__group struct {
	Group_id int `db:"group_id" json:"group_id"` // Group.Id
	User_id  int `db:"user_id" json:"user_id"`   // User.Id
}

type User_preferences

type User_preferences struct {
	User_id int    `db:"user_id" json:"user_id"` // User.Id
	Key     string `db:"key" json:"key"`
	Value   string `db:"value" json:"value"`
}

Jump to

Keyboard shortcuts

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