Documentation
¶
Overview ¶
Package note errors.go contains programmatically-testable error strings
Index ¶
- Constants
- func BodyToObject(body *map[string]interface{}, object interface{}) (err error)
- func ErrorClean(err error) error
- func ErrorContains(err error, errKeyword string) bool
- func ErrorJSON(message string, err error) (rspJSON []byte)
- func ErrorString(err error) string
- func JSONMarshal(v interface{}) ([]byte, error)
- func JSONMarshalIndent(v interface{}, prefix, indent string) ([]byte, error)
- func JSONToBody(bodyJSON []byte) (body map[string]interface{}, err error)
- func JSONUnmarshal(data []byte, v interface{}) (err error)
- func ObjectToBody(object interface{}) (body map[string]interface{}, err error)
- func ObjectToJSON(object interface{}) (bodyJSON []byte, err error)
- func WordToNumber(word string) (num uint, success bool)
- func WordsFromNumber(number uint32) string
- func WordsFromString(in string) (out string)
- func WordsToNumber(words string) (num uint32, found bool)
- type DeviceSession
- type DeviceUsage
- type Event
- type EventApp
- type EventContact
- type EventContacts
- type EventLogEntry
- type History
- type Info
- type Message
- type MessageAddress
- type MessageContact
- type Note
- func (note *Note) Close()
- func (note *Note) Dup() Note
- func (note *Note) EndpointID() string
- func (note *Note) GetBody() []byte
- func (note *Note) GetConflicts() []Note
- func (note *Note) GetModified() (isAvailable bool, endpointID string, when string, where string, updates int32)
- func (note *Note) GetPayload() []byte
- func (note *Note) HasConflicts() bool
- func (note *Note) SetBody(body []byte) (err error)
- func (note *Note) SetPayload(payload []byte)
- type NotefileInfo
- type TowerLocation
- type Word
Constants ¶
const ACActionAnd = "&"
ACActionAnd ensures that all of these actions are allowed
const ACActionCreate = "create"
ACActionCreate (golint)
const ACActionDelete = "delete"
ACActionDelete (golint)
const ACActionMonitor = "monitor"
ACActionMonitor (golint)
const ACActionOr = "|"
ACActionOr ensures that any of these actions are allowed
const ACActionRead = "read"
ACActionRead (golint)
const ACActionUpdate = "update"
ACActionUpdate (golint)
const ACResourceAccount = "account:"
ACResourceAccount is an account resource, which is the accountUID that always begins with this string
const ACResourceAccounts = "account:*"
ACResourceAccounts is the resource for all accounts and all meta-account-level actions
const ACResourceApp = "app:"
ACResourceApp is the app (project) resource, which is the appUID that always begins with this string
const ACResourceApps = "app:*"
ACResourceApps is the resource for all apps
const ACResourceDevice = "dev:"
ACResourceDevice is the device resource, which is the deviceUID that always begins with this string
const ACResourceDevices = "dev:*"
ACResourceDevices is the resource for all devices
const ACResourceNotecardFirmwares = "notecard:*"
ACResourceNotecardFirmwares is the resource for all notecard firmware
const ACResourceNotefarms = "notefarm:*"
ACResourceNotefarms is the resource for all notefarm descriptors
const ACResourceNotefile = "file:"
ACResourceNotefile is the notefile resource and its note-level actions, which is the notefileID prefixed with this string
const ACResourceNotefiles = "file:*"
ACResourceNotefiles is the resource for all notefiles and all meta-notefile-level actions
const ACResourceRoute = "route:"
ACResourceRoute is an route resource, which is the routeUID that always begins with this string
const ACResourceRoutes = "route:*"
ACResourceRoutes is the resource for all routes and all meta-route-level actions
const ACResourceSep = ":"
ACResourceSep is the separator for building compound resource names
const ACResourceUserFirmwares = "firmware:*"
ACResourceUserFirmwares is the resource for all user firmware
const ACValidActionsAccount = "account:create,account:read,account:update,account:delete"
ACValidActionsAccount are actions allowed on accounts
const ACValidActionsApp = "app:create,app:read,app:update,app:delete,app:monitor"
ACValidActionsApp are actions allowed on apps
const ACValidActionsDev = "dev:read,dev:update,dev:delete,dev:monitor"
ACValidActionsDev are actions allowed on devices
const ACValidActionsFile = "file:create,file:read,file:update,file:delete"
ACValidActionsFile are actions allowed on notefiles
const ACValidActionsFirmware = "firmware:create,firmware:read,firmware:update,firmware:delete"
ACValidActionsFirmware are actions allowed on user firmware
const ACValidActionsNotecard = "notecard:create,notecard:read,notecard:update,notecard:delete"
ACValidActionsNotecard are actions allowed on notecard firmware
const ACValidActionsRoute = "route:create,route:read,route:update,route:delete"
ACValidActionsRoute are actions allowed on routes
const ContactOwnerNoteID = "owner"
ContactOwnerNoteID indicates that this is my contact
const ContactStore = "contacts.db"
ContactStore is the place where the user retains contact info
const DefaultDeviceEndpointID = ""
DefaultDeviceEndpointID is the default endpoint name of the edge, chosen for its length in protocol messages
const DefaultHubEndpointID = "1"
DefaultHubEndpointID is the default endpoint name of the hub, chosen for its length in protocol messages
const ErrAccessDenied = "{access-denied}"
ErrAccessDenied (golint)
const ErrAppDeleted = "{app-deleted}"
ErrAppDeleted (golint)
const ErrAppExists = "{app-exists}"
ErrAppExists (golint)
const ErrAppNotFound = "{app-noexist}"
ErrAppNotFound (golint)
const ErrAppNotSpecified = "{app-none}"
ErrAppNotSpecified (golint)
const ErrAuth = "{auth}"
ErrAuth (golint)
const ErrCardIo = "{io}"
ErrCardIo (golint)
const ErrClosed = "{closed}"
ErrClosed (golint)
const ErrDeviceDisabled = "{device-disabled}"
ErrDeviceDisabled (golint)
const ErrDeviceNotFound = "{device-noexist}"
ErrDeviceNotFound (golint)
const ErrDeviceNotSpecified = "{device-none}"
ErrDeviceNotSpecified (golint)
const ErrFileNoExist = "{file-noexist}"
ErrFileNoExist (golint)
const ErrFleetNotFound = "{fleet-noexist}"
ErrFleetNotFound (golint)
const ErrHubNoHandler = "{no-handler}"
ErrHubNoHandler (golint)
const ErrIdle = "{idle}"
ErrIdle (golint)
const ErrNoteExists = "{note-exists}"
ErrNoteExists (golint)
const ErrNoteNoExist = "{note-noexist}"
ErrNoteNoExist (golint)
const ErrNotefileExists = "{notefile-exists}"
ErrNotefileExists (golint)
const ErrNotefileInUse = "{notefile-in-use}"
ErrNotefileInUse (golint)
const ErrNotefileName = "{notefile-bad-name}"
ErrNotefileName (golint)
const ErrNotefileNoExist = "{notefile-noexist}"
ErrNotefileNoExist (golint)
const ErrNotefileQueueDisallowed = "{notefile-queue-disallowed}"
ErrNotefileQueueDisallowed (golint)
const ErrProductNotFound = "{product-noexist}"
ErrProductNotFound (golint)
const ErrProductNotSpecified = "{product-none}"
ErrProductNotSpecified (golint)
const ErrTicket = "{ticket}"
ErrTicket (golint)
const ErrTimeout = "{timeout}"
ErrTimeout (golint)
const ErrTrackerExists = "{tracker-exists}"
ErrTrackerExists (golint)
const ErrTrackerNoExist = "{tracker-noexist}"
ErrTrackerNoExist (golint)
const ErrTransportConnectFailure = "{connect-failure}"
ErrTransportConnectFailure (golint)
const ErrTransportConnected = "{connected}"
ErrTransportConnected (golint)
const ErrTransportConnectedClosed = "{connected-closed}"
ErrTransportConnectedClosed (golint)
const ErrTransportConnecting = "{connecting}"
ErrTransportConnecting (golint)
const ErrTransportDisconnected = "{disconnected}"
ErrTransportDisconnected (golint)
const ErrTransportWaitData = "{wait-data}"
ErrTransportWaitData (golint)
const ErrTransportWaitGateway = "{wait-gateway}"
ErrTransportWaitGateway (golint)
const ErrTransportWaitModule = "{wait-module}"
ErrTransportWaitModule (golint)
const ErrTransportWaitService = "{wait-service}"
ErrTransportWaitService (golint)
const EventAdd = "note.add"
EventAdd (golint)
const EventDelete = "note.delete"
EventDelete (golint)
const EventGeolocation = "device.geolocation"
EventGeolocation (golint)
const EventGet = "get"
EventGet (golint)
const EventNoAction = ""
EventNoAction (golint)
const EventPost = "post"
EventPost (golint)
const EventPut = "put"
EventPut (golint)
const EventSession = "session.begin"
EventSession (golint)
const EventTest = "test"
EventTest (golint)
const EventUpdate = "note.update"
EventUpdate (golint)
const GeolocationNotefile = "_geolocate.qo"
GeolocationNotefile is the hard-wired notefile that the notehub uses when performing a geolocation
const HealthNotefile = "_health.qo"
HealthNotefile is the hard-wired notefile that the notecard uses for health-related info
const HubDefaultInboundNotefile = "data.qi"
HubDefaultInboundNotefile is the hard-wired default notefile for user data
const HubDefaultOutboundNotefile = "data.qo"
HubDefaultOutboundNotefile is the hard-wired default notefile for user data
const LogNotefile = "_log.qo"
LogNotefile is the hard-wired notefile that the notecard uses for debug logging
const MessageContentASCII = ""
MessageContentASCII is just simple ASCII text
const MessageInbox = "messages.qi"
MessageInbox is the place into which messages are received
const MessageOutbox = "messages.qo"
MessageOutbox is the place from which messages are sent
const MessageSTagReceived = "received"
MessageSTagReceived indicates that this was a received message
const MessageSTagSent = "sent"
MessageSTagSent indicates that this was a sent message
const MessageStore = "messages.db"
MessageStore is the place where the user retains messages
const MessageTagImportant = "important"
MessageTagImportant indicates that the sender feels that this is an important message
const MessageTagUrgent = "urgent"
MessageTagUrgent indicates that the sender feels that this is an urgent message
const NotecardRequestNotefile = "_req.qis"
NotecardRequestNotefile is a special notefile for sending notecard requests
const NotecardResponseNotefile = "_rsp.qos"
NotecardResponseNotefile is a special notefile for sending notecard requests
const SessionNotefile = "_session.qo"
SessionNotefile is the hard-wired notefile that the notehub uses when starting a session
const SyncPriorityHigh = 1
SyncPriorityHigh (golint)
const SyncPriorityHigher = 2
SyncPriorityHigher (golint)
const SyncPriorityHighest = 3
SyncPriorityHighest (golint)
const SyncPriorityLow = -1
SyncPriorityLow (golint)
const SyncPriorityLower = -2
SyncPriorityLower (golint)
const SyncPriorityLowest = -3
SyncPriorityLowest (golint)
const SyncPriorityNormal = 0
SyncPriorityNormal (golint)
const TrackNotefile = "_track.qo"
TrackNotefile is the hard-wired notefile that the notecard can use for tracking the device
Variables ¶
This section is empty.
Functions ¶
func BodyToObject ¶ added in v1.2.1
BodyToObject Unmarshals the specified map into an object
func ErrorClean ¶ added in v1.1.21
ErrorClean removes all error keywords from an error string
func ErrorContains ¶ added in v1.1.21
ErrorContains tests to see if an error contains an error keyword that we might expect
func ErrorJSON ¶ added in v1.3.8
ErrorJSON returns a JSON object with nothing but an error code, and with an optional message
func ErrorString ¶ added in v1.1.21
ErrorString safely returns a string from any error, returning "" for nil
func JSONMarshal ¶ added in v1.2.1
JSONMarshal is the equivalent to the json package's Marshal, however it does not escape HTML sitting inside JSON strings.
func JSONMarshalIndent ¶ added in v1.2.1
JSONMarshalIndent is like Marshal but applies Indent to format the output. Each JSON element in the output will begin on a new line beginning with prefix followed by one or more copies of indent according to the indentation nesting.
func JSONToBody ¶ added in v1.1.1
JSONToBody unmarshals the specify object and returns it as a map[string]interface{}
func JSONUnmarshal ¶ added in v1.2.1
JSONUnmarshal uses JSON Numbers, rather than assuming Floats. This fixes an issue in which, when decoding to an arbitrary interface, the JSON package decodes large numbers (like Unix epoch) into floats.
func ObjectToBody ¶ added in v1.1.1
ObjectToBody Marshals the specify object and returns it as map
func ObjectToJSON ¶ added in v1.1.1
ObjectToJSON Marshals the specify object and returns it as a []byte
func WordToNumber ¶ added in v1.3.7
WordToNumber converts a single word to a number
func WordsFromNumber ¶ added in v1.3.7
WordsFromNumber converts a number to three simple words
func WordsFromString ¶ added in v1.3.7
WordsFromString hashes a string with a 32-bit function and converts it to three simple words
func WordsToNumber ¶ added in v1.3.7
WordsToNumber looks up a number from two or three simple words
Types ¶
type DeviceSession ¶
type DeviceSession struct {
// Session ID that can be mapped to the events created during that session
SessionUID string `json:"session,omitempty"`
// Info from the device structure
DeviceUID string `json:"device,omitempty"`
DeviceSN string `json:"sn,omitempty"`
ProductUID string `json:"product,omitempty"`
FleetUID string `json:"fleet,omitempty"`
// IP address of the session
Addr string `json:"addr,omitempty"`
// Cell ID where the session originated and quality ("mcc,mnc,lac,cellid")
CellID string `json:"cell,omitempty"`
// Parameters passed by device as a result of scanning towers/APs
ScanResults *[]byte
Triangulate *map[string]interface{} `json:"triangulate,omitempty"`
// Signal strength/quality of the cell
Rssi int `json:"rssi,omitempty"`
Sinr int `json:"sinr,omitempty"`
Rsrp int `json:"rsrp,omitempty"`
Rsrq int `json:"rsrq,omitempty"`
Rat string `json:"rat,omitempty"`
// Last known tower location at beginning of session
Tower TowerLocation `json:"tower,omitempty"`
// Last known GPS location extracted from data flowing through session
WhereWhen int64 `json:"where_when,omitempty"`
WhereOLC string `json:"where,omitempty"`
WhereLat float64 `json:"where_lat,omitempty"`
WhereLon float64 `json:"where_lon,omitempty"`
WhereLocation string `json:"where_location,omitempty"`
WhereCountry string `json:"where_country,omitempty"`
WhereTimeZone string `json:"where_timezone,omitempty"`
// Log key for this session
SessionLogKey string `json:"session_log_key,omitempty"`
// Total device usage at the beginning of the period
This DeviceUsage `json:"this,omitempty"`
// Total device usage at the beginning of the next period, whenever it happens to occur
Next DeviceUsage `json:"next,omitempty"`
// Usage during the period - initially estimated, but then corrected when we get to the next period
Period DeviceUsage `json:"period,omitempty"`
// Flag indicating whether the usage data is based on actual stats from the device
IsUsageActual bool `json:"usage_actual,omitempty"`
// Physical device info
Voltage float64 `json:"voltage,omitempty"`
Temp float64 `json:"temp,omitempty"`
// Type of session
ContinuousSession bool `json:"continuous,omitempty"`
TLSSession bool `json:"tls,omitempty"`
// For keeping track of when the last work was done for a session
LastWorkDone int64 `json:"work,omitempty"`
// Number of Events routed
EventCount int64 `json:"events,omitempty"`
// Motion of the notecard
Moved int64 `json:"moved,omitempty"`
Orientation string `json:"orientation,omitempty"`
// Why a session was triggered
Trigger string `json:"trigger,omitempty"`
}
DeviceSession is the basic unit of recorded device usage history
type DeviceUsage ¶
type DeviceUsage struct {
Since int64 `json:"since,omitempty"`
DurationSecs uint32 `json:"duration,omitempty"`
RcvdBytes uint32 `json:"bytes_rcvd,omitempty"`
SentBytes uint32 `json:"bytes_sent,omitempty"`
TCPSessions uint32 `json:"sessions_tcp,omitempty"`
TLSSessions uint32 `json:"sessions_tls,omitempty"`
RcvdNotes uint32 `json:"notes_rcvd,omitempty"`
SentNotes uint32 `json:"notes_sent,omitempty"`
}
DeviceUsage is the device usage metric representing values from the beginning of time, since Provisioned
type Event ¶
type Event struct {
EventUID string `json:"event,omitempty"`
SessionUID string `json:"session,omitempty"`
TLS bool `json:"tls,omitempty"`
DeviceUID string `json:"device,omitempty"`
DeviceSN string `json:"sn,omitempty"`
ProductUID string `json:"product,omitempty"`
EndpointID string `json:"endpoint,omitempty"`
Received float64 `json:"received,omitempty"`
Routed int64 `json:"routed,omitempty"`
Req string `json:"req,omitempty"`
Rsp string `json:"rsp,omitempty"`
Error string `json:"err,omitempty"`
When int64 `json:"when,omitempty"`
NotefileID string `json:"file,omitempty"`
NoteID string `json:"note,omitempty"`
Updates int32 `json:"updates,omitempty"`
Deleted bool `json:"deleted,omitempty"`
Sent bool `json:"queued,omitempty"`
Bulk bool `json:"bulk,omitempty"`
Body *map[string]interface{} `json:"body,omitempty"`
Payload []byte `json:"payload,omitempty"`
// Location
Where string `json:"where_olc,omitempty"`
WhereWhen int64 `json:"where_when,omitempty"`
WhereLat float64 `json:"where_lat,omitempty"`
WhereLon float64 `json:"where_lon,omitempty"`
WhereLocation string `json:"where_location,omitempty"`
WhereCountry string `json:"where_country,omitempty"`
WhereTimeZone string `json:"where_timezone,omitempty"`
TowerWhen int64 `json:"tower_when,omitempty"`
TowerLat float64 `json:"tower_lat,omitempty"`
TowerLon float64 `json:"tower_lon,omitempty"`
TowerCountry string `json:"tower_country,omitempty"`
TowerLocation string `json:"tower_location,omitempty"`
TowerTimeZone string `json:"tower_timezone,omitempty"`
TowerID string `json:"tower_id,omitempty"`
TriWhen int64 `json:"tri_when,omitempty"`
TriLat float64 `json:"tri_lat,omitempty"`
TriLon float64 `json:"tri_lon,omitempty"`
TriLocation string `json:"tri_location,omitempty"`
TriCountry string `json:"tri_country,omitempty"`
TriTimeZone string `json:"tri_timezone,omitempty"`
TriPoints int32 `json:"tri_points,omitempty"`
// Motion
Moved int64 `json:"moved,omitempty"`
Orientation string `json:"orientation,omitempty"`
// Signal strength/quality of the cell
Rssi int `json:"rssi,omitempty"`
Sinr int `json:"sinr,omitempty"`
Rsrp int `json:"rsrp,omitempty"`
Rsrq int `json:"rsrq,omitempty"`
Rat string `json:"rat,omitempty"`
Bars uint32 `json:"bars,omitempty"`
// Physical device info
Voltage float64 `json:"voltage,omitempty"`
Temp float64 `json:"temp,omitempty"`
// Triangulation
Triangulate *map[string]interface{} `json:"triangulate,omitempty"`
// "Routed" environment variables beginning with a "$" prefix
Env *map[string]string `json:"environment,omitempty"`
// App and device meta info
App *EventApp `json:"project,omitempty"`
DeviceContact *EventContact `json:"device_contact,omitempty"`
// Where to reply
ReplyURL string `json:"reply,omitempty"`
// Event log
LogAttn bool `json:"logattn,omitempty"`
Log map[string]EventLogEntry `json:"log,omitempty"`
// True if the event was not routed due to exceeding the project's event limit.
LogEventLimit bool `json:"log_event_limit,omitempty"`
}
Event is the request structure passed to the Notification proc
type EventApp ¶
type EventApp struct {
AppUID string `json:"id,omitempty"`
AppLabel string `json:"name,omitempty"`
Contacts EventContacts `json:"contacts,omitempty"`
}
EventApp has information about the app
type EventContact ¶
type EventContact struct {
Name string `json:"name,omitempty"`
Affiliation string `json:"org,omitempty"`
Role string `json:"role,omitempty"`
Email string `json:"email,omitempty"`
}
EventContact has the basic contact info structure
type EventContacts ¶
type EventContacts struct {
Admin *EventContact `json:"admin,omitempty"`
Tech *EventContact `json:"tech,omitempty"`
}
EventContacts has contact info for this app
type EventLogEntry ¶
type EventLogEntry struct {
Attn bool `json:"attn,omitempty"`
Status string `json:"status,omitempty"`
Text string `json:"text,omitempty"`
URL string `json:"url,omitempty"`
}
EventLogEntry is the log entry used by notification processing
type History ¶
type History struct {
When int64 `json:"w,omitempty"`
Where string `json:"l,omitempty"`
EndpointID string `json:"e,omitempty"`
Sequence int32 `json:"s,omitempty"`
}
History records the update history, optimized so that if the most recent entry is by the same endpoint as an update/delete, that entry is re-used. The primary use of History is for conflict detection, and you don't need to detect conflicts against yourself.
type Info ¶
type Info struct {
NoteID string `json:"id,omitempty"`
Body *map[string]interface{} `json:"body,omitempty"`
Payload *[]byte `json:"payload,omitempty"`
Deleted bool `json:"deleted,omitempty"`
}
Info is a general "content" structure
type Message ¶ added in v1.2.1
type Message struct {
UID string `json:"id,omitempty"`
Sent uint32 `json:"sent,omitempty"`
Received uint32 `json:"received,omitempty"`
From MessageContact `json:"from,omitempty"`
To []MessageContact `json:"to,omitempty"`
Tags []string `json:"tags,omitempty"`
StoreTags []string `json:"stags,omitempty"`
ContentType string `json:"type,omitempty"`
Content string `json:"content,omitempty"`
Body *map[string]interface{} `json:"body,omitempty"`
}
Message is the core message data structure. Note that when stored in a map or a note, the UID is not present but rather is the map key or noteID.
type MessageAddress ¶ added in v1.2.1
type MessageAddress struct {
Hub string `json:"hub,omitempty"`
ProductUID string `json:"product,omitempty"`
DeviceUID string `json:"device,omitempty"`
DeviceSN string `json:"sn,omitempty"`
Active uint32 `json:"active,omitempty"`
}
MessageAddress is the network routing information for a message
type MessageContact ¶ added in v1.2.1
type MessageContact struct {
Name string `json:"name,omitempty"`
Email string `json:"email,omitempty"`
StoreTags []string `json:"stags,omitempty"`
Addresses []MessageAddress `json:"addresses,omitempty"`
}
MessageContact is the entity sending a message, who may have multiple devices/addresses
type Note ¶
type Note struct {
Body map[string]interface{} `json:"b,omitempty"`
Payload []byte `json:"p,omitempty"`
Change int64 `json:"c,omitempty"`
Histories *[]History `json:"h,omitempty"`
Conflicts *[]Note `json:"x,omitempty"`
Updates int32 `json:"u,omitempty"`
Deleted bool `json:"d,omitempty"`
Sent bool `json:"s,omitempty"`
Bulk bool `json:"k,omitempty"`
XPOff uint32 `json:"O,omitempty"`
XPLen uint32 `json:"L,omitempty"`
}
Note is the most fundamental data structure, containing user data referred to as its "body" and its "payload". All access to these fields, and changes to these fields, must be done indirectly through the note API.
func CreateNote ¶
CreateNote creates the core data structure for an object, given a JSON body
func (*Note) EndpointID ¶
EndpointID determines the endpoint that last modified the note
func (*Note) GetConflicts ¶
GetConflicts fetches the conflicts, so that they may be displayed
func (*Note) GetModified ¶
func (note *Note) GetModified() (isAvailable bool, endpointID string, when string, where string, updates int32)
GetModified retrieves information about the note's modification
func (*Note) GetPayload ¶
GetPayload retrieves the Payload from a given Note
func (*Note) HasConflicts ¶
HasConflicts determines whether or not a given Note has conflicts
func (*Note) SetBody ¶
SetBody sets the application-supplied Body field of a given Note given some JSON
func (*Note) SetPayload ¶
SetPayload sets the application-supplied Payload field of a given Note, which must be binary bytes that will ultimately be rendered as base64 in JSON
type NotefileInfo ¶
type NotefileInfo struct {
// The count of modified notes in this notefile. This is used in the Req API, but not in the Notebox info
Changes int `json:"changes,omitempty"`
// The count of total notes in this notefile. This is used in the Req API, but not in the Notebox info
Total int `json:"total,omitempty"`
// This is a unidirectional "to-hub" or "from-hub" endpoint
SyncHubEndpointID string `json:"sync_hub_endpoint,omitempty"`
// Relative positive/negative priority of data, with 0 being normal
SyncPriority int `json:"sync_priority,omitempty"`
// Timed: Target for sync period, if modified and if the value hasn't been synced sooner
SyncPeriodSecs int `json:"sync_secs,omitempty"`
// ReqTime is specified if notes stored in this notefile must have a valid time associated with them
ReqTime bool `json:"req_time,omitempty"`
// ReqLoc is specified if notes stored in this notefile must have a valid location associated with them
ReqLoc bool `json:"req_loc,omitempty"`
// AnonAddAllowed is specified if anyone is allowed to drop into this notefile without authentication
AnonAddAllowed bool `json:"anon_add,omitempty"`
}
NotefileInfo has parameters about the Notefile
type TowerLocation ¶
type TowerLocation struct {
When int64 `json:"time,omitempty"` // time when this location was ascertained
Name string `json:"n,omitempty"` // name of the location
CountryCode string `json:"c,omitempty"` // country code
Lat float64 `json:"lat,omitempty"` // latitude
Lon float64 `json:"lon,omitempty"` // longitude
TimeZone string `json:"zone,omitempty"` // timezone name
MCC int `json:"mcc,omitempty"`
MNC int `json:"mnc,omitempty"`
LAC int `json:"lac,omitempty"`
CID int `json:"cid,omitempty"`
OLC string `json:"l,omitempty"` // open location code
TimeZoneID int `json:"z,omitempty"` // timezone id (see tz.go)
Count int64 `json:"count,omitempty"` // number of times this location was recently used
Towers int `json:"towers,omitempty"` // number of triangulation points
}
TowerLocation is the cell tower location structure generated by the tower utility