Documentation
¶
Index ¶
- Variables
- func AddAlarmCustomer(groupID int64, customer string) (int64, error)
- func AddGroup(params *GroupParameters) (int64, error)
- func AddGroup2Alarm(groupID int64, customerID int64) (int64, error)
- func AddLayer(groupID, layerID int64) (int64, error)
- func AddPerm(userID int64, groupID int64, roleID int64) error
- func AddRole(params *RoleDetailParameters) (int64, error)
- func AddUser(user *UserDetails) (int64, error)
- func CheckCustomerAlarm(customerID int64, alarmID int64) (bool, error)
- func CheckCustomerArea(customerID int64, areaID int64) (bool, error)
- func CheckCustomerParticipant(customerID int64, participantID int64) (bool, error)
- func CheckGroupAlarmCustomer(groupID int64, customerID int64) (bool, error)
- func CheckLink(userID int64, hash string) (bool, error)
- func CheckUser(email string) (*int64, error)
- func CopyLayer(childID, parentID int64) error
- func CountAreaInAlarms(areaID int64) (int64, error)
- func CountLoginSuccess(logs []*Log) int
- func CountParticipantInAlarms(participantID int64) (int64, error)
- func FindUser(username, password string) (sql.NullInt64, error)
- func GenerateLink(https bool, email string, userID int64, serverName string) (string, error)
- func GeomContainsPoint(g wkt.Geom, point *wkt.Point) bool
- func GetChildren(id int64) ([]int64, error)
- func GetCount(start, stop int64, bound, box *Box, filter CountFilter) (int64, error)
- func GetHomeGroup(userID int64) (*int64, error)
- func GetLiveBlitzgebiet(userID int64) (wkt.Geom, error)
- func GetMenu(userID int64) ([]interface{}, error)
- func MultiPolygonContainsPoint(poly *wkt.MultiPolygon, point *wkt.Point) bool
- func PolygonContainsPoint(poly *wkt.Polygon, point *wkt.Point) bool
- func RemoveAlarm(alarm AlarmIDs) (int64, error)
- func RemoveAlarmArea(area AlarmAreaIDs) (int64, error)
- func RemoveAlarmParticipant(participant *AlarmParticipantIDs) (int64, error)
- func RemoveGroup(groupID int64) error
- func RemoveGroup2Alarm(groupID int64, customerID int64) (int64, error)
- func RemoveGroupLayers(groupID int64) error
- func RemoveLayer(id, userID int64) (bool, error)
- func RemovePerm(userID int64) error
- func RemoveRole(roleID int64) error
- func RemoveUser(userID int64) error
- func SendTestAlarm(alarm TestAlarm) (int64, error)
- func ThemeIDFromHost(host string, def int64) (int64, error)
- func UpdateAlarm(areaID, participantID int64, alarmID *int64, customerID int64) (int64, error)
- func UpdateAlarmArea(area *AlarmArea) (*int64, error)
- func UpdateAlarmParticipant(participantInfo *ParticipantInfo) (*int64, error)
- func UpdateLayer(layer *LayerInfo, groupID int64) error
- func UpdatePassword(password string, userID int64, hash string, ip string) error
- func UpdatePermission(permission *PermissionParameters) error
- func UpdateRole(role *RoleDetail) error
- func UpdateUser(user *UserDetails) error
- func UserLogging(user int64, request string, ip net.IP, session string) error
- func UserLoggingNoSession(request string, ip net.IP) error
- type AlarmArea
- type AlarmAreaGroup
- type AlarmAreaIDs
- type AlarmAreaInfo
- type AlarmAreaList
- type AlarmAreaListSimple
- type AlarmCustomer
- type AlarmDetail
- type AlarmIDs
- type AlarmMessages
- type AlarmParticipantIDs
- type AlarmParticipants
- type AlarmParticipantsListSimple
- type Area
- type BBox
- type Box
- type CountFilter
- type DependendObjectsError
- type FakeBool
- type Group
- type GroupDetail
- type GroupDetailSmall
- type GroupNode
- type GroupParameters
- type GroupTree
- type GroupUpdateResult
- type Layer
- type LayerInfo
- type Log
- type ParticipantInfo
- type Permission
- type PermissionList
- type PermissionParameters
- type Permissions
- type RoleDetail
- type RoleDetailParameters
- type ShowLogParameters
- type StatisticsFilter
- type StatisticsItem
- type TestAlarm
- type Theme
- type User
- type UserDetails
- type UserShort
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUnknownStatisticsFilter is returned if an unknown statistics filter // is given. ErrUnknownStatisticsFilter = errors.New("unknown statistics filter") // ErrUnknownCountFilter is returned if an unknown counting filter // is given. ErrUnknownCountFilter = errors.New("unknown count filter type") )
Functions ¶
func AddGroup ¶
func AddGroup(params *GroupParameters) (int64, error)
func AddGroup2Alarm ¶
AddGroup2Alarm adds a grouo to an alarm.
func AddRole ¶
func AddRole(params *RoleDetailParameters) (int64, error)
func AddUser ¶
func AddUser(user *UserDetails) (int64, error)
func CheckCustomerAlarm ¶
CheckCustomerAlarm checks if there is any customer for a given alarm.
func CheckCustomerArea ¶
CheckCustomerArea checks if there are any customers for an area.
func CheckCustomerParticipant ¶
CheckCustomerParticipant checks if there is any customer for a participant.
func CheckGroupAlarmCustomer ¶
CheckGroupAlarmCustomer checks if there are any constomers in a group.
func CountAreaInAlarms ¶
CountAreaInAlarms counts the alarms in a given area.
func CountLoginSuccess ¶
CountLoginSuccess counts the successfull logins.
func CountParticipantInAlarms ¶
CountParticipantInAlarms counts the alarm participants,
func FindUser ¶
FindUser looks for a user with a password. If they both match the ID of the user is returned.
func GenerateLink ¶
func GeomContainsPoint ¶
GeomContainsPoint checks if a point is inside a given geometry.
func GetChildren ¶
func GetCount ¶
func GetCount(start, stop int64, bound, box *Box, filter CountFilter) (int64, error)
GetCount returns a event count for a given time range between start and stop, an optional bounding box and a count filter.
func GetHomeGroup ¶
func GetLiveBlitzgebiet ¶
GetLiveBlitzgebiet returns the geometry of a given userID.
func MultiPolygonContainsPoint ¶
func MultiPolygonContainsPoint(poly *wkt.MultiPolygon, point *wkt.Point) bool
MultiPolygonContainsPoint checks if a multi-polygon contains a given point.
func PolygonContainsPoint ¶
PolygonContainsPoint checks if a polygon contains a given point.
func RemoveAlarm ¶
func RemoveAlarmArea ¶
func RemoveAlarmArea(area AlarmAreaIDs) (int64, error)
func RemoveAlarmParticipant ¶
func RemoveAlarmParticipant(participant *AlarmParticipantIDs) (int64, error)
func RemoveGroup ¶
func RemoveGroup2Alarm ¶
RemoveGroup2Alarm removes a group from an alarm.
func RemoveGroupLayers ¶
func RemoveLayer ¶
func RemovePerm ¶
func RemoveRole ¶
func RemoveUser ¶
func SendTestAlarm ¶
func UpdateAlarm ¶
func UpdateAlarmArea ¶
func UpdateAlarmParticipant ¶
func UpdateAlarmParticipant(participantInfo *ParticipantInfo) (*int64, error)
func UpdateLayer ¶
func UpdatePassword ¶
func UpdatePermission ¶
func UpdatePermission(permission *PermissionParameters) error
func UpdateRole ¶
func UpdateRole(role *RoleDetail) error
func UpdateUser ¶
func UpdateUser(user *UserDetails) error
func UserLogging ¶
UserLogging loggs in a user an binds her to the session.
Types ¶
type AlarmArea ¶
type AlarmArea struct { AreaName *string `json:"gebietname"` AreaRadius *float64 `json:"radius"` AreaInnerRadius *float64 `json:"innerradius"` AreaGeom *string `json:"geometry"` AlarmDuration *int64 `json:"dauer"` AlarmThreshold *int64 `json:"blitzezumalarm"` AreaLat *float64 `json:"breite"` AreaLon *float64 `json:"laenge"` CustomerID *int64 `json:"kundenid"` GroupID *int64 `json:"gruppe"` ID *int64 `json:"id"` }
AlarmArea are the in-depth informations about an alarm area.
type AlarmAreaGroup ¶
type AlarmAreaGroup struct { ID int64 `json:"id"` GroupName string `json:"gruppenname"` Alarm *FakeBool `json:"alarm"` Customer int64 `json:"kunde"` CustomerName string `json:"kundenname"` Areas interface{} `json:"gebiete"` }
AlarmAreaGroup are the detail passed to the JS client about an alarm area group.
func GetAlarmAreaGroupList ¶
func GetAlarmAreaGroupList(groupID int64) ([]*AlarmAreaGroup, error)
type AlarmAreaIDs ¶
type AlarmAreaIDs struct { ID *int64 `json:"id"` CustomerID *int64 `json:"kundeid"` GroupID *int64 `json:"gruppe"` Cascade *bool `json:"cascade"` }
AlarmAreaIDs maps an alarm to a customer and a group.
type AlarmAreaInfo ¶
type AlarmAreaInfo struct { Name string `json:"name"` Count int64 `json:"count"` Geom string `json:"geom"` }
AlarmAreaInfo is used as a JSON serialisation of the attributes associated with an alarm area.
func GetAlarmArea ¶
func GetAlarmArea(id int64) (*AlarmAreaInfo, error)
GetAlarmArea return an AlarmAreaInfo for a given userID.
type AlarmAreaList ¶
type AlarmAreaList struct { ID int64 `json:"id"` Area string `json:"gebiet"` Length float64 `json:"laenge"` Wide float64 `json:"breite"` AreasRadius float64 `json:"radius"` AreasInnerRadius float64 `json:"innerRadius"` AreasBlidsAlarm int64 `json:"blitzezumalarm"` Last string `json:"letzter"` Number int64 `json:"anzahl"` Surface float64 `json:"flach"` AreasAlarmDuration int64 `json:"alarmdauer"` CustomerID int64 `json:"kundenid"` Customer string `json:"kunde"` Geometry *string `json:"geometry"` GeoJSON *interface{} `json:"geojson"` }
AlarmAreaList is an item of a alarm area list in the JS client.
func GetAlarmGebietList ¶
func GetAlarmGebietList(groupID int64, areaID *int64) ([]*AlarmAreaList, error)
type AlarmAreaListSimple ¶
type AlarmAreaListSimple struct { ID int64 `json:"id"` Area string `json:"gebiet"` CustomerID int64 `json:"kundenid"` }
AlarmAreaListSimple binds an alarm area to a customer.
func GetAlarmAreaListSimple ¶
func GetAlarmAreaListSimple(groupID int64) ([]*AlarmAreaListSimple, error)
type AlarmCustomer ¶
AlarmCustomer is the ID and the name of a customer.
func GetAlarmCustomerList ¶
func GetAlarmCustomerList(groupID int64) ([]*AlarmCustomer, error)
type AlarmDetail ¶
type AlarmDetail struct { AreasBlidsToAlarm int64 `json:"blitzezumalarm"` Duration int64 `json:"dauer"` AreasBlidsNumber int64 `json:"blitzanzahl"` AreasRadius float64 `json:"radius"` AreasAlarm *FakeBool `json:"alarm"` AreasArea string `json:"gebiet"` AreaID int64 `json:"gebietid"` ParticipantStartTime string `json:"startzeit"` ParticipantStopTime string `json:"stopzeit"` Start string `json:"beginn"` End string `json:"ende"` ParticipantMon *FakeBool `json:"mo"` ParticipantTue *FakeBool `json:"di"` ParticipantWed *FakeBool `json:"mi"` ParticipantThu *FakeBool `json:"don"` ParticipantFri *FakeBool `json:"fr"` ParticipantSat *FakeBool `json:"sa"` ParticipantSun *FakeBool `json:"so"` ParticipantOnlyLog *FakeBool `json:"nurlog"` ParticipantUTC *FakeBool `json:"utc"` Protocol *FakeBool `json:"protocol"` CSV *FakeBool `json:"csv"` ParticipantSMS string `json:"sms"` ParticipantEMail string `json:"email"` ParticipantFax string `json:"fax"` ParticipantTel string `json:"tel"` ParticipantParticipant string `json:"teilnehmer"` ParticipantID int64 `json:"teilnehmerid"` AreaGroupsGroupsName string `json:"gruppenname"` AlarmID int64 `json:"alarmid"` AlarmCustomerID int64 `json:"alarmkundeid"` CustomerCustomer string `json:"kunde"` Last string `json:"letzter"` Centerx float64 `json:"centerx"` Centery float64 `json:"centery"` Area float64 `json:"flach"` }
AlarmDetail are the in-depth informations of an alarm.
func GetAlarmList ¶
func GetAlarmList(groupID int64) ([]*AlarmDetail, error)
type AlarmIDs ¶
type AlarmIDs struct { ID *int64 `json:"alarmid"` CustomerID *int64 `json:"kundeid"` GroupID *int64 `json:"groupid"` }
AlarmIDs maps an alarm ID to a customer and a group.
type AlarmMessages ¶
type AlarmMessages struct { Start string `json:"anf"` End string `json:"ende"` ID int64 `json:"id"` Alarm int64 `json:"alarm"` Entry string `json:"eintrag"` Finished string `json:"finished"` Typ string `json:"typ"` }
AlarmMessages is an item in the the list of alarm messages.
func GetAlarmMessages ¶
func GetAlarmMessages(alarmID int64, startString, endString string) ([]*AlarmMessages, error)
type AlarmParticipantIDs ¶
type AlarmParticipantIDs struct { ID *int64 `json:"id"` CustomerID *int64 `json:"kunde"` GroupID *int64 `json:"gruppe"` Cascade *bool `json:"cascade"` }
AlarmParticipantIDs are used to pass the customer IDs from the JS client to the server.
type AlarmParticipants ¶
type AlarmParticipants struct { ID int64 `json:"id"` Participant string `json:"teilnehmer"` SMS string `json:"sms"` EMail string `json:"email"` Fax string `json:"fax"` Tel string `json:"tel"` Alarm string `json:"alarmierung"` AllClear string `json:"entwarnung"` Customer int64 `json:"kunde"` StartDate string `json:"startdatum"` StopDate string `json:"stopdatum"` StartTime string `json:"startzeit"` StopTime string `json:"stopzeit"` Mon *FakeBool `json:"mo"` Tue *FakeBool `json:"di"` Wed *FakeBool `json:"mi"` Thu *FakeBool `json:"don"` Fri *FakeBool `json:"fr"` Sat *FakeBool `json:"sa"` Sun *FakeBool `json:"so"` OnlyLog *FakeBool `json:"nurlog"` UTC *FakeBool `json:"utc"` SubjectAlarm string `json:"betreffalarm"` SubjectAllClear string `json:"betreffentwarn"` BlidsLog *FakeBool `json:"blitzprotokoll"` BlidsASCSV *FakeBool `json:"blitzascsv"` Begin string `json:"anfang"` End string `json:"ende"` Active *FakeBool `json:"aktiv"` CustomerName string `json:"kundenname"` }
AlarmParticipants are the details about an alarm participant.
func GetAlarmParticipantsList ¶
func GetAlarmParticipantsList(groupID int64, participantID *int64) ([]*AlarmParticipants, error)
type AlarmParticipantsListSimple ¶
type AlarmParticipantsListSimple struct { ID int64 `json:"id"` Participant string `json:"teilnehmer"` Customer string `json:"kunde"` }
AlarmParticipantsListSimple binds a participant to a customer.
func GetAlarmParticipantsListSimple ¶
func GetAlarmParticipantsListSimple(groupID int64) ([]*AlarmParticipantsListSimple, error)
type BBox ¶
BBox is a bounding box of an area.
func CalculateBBox ¶
CalculateBBox return the bounding box of given geometry.
type Box ¶
type Box struct { Left *float64 `json:"left"` Right *float64 `json:"right"` Top *float64 `json:"top"` Bottom *float64 `json:"bottom"` StatisticBox *string `json:"statistikbox"` SWindowed FakeBool `json:"swindow"` }
Box is used a JSON serialisation of a bounding box with optional fields.
type CountFilter ¶
type CountFilter int
CountFilter limits counts to certain attributes.
const ( // CountWithoutFilter does not filter at all. CountWithoutFilter CountFilter = iota // CountType4Filter only counts type = 4 events. CountType4Filter // CountType1PosFilter only counts type = 1 and positive events. CountType1PosFilter // CountType1NegFilter only counts type = 1 and negative events. CountType1NegFilter )
type DependendObjectsError ¶
DependendObjectsError models an DB error with a number of depended objects. Used eg. if a deletion fails because there are dependend objects.
func (DependendObjectsError) Error ¶
func (e DependendObjectsError) Error() string
Error fulfill the error interface.
type FakeBool ¶
type FakeBool bool
FakeBool is a bool read/written from/to as "t" and "f" when used in JSON serialisations.
func FakeBoolPointer ¶
FakeBoolPointer returns a pointer to a FakeBool with the value of the given bool.
func (FakeBool) MarshalJSON ¶
MarshalJSON fulfill the JSON writing part.
func (*FakeBool) UnmarshalJSON ¶
UnmarshalJSON fulfill the JSON readinng part.
type GroupDetail ¶
type GroupDetail struct { ID int64 `json:"id"` FatherGroupID *int64 `json:"vatergruppe,omitempty"` GroupName *string `json:"gruppenname,omitempty"` ThemeID *int64 `json:"theme_id,omitempty"` Area *string `json:"blitzgebiet,omitempty"` MaxDisplayTime *int64 `json:"max_displayzeit,omitempty"` ArchiveDays *int64 `json:"archiv_tage,omitempty"` ArchiveSince *string `json:"archiv_ab"` MaxZoom int64 `json:"max_zoom"` MinZoom int64 `json:"min_zoom"` Sound *FakeBool `json:"sound,omitempty"` LiveBlids *FakeBool `json:"liveblids,omitempty"` Animation *FakeBool `json:"animation"` }
GroupDetail are the in-depth informations about a group.
func GetGroupDetail ¶
func GetGroupDetail(groupID, adminID int64) (*GroupDetail, error)
type GroupDetailSmall ¶
type GroupDetailSmall struct { ID int64 `json:"id"` FatherID *int64 `json:"vatergruppenid"` Length *float64 `json:"laenge"` Width *float64 `json:"breite"` Area *string `json:"alarmgebiet"` GroupName string `json:"gruppenname"` AlarmCustomers int64 `json:"alarmkunden"` Rights *Permissions `json:"rights"` }
GroupDetailSmall are the short informations about a group.
func GetGroupDetailSmall ¶
func GetGroupDetailSmall(userID, groupID int64) (*GroupDetailSmall, error)
type GroupParameters ¶
type GroupParameters struct { ID *int64 `json:"id"` GroupName *string `json:"gruppenname"` ParentID *int64 `json:"vatergruppe"` ArchiveSince *string `json:"archiv_ab"` ArchiveDays *int64 `json:"archiv_tage"` LatMin *string `json:"latmin"` LatMax *string `json:"latmax"` LonMin *string `json:"lonmin"` LonMax *string `json:"lonmax"` MinZoom *int64 `json:"min_zoom"` MaxZoom *int64 `json:"max_zoom"` Sound *FakeBool `json:"sound"` ThemeID *int64 `json:"theme_id"` MaxDisplayTime *int64 `json:"max_displayzeit"` LiveBlids *FakeBool `json:"liveblids"` Animation *FakeBool `json:"animation"` }
GroupParameters are used to create or update a group.
type GroupTree ¶
GroupTree maps user IDs to the trees of groups the users belong to.
func BuildGroupTree ¶
BuildGroupTree loads the complete tree of groups into memory allowing a fast lookup of which groups a user is in.
type GroupUpdateResult ¶
type GroupUpdateResult struct { ID int64 `json:"id"` GroupName *string `json:"gruppenname"` Box *string `json:"box"` }
GroupUpdateResult represents the update result of a group.
func UpdateGroup ¶
func UpdateGroup(in *GroupParameters) (*GroupUpdateResult, error)
type Layer ¶
type Layer struct { GeoName string `json:"geoname"` DisplayName string `json:"displayname"` Filter interface{} `json:"filter"` PopupTemplate string `json:"popup_template"` ReloadTime int64 `json:"reload_time"` FeatureInfo FakeBool `json:"feature_info"` CheckedOnLogin FakeBool `json:"checked_onlogin"` Permanent FakeBool `json:"permanent"` SingleTile FakeBool `json:"single_tile"` TimeDependent FakeBool `json:"timedependent"` ExternerServer string `json:"externer_server"` ExternerParameter string `json:"externer_parameter"` }
Layer is used to send JSON encoded data about a layer to the JS client.
func LoadLayers ¶
LoadLayers returns the list of layers belonging to a given user.
type LayerInfo ¶
type LayerInfo struct { ID int64 `json:"id"` LayerID *int64 `json:"ebenen_id"` ReloadTime int64 `json:"reload_time"` DisplayName string `json:"anzeige_name"` FeatureInfo FakeBool `json:"feature_info"` CheckedOnLogin FakeBool `json:"checked_onlogin"` Permanent FakeBool `json:"permanent"` StandardName *string `json:"standardname"` }
LayerInfo is used to represents the details of a layer.
func GetLayerList ¶
type Log ¶
type Log struct { ID int64 `json:"id"` UserName string `json:"benutzer"` Date string `json:"datum"` Request string `json:"request"` IP string `json:"ip"` Session string `json:"session"` }
Log is used as a JSON serialisation send containing a logging data set.
func ShowLog ¶
func ShowLog(slp *ShowLogParameters) ([]*Log, error)
ShowLog is used to fetch logging informations for given ShowLogParameters.
type ParticipantInfo ¶
type ParticipantInfo struct { ID *int64 `json:"id"` GroupID int64 `json:"gruppe"` GroupName string `json:"gruppenname"` CustomerID int64 `json:"kundenid"` Participant string `json:"teilnehmer"` SelectedCustomer AlarmCustomer `json:"selectedkunde"` Start string `json:"anfang"` End string `json:"ende"` StartTime string `json:"startzeit"` StopTime string `json:"stopzeit"` Typ string `json:"typ"` UTC string `json:"utc"` BlitzASCSV FakeBool `json:"blitzascsv"` BlidsLog FakeBool `json:"blitzprotokoll"` OnlyLog FakeBool `json:"nurlog"` Mon FakeBool `json:"mo"` Tue FakeBool `json:"di"` Wed FakeBool `json:"mi"` Thu FakeBool `json:"don"` Fri FakeBool `json:"fr"` Sat FakeBool `json:"sa"` Sun FakeBool `json:"so"` EMail string `json:"email"` SMS string `json:"sms"` Fax string `json:"fax"` Tel string `json:"tel"` Alarming string `json:"alarmierung"` AllClear string `json:"entwarnung"` Default *FakeBool `json:"default"` }
ParticipantInfo are the in-depth informations about an alarm participant.
type Permission ¶
type Permission string
Permission models a permission.
func LoadAdminRights ¶
func LoadAdminRights(userID int64) (Permission, error)
func (Permission) Any ¶
func (p Permission) Any(vs ...string) bool
Any checks if the permission is any from the given arguments.
type PermissionList ¶
type PermissionList struct { UserName string `json:"benutzername"` UserID int64 `json:"benutzer_id"` GroupName string `json:"gruppenname"` GroupID int64 `json:"gruppen_id"` RoleName string `json:"rollenname"` RoleID int64 `json:"rollen_id"` }
PermissionList models the permission of user in respect to a group and a role.
func GetPermissionList ¶
func GetPermissionList() ([]*PermissionList, error)
type PermissionParameters ¶
type PermissionParameters struct { GroupID *int64 `json:"groupid"` OldGroupID *int64 `json:"oldgroupid"` RoleID *int64 `json:"roleid"` OldRoleID *int64 `json:"oldroleid"` UserID *int64 `json:"userid"` }
PermissionParameters is used to update the role permissions.
type Permissions ¶
type Permissions struct { Rolename string `json:"-"` AllowLogin bool `json:"-"` AlarmAdmin Permission `json:"alarm_admin"` AlarmAreas Permission `json:"alarm_gebiete"` AlarmAreaGroup Permission `json:"alarm_gebietgruppen"` AlarmParticipant Permission `json:"alarm_teilnehmer"` AlarmAlarms Permission `json:"alarm_alarme"` UserAdmin Permission `json:"user_admin"` GroupAdmin Permission `json:"gruppen_admin"` // Arifical permission AlarmSuperAdmin Permission `json:"alarm_super_admin"` }
Permissions is the typical set of permissions of a logged in user.
func GetUserPermission ¶
func GetUserPermission(userID, groupID int64) (*Permissions, error)
GetUserPermission fetches the permissions of a user in respect of a given group.
type RoleDetail ¶
type RoleDetail struct { ID int64 `json:"id"` RoleName string `json:"rollenname"` CanLogIn *FakeBool `json:"kann_einloggen"` AlarmAdmin string `json:"alarm_admin"` AlarmArea string `json:"alarm_gebiete"` AlarmAreaGroups string `json:"alarm_gebietgruppen"` AlarmParticipants string `json:"alarm_teilnehmer"` AlarmAlarms string `json:"alarm_alarme"` UserAdmin string `json:"user_admin"` GroupsAdmin string `json:"gruppen_admin"` BlidsCounter string `json:"blids_counter"` }
RoleDetail is used the represents the in-depth details of a role.
func GetRoleDetail ¶
func GetRoleDetail(roleID int64) (*RoleDetail, error)
func GetRoleList ¶
func GetRoleList() ([]*RoleDetail, error)
type RoleDetailParameters ¶
type RoleDetailParameters struct { ID *int64 `json:"id"` RoleName *string `json:"rollenname"` CanLogIn *FakeBool `json:"kann_einloggen"` AlarmAdmin *string `json:"alarm_admin"` AlarmArea *string `json:"alarm_gebiete"` AlarmAreaGroups *string `json:"alarm_gebietgruppen"` AlarmParticipants *string `json:"alarm_teilnehmer"` AlarmAlarms *string `json:"alarm_alarme"` UserAdmin *string `json:"user_admin"` GroupsAdmin *string `json:"gruppen_admin"` }
RoleDetailParameters are used to update or create a role.
type ShowLogParameters ¶
type ShowLogParameters struct { GroupID *int64 `json:"group"` StartTime *string `json:"start"` StopTime *string `json:"stop"` }
ShowLogParameters are used as JSON serialisation to request logging data.
type StatisticsFilter ¶
type StatisticsFilter int
StatisticsFilter is a filter to extract special statistical features.
const ( // StatisticsWithoutFilter does not filter at all. StatisticsWithoutFilter StatisticsFilter = iota // StatisticsType1Filter only shows statistics where type = 1. StatisticsType1Filter )
type StatisticsItem ¶
StatisticsItem is a pair of a date and a count. Used for JSON serialisation.
func GetStatistics ¶
func GetStatistics( start, stop int64, bound, box *Box, filter StatisticsFilter) ([]*StatisticsItem, error)
GetStatistics creates time series for a given time range, an area, an optional bounding box and a filter.
type TestAlarm ¶
type TestAlarm struct { ID *int64 `json:"alarmid"` CustomerID *int64 `json:"kundeid"` GroupID *int64 `json:"groupid"` Typ *int32 `json:"alarmtyp"` }
TestAlarm is used to pass the test alarm parameters to the server.
type Theme ¶
type Theme struct { Name string `json:"name"` Header string `json:"header"` Style string `json:"style"` Title string `json:"title"` }
Theme is used send JSON encoded information about a theme to be applied.
type User ¶
type User struct { ID int64 `json:"id"` UserName string `json:"username"` Start string `json:"start"` Stop string `json:"stop"` Bounds string `json:"bounds"` MaxDisplayZeit int64 `json:"max_displayzeit"` ArchivTage int64 `json:"archiv_tage"` ArchivAb string `json:"archiv_ab"` MaxZoom int64 `json:"max_zoom"` MinZoom int64 `json:"min_zoom"` LoginAllowed FakeBool `json:"loginallowed"` LiveBlids FakeBool `json:"liveblids"` Animation FakeBool `json:"animation"` Sound FakeBool `json:"sound"` ThemeID int64 `json:"theme_id"` StatistikWindowed FakeBool `json:"statistik_windowed"` Statistikgebiet FakeBool `json:"statistikgebiet"` }
User is used to send JSON encoded data about the logged in user to the JS client.
func ValidateUser ¶
ValidateUser loggs a user and extracts the relevant user data to be return to the JS client.
type UserDetails ¶
type UserDetails struct { ID *int64 `json:"id"` UserName string `json:"benutzername"` HomeGroupID int64 `json:"home_gruppen_id"` GroupName *string `json:"gruppenname"` StartDate string `json:"startdatum"` StopDatum string `json:"stopdatum"` FirstName *string `json:"firstname"` LastName string `json:"lastname"` Company string `json:"company"` Division *string `json:"division"` // The DB is using streetadress w/o second 'd'. StreetAddress *string `json:"streetaddress"` ZIP *string `json:"zip"` City *string `json:"city"` PhoneNumber *string `json:"phonenumber"` Annotation *string `json:"annotation"` Password *string `json:"passwort"` }
UserDetails are the in-depth informations about a user.
func GetUserDetails ¶
func GetUserDetails(userID, adminID int64) (*UserDetails, error)