Documentation ¶
Index ¶
- Constants
- func GetAllCharacPathIDsFromLangIsocode(langIsocode string) (caracs map[int]string, err error)
- func GetAllCharacsRootFromLangIsocode(langIsocode string) (caracsRoot map[string]int, err error)
- func GetCharacPathsFromLang(name string, lang string) (caracs map[string]int, err error)
- func GetCharacPathsFromLangID(name string, langIsocode string) (caracs map[string]int, err error)
- func GetQueryTranslationsAsJSON(tableName, where, wrapTo string, fields ...string) string
- func GetQueryTranslationsAsJSONObject(tableName, where string, wrapTo string, noBrace bool, fields ...string) string
- func IntJoin(a []int, hackempty bool) string
- func MapSqlTranslations(src interface{}, isofieldname string, valuefieldname string) map[string]string
- type Charac
- type Charac_root
- type Charac_tr
- type Chronology
- type Chronology_root
- type Chronology_tr
- type City
- type CityAndCountry_wtr
- type City_tr
- type City_wtr
- type Company
- type Continent
- type ContinentInfos
- type Continent_tr
- type Country
- type CountryInfos
- type Country_tr
- type Country_wtr
- type Database
- func (d *Database) AddContinents(tx *sqlx.Tx, continentIds []int) (err error)
- func (d *Database) AddCountries(tx *sqlx.Tx, countryIds []int) (err error)
- func (d *Database) AddHandle(tx *sqlx.Tx, handle *Database_handle) (id int, err error)
- func (d *Database) AnotherExistsWithSameName(tx *sqlx.Tx) (exists bool, err error)
- func (d *Database) CacheDates(tx *sqlx.Tx) (err error)
- func (d *Database) CacheGeom(tx *sqlx.Tx) (err error)
- func (d *Database) Create(tx *sqlx.Tx) (err error)
- func (d *Database) Delete(tx *sqlx.Tx) (err error)
- func (d *Database) DeleteAuthors(tx *sqlx.Tx) (err error)
- func (d *Database) DeleteContexts(tx *sqlx.Tx) error
- func (d *Database) DeleteContinents(tx *sqlx.Tx) (err error)
- func (d *Database) DeleteCountries(tx *sqlx.Tx) (err error)
- func (d *Database) DeleteHandles(tx *sqlx.Tx) error
- func (d *Database) DeleteImports(tx *sqlx.Tx) error
- func (d *Database) DeleteSites(tx *sqlx.Tx) (err error)
- func (d *Database) DeleteSpecificHandle(tx *sqlx.Tx, id int) error
- func (d *Database) DoesExist(tx *sqlx.Tx) (exists bool, err error)
- func (d *Database) Get(tx *sqlx.Tx) (err error)
- func (d *Database) GetAuthorsList(tx *sqlx.Tx) (authors []DatabaseAuthor, err error)
- func (d *Database) GetContextsList(tx *sqlx.Tx) (contexts []Database_context, err error)
- func (d *Database) GetContinentList(tx *sqlx.Tx, langIsocode string) (continents []ContinentInfos, err error)
- func (d *Database) GetCountryList(tx *sqlx.Tx, langIsocode string) ([]CountryInfos, error)
- func (d *Database) GetFullInfos(tx *sqlx.Tx, langIsocode string) (db DatabaseFullInfos, err error)
- func (d *Database) GetHandles(tx *sqlx.Tx) (handles []Database_handle, err error)
- func (d *Database) GetImportList(tx *sqlx.Tx) (imports []ImportFullInfos, err error)
- func (d *Database) GetLastHandle(tx *sqlx.Tx) (handle *Database_handle, err error)
- func (d *Database) GetLastImport(tx *sqlx.Tx) (imp Import, err error)
- func (d *Database) GetOwnerInfos(tx *sqlx.Tx) (owner DatabaseAuthor, err error)
- func (d *Database) IsLinkedToProject(tx *sqlx.Tx, project_ID int) (linked bool, err error)
- func (d *Database) LinkToUserProject(tx *sqlx.Tx, project_ID int) (err error)
- func (d *Database) SetAuthors(tx *sqlx.Tx, authors []int) (err error)
- func (d *Database) SetContexts(tx *sqlx.Tx, contexts []string) error
- func (d *Database) SetTranslations(tx *sqlx.Tx, field string, translations []struct{ ... }) (err error)
- func (d *Database) Update(tx *sqlx.Tx) (err error)
- func (d *Database) UpdateFields(tx *sqlx.Tx, params interface{}, fields ...string) (err error)
- func (d *Database) UpdateHandle(tx *sqlx.Tx, handle *Database_handle) (err error)
- type DatabaseAuthor
- type DatabaseFullInfos
- type Database__authors
- type Database__continent
- type Database__country
- type Database_context
- type Database_handle
- type Database_tr
- type Group
- func (g *Group) Create(tx *sqlx.Tx) error
- func (g *Group) Delete(tx *sqlx.Tx) error
- func (g *Group) Get(tx *sqlx.Tx) error
- func (g *Group) GetPermissions(tx *sqlx.Tx) (permissions []Permission, err error)
- func (g *Group) GetUsers(tx *sqlx.Tx) (users []User, err error)
- func (g *Group) SetUsers(tx *sqlx.Tx, users []User) error
- func (g *Group) Update(tx *sqlx.Tx) error
- type Group__permission
- type Group_tr
- type Import
- type ImportFullInfos
- type Lang
- type Lang_tr
- type LayerFullInfos
- type License
- type Map_layer
- func (u *Map_layer) Create(tx *sqlx.Tx) error
- func (u *Map_layer) Delete(tx *sqlx.Tx) error
- func (u *Map_layer) DeleteAuthors(tx *sqlx.Tx) (err error)
- func (u *Map_layer) Get(tx *sqlx.Tx) error
- func (u *Map_layer) SetAuthors(tx *sqlx.Tx, authors []int) (err error)
- func (u *Map_layer) SetPublicationState(tx *sqlx.Tx) error
- func (u *Map_layer) SetTranslations(tx *sqlx.Tx, field string, translations []struct{ ... }) (err error)
- func (u *Map_layer) Update(tx *sqlx.Tx) error
- type Map_layer__authors
- type Map_layer_tr
- type Permission
- type Permission_tr
- type Photo
- type Project
- type ProjectFullInfos
- type Project__charac
- type Project__chronology
- type Project__database
- type Project__map_layer
- type Project__shapefile
- type Project_hidden_characs
- type Saved_query
- type Session
- type Shapefile
- func (u *Shapefile) Create(tx *sqlx.Tx) error
- func (u *Shapefile) Delete(tx *sqlx.Tx) error
- func (u *Shapefile) DeleteAuthors(tx *sqlx.Tx) (err error)
- func (u *Shapefile) Get(tx *sqlx.Tx) error
- func (u *Shapefile) SetAuthors(tx *sqlx.Tx, authors []int) (err error)
- func (u *Shapefile) SetPublicationState(tx *sqlx.Tx) error
- func (u *Shapefile) SetTranslations(tx *sqlx.Tx, field string, translations []struct{ ... }) (err error)
- func (u *Shapefile) Update(tx *sqlx.Tx) error
- type Shapefile__authors
- type Shapefile_tr
- type Site
- type SiteInfos
- type Site_range
- type Site_range__charac
- type Site_range__charac_tr
- type Site_tr
- type User
- func (u *User) Create(tx *sqlx.Tx) error
- func (u *User) Delete(tx *sqlx.Tx) error
- func (u *User) Get(tx *sqlx.Tx) error
- func (u *User) GetCompanies(tx *sqlx.Tx) (companies []Company, err error)
- func (u *User) GetGroups(tx *sqlx.Tx) (groups []Group, err error)
- func (u *User) GetLimited(tx *sqlx.Tx) error
- func (u *User) GetPermissions(tx *sqlx.Tx) (permissions []Permission, err error)
- func (u *User) GetProjectId(tx *sqlx.Tx) (projectID int, err error)
- func (u *User) HaveAtLeastOnePermission(tx *sqlx.Tx, permissions ...string) (ok bool, err error)
- func (u *User) HaveGroups(tx *sqlx.Tx, groups ...Group) (ok bool, err error)
- func (u *User) HavePermissions(tx *sqlx.Tx, permissions ...string) (ok bool, err error)
- func (u *User) Login(password string) (ok bool)
- func (u *User) MakeNewPassword(password string) (err error)
- func (u *User) SetCompanies(tx *sqlx.Tx, companies []Company) error
- func (u *User) SetGroups(tx *sqlx.Tx, groups []Group) error
- func (u *User) Update(tx *sqlx.Tx) error
- type User__company
- type User__group
- type User_preferences
Constants ¶
const Charac_InsertStr = "\"parent_id\", \"order\", \"author_user_id\", \"ark_id\", \"pactols_id\", \"aat_id\", \"created_at\", \"updated_at\""
const Charac_InsertValuesStr = ":parent_id, :order, :author_user_id, :ark_id, :pactols_id, :aat_id, now(), now()"
const Charac_UpdateStr = "" /* 182-byte string literal not displayed */
const Charac_root_InsertStr = "\"admin_group_id\", \"cached_langs\""
const Charac_root_InsertValuesStr = ":admin_group_id, :cached_langs"
const Charac_root_UpdateStr = "\"admin_group_id\" = :admin_group_id, \"cached_langs\" = :cached_langs"
const Charac_tr_InsertStr = "\"name\", \"description\""
const Charac_tr_InsertValuesStr = ":name, :description"
const Charac_tr_UpdateStr = "\"name\" = :name, \"description\" = :description"
const Chronology_InsertStr = "\"parent_id\", \"start_date\", \"end_date\", \"color\", \"created_at\", \"updated_at\""
const Chronology_InsertValuesStr = ":parent_id, :start_date, :end_date, :color, now(), now()"
const Chronology_UpdateStr = "" /* 126-byte string literal not displayed */
const Chronology_root_InsertStr = "\"admin_group_id\", \"author_user_id\", \"credits\", \"active\", \"geom\", \"cached_langs\""
const Chronology_root_InsertValuesStr = ":admin_group_id, :author_user_id, :credits, :active, :geom, :cached_langs"
const Chronology_root_UpdateStr = "" /* 172-byte string literal not displayed */
const Chronology_tr_InsertStr = "\"name\", \"description\""
const Chronology_tr_InsertValuesStr = ":name, :description"
const Chronology_tr_UpdateStr = "\"name\" = :name, \"description\" = :description"
const City_InsertStr = "\"country_geonameid\", \"geom\", \"geom_centroid\", \"created_at\", \"updated_at\""
const City_InsertValuesStr = ":country_geonameid, :geom, :geom_centroid, now(), now()"
const City_UpdateStr = "\"country_geonameid\" = :country_geonameid, \"geom\" = :geom, \"geom_centroid\" = :geom_centroid, \"updated_at\" = now()"
const City_tr_InsertStr = "\"name\", \"name_ascii\""
const City_tr_InsertValuesStr = ":name, :name_ascii"
const City_tr_UpdateStr = "\"name\" = :name, \"name_ascii\" = :name_ascii"
const Company_InsertStr = "\"name\", \"city_geonameid\""
const Company_InsertValuesStr = ":name, :city_geonameid"
const Company_UpdateStr = "\"name\" = :name, \"city_geonameid\" = :city_geonameid"
const Continent_InsertStr = "\"iso_code\", \"geom\", \"created_at\", \"updated_at\""
const Continent_InsertValuesStr = ":iso_code, :geom, now(), now()"
const Continent_UpdateStr = "\"iso_code\" = :iso_code, \"geom\" = :geom, \"updated_at\" = now()"
const Continent_tr_InsertStr = "\"name\", \"name_ascii\""
const Continent_tr_InsertValuesStr = ":name, :name_ascii"
const Continent_tr_UpdateStr = "\"name\" = :name, \"name_ascii\" = :name_ascii"
const Country_InsertStr = "\"iso_code\", \"geom\", \"created_at\", \"updated_at\""
const Country_InsertValuesStr = ":iso_code, :geom, now(), now()"
const Country_UpdateStr = "\"iso_code\" = :iso_code, \"geom\" = :geom, \"updated_at\" = now()"
const Country_tr_InsertStr = "\"name\", \"name_ascii\""
const Country_tr_InsertValuesStr = ":name, :name_ascii"
const Country_tr_UpdateStr = "\"name\" = :name, \"name_ascii\" = :name_ascii"
const Database_InsertStr = "" /* 335-byte string literal not displayed */
const Database_InsertValuesStr = "" /* 263-byte string literal not displayed */
const Database_UpdateStr = "" /* 596-byte string literal not displayed */
const Database__continent_InsertStr = ""
const Database__continent_InsertValuesStr = ""
const Database__continent_UpdateStr = ""
const Database__country_InsertStr = ""
const Database__country_InsertValuesStr = ""
const Database__country_UpdateStr = ""
const Database_context_InsertStr = "\"database_id\", \"context\""
const Database_context_InsertValuesStr = ":database_id, :context"
const Database_context_UpdateStr = "\"database_id\" = :database_id, \"context\" = :context"
const Database_handle_InsertStr = "\"database_id\", \"import_id\", \"identifier\", \"url\", \"declared_creation_date\", \"created_at\""
const Database_handle_InsertValuesStr = ":database_id, :import_id, :identifier, :url, :declared_creation_date, now()"
const Database_handle_UpdateStr = "" /* 158-byte string literal not displayed */
const Database_tr_InsertStr = "" /* 167-byte string literal not displayed */
const Database_tr_InsertValuesStr = "" /* 140-byte string literal not displayed */
const Database_tr_UpdateStr = "" /* 318-byte string literal not displayed */
const Group_InsertStr = "\"type\", \"created_at\", \"updated_at\""
const Group_InsertValuesStr = ":type, now(), now()"
const Group_UpdateStr = "\"type\" = :type, \"updated_at\" = now()"
const Group__permission_InsertStr = "\"created_at\", \"updated_at\""
const Group__permission_InsertValuesStr = "now(), now()"
const Group__permission_UpdateStr = "\"updated_at\" = now()"
const Group_tr_InsertStr = "\"name\", \"description\""
const Group_tr_InsertValuesStr = ":name, :description"
const Group_tr_UpdateStr = "\"name\" = :name, \"description\" = :description"
const Import_InsertStr = "\"database_id\", \"user_id\", \"md5sum\", \"filename\", \"number_of_lines\", \"number_of_sites\", \"created_at\""
const Import_InsertValuesStr = ":database_id, :user_id, :md5sum, :filename, :number_of_lines, :number_of_sites, now()"
const Import_UpdateStr = "" /* 182-byte string literal not displayed */
const Lang_InsertStr = "\"active\""
const Lang_InsertValuesStr = ":active"
const Lang_UpdateStr = "\"active\" = :active"
const Lang_tr_InsertStr = "\"name\""
const Lang_tr_InsertValuesStr = ":name"
const Lang_tr_UpdateStr = "\"name\" = :name"
const License_InsertStr = "\"name\", \"url\""
const License_InsertValuesStr = ":name, :url"
const License_UpdateStr = "\"name\" = :name, \"url\" = :url"
const Map_layer_InsertStr = "" /* 318-byte string literal not displayed */
const Map_layer_InsertValuesStr = "" /* 249-byte string literal not displayed */
const Map_layer_UpdateStr = "" /* 564-byte string literal not displayed */
const Map_layer_tr_InsertStr = "\"name\", \"attribution\", \"copyright\", \"description\""
const Map_layer_tr_InsertValuesStr = ":name, :attribution, :copyright, :description"
const Map_layer_tr_UpdateStr = "\"name\" = :name, \"attribution\" = :attribution, \"copyright\" = :copyright, \"description\" = :description"
const Permission_InsertStr = "\"name\", \"created_at\", \"updated_at\""
const Permission_InsertValuesStr = ":name, now(), now()"
const Permission_UpdateStr = "\"name\" = :name, \"updated_at\" = now()"
const Permission_tr_InsertStr = "\"name\", \"description\""
const Permission_tr_InsertValuesStr = ":name, :description"
const Permission_tr_UpdateStr = "\"name\" = :name, \"description\" = :description"
const Photo_InsertStr = "\"photo\""
const Photo_InsertValuesStr = ":photo"
const Photo_UpdateStr = "\"photo\" = :photo"
const Project_InsertStr = "\"name\", \"user_id\", \"created_at\", \"updated_at\", \"start_date\", \"end_date\", \"geom\""
const Project_InsertValuesStr = ":name, :user_id, now(), now(), :start_date, :end_date, :geom"
const Project_UpdateStr = "" /* 138-byte string literal not displayed */
const Project__charac_InsertStr = ""
const Project__charac_InsertValuesStr = ""
const Project__charac_UpdateStr = ""
const Project__chronology_InsertStr = ""
const Project__chronology_InsertValuesStr = ""
const Project__chronology_UpdateStr = ""
const Project__database_InsertStr = ""
const Project__database_InsertValuesStr = ""
const Project__database_UpdateStr = ""
const Project__map_layer_InsertStr = ""
const Project__map_layer_InsertValuesStr = ""
const Project__map_layer_UpdateStr = ""
const Project__shapefile_InsertStr = ""
const Project__shapefile_InsertValuesStr = ""
const Project__shapefile_UpdateStr = ""
const Saved_query_InsertStr = "\"params\""
const Saved_query_InsertValuesStr = ":params"
const Saved_query_UpdateStr = "\"params\" = :params"
const Session_InsertStr = "\"value\""
const Session_InsertValuesStr = ":value"
const Session_UpdateStr = "\"value\" = :value"
const Shapefile_InsertStr = "" /* 245-byte string literal not displayed */
const Shapefile_InsertValuesStr = "" /* 191-byte string literal not displayed */
const Shapefile_UpdateStr = "" /* 428-byte string literal not displayed */
const Shapefile_tr_InsertStr = "\"name\", \"attribution\", \"copyright\", \"description\""
const Shapefile_tr_InsertValuesStr = ":name, :attribution, :copyright, :description"
const Shapefile_tr_UpdateStr = "\"name\" = :name, \"attribution\" = :attribution, \"copyright\" = :copyright, \"description\" = :description"
const Site_InsertStr = "" /* 233-byte string literal not displayed */
const Site_InsertValuesStr = "" /* 173-byte string literal not displayed */
const Site_UpdateStr = "" /* 400-byte string literal not displayed */
const Site_range_InsertStr = "\"site_id\", \"start_date1\", \"start_date2\", \"end_date1\", \"end_date2\", \"created_at\", \"updated_at\""
const Site_range_InsertValuesStr = ":site_id, :start_date1, :start_date2, :end_date1, :end_date2, now(), now()"
const Site_range_UpdateStr = "" /* 166-byte string literal not displayed */
const Site_range__charac_InsertStr = "\"site_range_id\", \"charac_id\", \"exceptional\", \"knowledge_type\""
const Site_range__charac_InsertValuesStr = ":site_range_id, :charac_id, :exceptional, :knowledge_type"
const Site_range__charac_UpdateStr = "" /* 132-byte string literal not displayed */
const Site_range__charac_tr_InsertStr = "\"comment\", \"bibliography\""
const Site_range__charac_tr_InsertValuesStr = ":comment, :bibliography"
const Site_range__charac_tr_UpdateStr = "\"comment\" = :comment, \"bibliography\" = :bibliography"
const Site_tr_InsertStr = "\"description\""
const Site_tr_InsertValuesStr = ":description"
const Site_tr_UpdateStr = "\"description\" = :description"
const User_InsertStr = "" /* 210-byte string literal not displayed */
const User_InsertValuesStr = "" /* 159-byte string literal not displayed */
const User_UpdateStr = "" /* 360-byte string literal not displayed */
const User__company_InsertStr = ""
const User__company_InsertValuesStr = ""
const User__company_UpdateStr = ""
const User__group_InsertStr = ""
const User__group_InsertValuesStr = ""
const User__group_UpdateStr = ""
const User_preferences_InsertStr = "\"value\""
const User_preferences_InsertValuesStr = ":value"
const User_preferences_UpdateStr = "\"value\" = :value"
Variables ¶
This section is empty.
Functions ¶
func GetCharacPathsFromLang ¶
func GetQueryTranslationsAsJSON ¶
GetQueryTranslationsAsJSON load translations from database
func GetQueryTranslationsAsJSONObject ¶
func GetQueryTranslationsAsJSONObject(tableName, where string, wrapTo string, noBrace bool, fields ...string) string
GetQueryTranslationsAsJSONObject load translations from database
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"` }
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
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"` }
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
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
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
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"` }
type CityAndCountry_wtr ¶
type CityAndCountry_wtr struct { City City_wtr `json:"city"` Country Country_wtr `json:"country"` }
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 }
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"` }
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_wtr ¶
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 ¶
AddContinents links continents to a database
func (*Database) AddCountries ¶
AddCountries links countries to a database
func (*Database) AnotherExistsWithSameName ¶
AnotherExistsWithSameName checks if database already exists with same name and owned by another user
func (*Database) CacheDates ¶
CacheDates get database sites extend and cache enveloppe
func (*Database) DeleteAuthors ¶
DeleteAuthors deletes the author linked to a database
func (*Database) DeleteContexts ¶
DeleteContexts deletes the context linked to a database
func (*Database) DeleteContinents ¶
DeleteContinents unlinks countries to a database
func (*Database) DeleteCountries ¶
DeleteCountries unlinks countries to a database
func (*Database) DeleteImports ¶
DeleteImports unlinks database import logs
func (*Database) DeleteSites ¶
DeleteSites deletes all sites linked to a database
func (*Database) DeleteSpecificHandle ¶
DeleteHandles unlinks handles
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 ¶
GetCountryList lists all countries linked to a database
func (*Database) GetFullInfos ¶
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 ¶
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 ¶
IsLinkedToProject returns true or false if database is linked or not to user project
func (*Database) LinkToUserProject ¶
LinkToUserProject links database to project
func (*Database) SetAuthors ¶
SetAuthors links users as authors to a database
func (*Database) SetContexts ¶
SetContexts links users as contexts to a database
func (*Database) SetTranslations ¶
func (*Database) UpdateFields ¶
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 {}
type Database__continent ¶
type Database__country ¶
type Database_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) GetPermissions ¶
func (g *Group) GetPermissions(tx *sqlx.Tx) (permissions []Permission, err error)
GetPermissions return an array of Permissions that the group have
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"` }
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"` }
type ImportFullInfos ¶
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 ¶
GetActiveLangs returns an array of Lang object which are actives only
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 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) DeleteAuthors ¶
DeleteAuthors deletes the author linked to a wms layer
func (*Map_layer) SetAuthors ¶
SetAuthors links users as authors to a wms layer
func (*Map_layer) SetPublicationState ¶
Set publication state of the map layer
type Map_layer__authors ¶
type Map_layer__authors struct {}
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_tr ¶
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"` }
type Project__charac ¶
type Project__chronology ¶
type Project__database ¶
type Project__map_layer ¶
type Project__shapefile ¶
type Project_hidden_characs ¶
type Project_hidden_characs struct {}
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 ¶
func (u *Project_hidden_characs) List(tx *sqlx.Tx) ([]Project_hidden_characs, error)
List return Project_hidden_characs of a Project
type Saved_query ¶
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) DeleteAuthors ¶
DeleteAuthors deletes the author linked to a shapefile
func (*Shapefile) SetAuthors ¶
SetAuthors links users as authors to a shapefile
func (*Shapefile) SetPublicationState ¶
Set publication state of the shapefile
type Shapefile__authors ¶
type Shapefile__authors struct {}
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"` }
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 ¶
CacheDates get database sites extend and cache enveloppe
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"` }
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 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) GetCompanies ¶
GetCompanies return an array of companies of the User
func (*User) GetLimited ¶
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 ¶
GetProjectId get the project of the user
func (*User) HaveAtLeastOnePermission ¶
HavePermissions return true if the user have all the wanted permissions
func (*User) HaveGroups ¶
HaveGroups return true if the user have all the wanted groups
func (*User) HavePermissions ¶
HavePermissions return true if the user have all the wanted permissions
func (*User) Login ¶
Login test the username/password couple, and return true if it is ok, false if not
func (*User) MakeNewPassword ¶
MakeNewPassword
func (*User) SetCompanies ¶
SetCompanies set user companies