Documentation ¶
Index ¶
- Variables
- func RegisterGeoTTNServer(s *grpc.Server, srv GeoTTNServer)
- type Config
- type DataPoint
- func (*DataPoint) Descriptor() ([]byte, []int)
- func (m *DataPoint) GetAppId() string
- func (m *DataPoint) GetDeviceId() string
- func (m *DataPoint) GetLatitude() float64
- func (m *DataPoint) GetLongitude() float64
- func (m *DataPoint) GetPayload() []byte
- func (m *DataPoint) GetTime() *timestamp.Timestamp
- func (*DataPoint) ProtoMessage()
- func (m *DataPoint) Reset()
- func (m *DataPoint) String() string
- func (m *DataPoint) XXX_DiscardUnknown()
- func (m *DataPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *DataPoint) XXX_Merge(src proto.Message)
- func (m *DataPoint) XXX_Size() int
- func (m *DataPoint) XXX_Unmarshal(b []byte) error
- type DataPoints
- func (*DataPoints) Descriptor() ([]byte, []int)
- func (m *DataPoints) GetPoints() []*DataPoint
- func (*DataPoints) ProtoMessage()
- func (m *DataPoints) Reset()
- func (m *DataPoints) String() string
- func (m *DataPoints) XXX_DiscardUnknown()
- func (m *DataPoints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *DataPoints) XXX_Merge(src proto.Message)
- func (m *DataPoints) XXX_Size() int
- func (m *DataPoints) XXX_Unmarshal(b []byte) error
- type GeoTTNClient
- type GeoTTNServer
- type GetRequest
- func (*GetRequest) Descriptor() ([]byte, []int)
- func (m *GetRequest) GetKey() string
- func (*GetRequest) ProtoMessage()
- func (m *GetRequest) Reset()
- func (m *GetRequest) String() string
- func (m *GetRequest) XXX_DiscardUnknown()
- func (m *GetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *GetRequest) XXX_Merge(src proto.Message)
- func (m *GetRequest) XXX_Size() int
- func (m *GetRequest) XXX_Unmarshal(b []byte) error
- type KeyList
- func (*KeyList) Descriptor() ([]byte, []int)
- func (m *KeyList) GetKeys() []string
- func (*KeyList) ProtoMessage()
- func (m *KeyList) Reset()
- func (m *KeyList) String() string
- func (m *KeyList) XXX_DiscardUnknown()
- func (m *KeyList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *KeyList) XXX_Merge(src proto.Message)
- func (m *KeyList) XXX_Size() int
- func (m *KeyList) XXX_Unmarshal(b []byte) error
- type RadiusSearchRequest
- func (*RadiusSearchRequest) Descriptor() ([]byte, []int)
- func (m *RadiusSearchRequest) GetLat() float64
- func (m *RadiusSearchRequest) GetLng() float64
- func (m *RadiusSearchRequest) GetRadius() float64
- func (*RadiusSearchRequest) ProtoMessage()
- func (m *RadiusSearchRequest) Reset()
- func (m *RadiusSearchRequest) String() string
- func (m *RadiusSearchRequest) XXX_DiscardUnknown()
- func (m *RadiusSearchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *RadiusSearchRequest) XXX_Merge(src proto.Message)
- func (m *RadiusSearchRequest) XXX_Size() int
- func (m *RadiusSearchRequest) XXX_Unmarshal(b []byte) error
- type RectSearchRequest
- func (*RectSearchRequest) Descriptor() ([]byte, []int)
- func (m *RectSearchRequest) GetBllat() float64
- func (m *RectSearchRequest) GetBllng() float64
- func (m *RectSearchRequest) GetUrlat() float64
- func (m *RectSearchRequest) GetUrlng() float64
- func (*RectSearchRequest) ProtoMessage()
- func (m *RectSearchRequest) Reset()
- func (m *RectSearchRequest) String() string
- func (m *RectSearchRequest) XXX_DiscardUnknown()
- func (m *RectSearchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *RectSearchRequest) XXX_Merge(src proto.Message)
- func (m *RectSearchRequest) XXX_Size() int
- func (m *RectSearchRequest) XXX_Unmarshal(b []byte) error
- type Server
- func (s *Server) Get(ctx context.Context, req *GetRequest) (*DataPoint, error)
- func (s *Server) GetAll(ctx context.Context, in *GetRequest) (*DataPoints, error)
- func (s *Server) HandleMessage(ctx context.Context, msg *types.UplinkMessage)
- func (s *Server) Keys(context.Context, *empty.Empty) (*KeyList, error)
- func (s *Server) RadiusSearch(ctx context.Context, req *RadiusSearchRequest) (*DataPoints, error)
- func (s *Server) RectSearch(ctx context.Context, req *RectSearchRequest) (*DataPoints, error)
- func (s *Server) Store(ctx context.Context, dp *DataPoint) (*empty.Empty, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MsgReceivedCounter = promauto.NewCounter( prometheus.CounterOpts{ Namespace: "geottn", Name: "received_msg_total", Help: "The total number of received msg from TTN", }, ) ErrorCounter = promauto.NewCounter( prometheus.CounterOpts{ Namespace: "geottn", Name: "error_total", Help: "The total number of errors occurring", }, ) InsertCounter = promauto.NewCounter( prometheus.CounterOpts{ Namespace: "geottn", Name: "insert_total", Help: "The total number of inserts in db", }, ) )
Functions ¶
func RegisterGeoTTNServer ¶
func RegisterGeoTTNServer(s *grpc.Server, srv GeoTTNServer)
Types ¶
type DataPoint ¶
type DataPoint struct { AppId string `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` DeviceId string `protobuf:"bytes,2,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"` Latitude float64 `protobuf:"fixed64,3,opt,name=latitude,proto3" json:"latitude,omitempty"` Longitude float64 `protobuf:"fixed64,4,opt,name=longitude,proto3" json:"longitude,omitempty"` Time *timestamp.Timestamp `protobuf:"bytes,5,opt,name=time,proto3" json:"time,omitempty"` Payload []byte `protobuf:"bytes,6,opt,name=payload,proto3" json:"payload,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func StorageToDataPoint ¶
func (*DataPoint) Descriptor ¶
func (*DataPoint) GetDeviceId ¶
func (*DataPoint) GetLatitude ¶
func (*DataPoint) GetLongitude ¶
func (*DataPoint) GetPayload ¶
func (*DataPoint) ProtoMessage ¶
func (*DataPoint) ProtoMessage()
func (*DataPoint) XXX_DiscardUnknown ¶
func (m *DataPoint) XXX_DiscardUnknown()
func (*DataPoint) XXX_Marshal ¶
func (*DataPoint) XXX_Unmarshal ¶
type DataPoints ¶
type DataPoints struct { Points []*DataPoint `protobuf:"bytes,1,rep,name=points,proto3" json:"points,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*DataPoints) Descriptor ¶
func (*DataPoints) Descriptor() ([]byte, []int)
func (*DataPoints) GetPoints ¶
func (m *DataPoints) GetPoints() []*DataPoint
func (*DataPoints) ProtoMessage ¶
func (*DataPoints) ProtoMessage()
func (*DataPoints) Reset ¶
func (m *DataPoints) Reset()
func (*DataPoints) String ¶
func (m *DataPoints) String() string
func (*DataPoints) XXX_DiscardUnknown ¶
func (m *DataPoints) XXX_DiscardUnknown()
func (*DataPoints) XXX_Marshal ¶
func (m *DataPoints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DataPoints) XXX_Merge ¶
func (dst *DataPoints) XXX_Merge(src proto.Message)
func (*DataPoints) XXX_Size ¶
func (m *DataPoints) XXX_Size() int
func (*DataPoints) XXX_Unmarshal ¶
func (m *DataPoints) XXX_Unmarshal(b []byte) error
type GeoTTNClient ¶
type GeoTTNClient interface { Store(ctx context.Context, in *DataPoint, opts ...grpc.CallOption) (*empty.Empty, error) RadiusSearch(ctx context.Context, in *RadiusSearchRequest, opts ...grpc.CallOption) (*DataPoints, error) RectSearch(ctx context.Context, in *RectSearchRequest, opts ...grpc.CallOption) (*DataPoints, error) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*DataPoint, error) GetAll(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*DataPoints, error) Keys(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*KeyList, error) }
GeoTTNClient is the client API for GeoTTN service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewGeoTTNClient ¶
func NewGeoTTNClient(cc *grpc.ClientConn) GeoTTNClient
type GeoTTNServer ¶
type GeoTTNServer interface { Store(context.Context, *DataPoint) (*empty.Empty, error) RadiusSearch(context.Context, *RadiusSearchRequest) (*DataPoints, error) RectSearch(context.Context, *RectSearchRequest) (*DataPoints, error) Get(context.Context, *GetRequest) (*DataPoint, error) GetAll(context.Context, *GetRequest) (*DataPoints, error) Keys(context.Context, *empty.Empty) (*KeyList, error) }
GeoTTNServer is the server API for GeoTTN service.
type GetRequest ¶
type GetRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*GetRequest) Descriptor ¶
func (*GetRequest) Descriptor() ([]byte, []int)
func (*GetRequest) GetKey ¶
func (m *GetRequest) GetKey() string
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) Reset ¶
func (m *GetRequest) Reset()
func (*GetRequest) String ¶
func (m *GetRequest) String() string
func (*GetRequest) XXX_DiscardUnknown ¶
func (m *GetRequest) XXX_DiscardUnknown()
func (*GetRequest) XXX_Marshal ¶
func (m *GetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetRequest) XXX_Merge ¶
func (dst *GetRequest) XXX_Merge(src proto.Message)
func (*GetRequest) XXX_Size ¶
func (m *GetRequest) XXX_Size() int
func (*GetRequest) XXX_Unmarshal ¶
func (m *GetRequest) XXX_Unmarshal(b []byte) error
type KeyList ¶
type KeyList struct { Keys []string `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*KeyList) Descriptor ¶
func (*KeyList) ProtoMessage ¶
func (*KeyList) ProtoMessage()
func (*KeyList) XXX_DiscardUnknown ¶
func (m *KeyList) XXX_DiscardUnknown()
func (*KeyList) XXX_Marshal ¶
func (*KeyList) XXX_Unmarshal ¶
type RadiusSearchRequest ¶
type RadiusSearchRequest struct { Lat float64 `protobuf:"fixed64,1,opt,name=lat,proto3" json:"lat,omitempty"` Lng float64 `protobuf:"fixed64,2,opt,name=lng,proto3" json:"lng,omitempty"` // radius in meters Radius float64 `protobuf:"fixed64,3,opt,name=radius,proto3" json:"radius,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*RadiusSearchRequest) Descriptor ¶
func (*RadiusSearchRequest) Descriptor() ([]byte, []int)
func (*RadiusSearchRequest) GetLat ¶
func (m *RadiusSearchRequest) GetLat() float64
func (*RadiusSearchRequest) GetLng ¶
func (m *RadiusSearchRequest) GetLng() float64
func (*RadiusSearchRequest) GetRadius ¶
func (m *RadiusSearchRequest) GetRadius() float64
func (*RadiusSearchRequest) ProtoMessage ¶
func (*RadiusSearchRequest) ProtoMessage()
func (*RadiusSearchRequest) Reset ¶
func (m *RadiusSearchRequest) Reset()
func (*RadiusSearchRequest) String ¶
func (m *RadiusSearchRequest) String() string
func (*RadiusSearchRequest) XXX_DiscardUnknown ¶
func (m *RadiusSearchRequest) XXX_DiscardUnknown()
func (*RadiusSearchRequest) XXX_Marshal ¶
func (m *RadiusSearchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RadiusSearchRequest) XXX_Merge ¶
func (dst *RadiusSearchRequest) XXX_Merge(src proto.Message)
func (*RadiusSearchRequest) XXX_Size ¶
func (m *RadiusSearchRequest) XXX_Size() int
func (*RadiusSearchRequest) XXX_Unmarshal ¶
func (m *RadiusSearchRequest) XXX_Unmarshal(b []byte) error
type RectSearchRequest ¶
type RectSearchRequest struct { Urlat float64 `protobuf:"fixed64,1,opt,name=urlat,proto3" json:"urlat,omitempty"` Urlng float64 `protobuf:"fixed64,2,opt,name=urlng,proto3" json:"urlng,omitempty"` Bllat float64 `protobuf:"fixed64,3,opt,name=bllat,proto3" json:"bllat,omitempty"` Bllng float64 `protobuf:"fixed64,4,opt,name=bllng,proto3" json:"bllng,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*RectSearchRequest) Descriptor ¶
func (*RectSearchRequest) Descriptor() ([]byte, []int)
func (*RectSearchRequest) GetBllat ¶
func (m *RectSearchRequest) GetBllat() float64
func (*RectSearchRequest) GetBllng ¶
func (m *RectSearchRequest) GetBllng() float64
func (*RectSearchRequest) GetUrlat ¶
func (m *RectSearchRequest) GetUrlat() float64
func (*RectSearchRequest) GetUrlng ¶
func (m *RectSearchRequest) GetUrlng() float64
func (*RectSearchRequest) ProtoMessage ¶
func (*RectSearchRequest) ProtoMessage()
func (*RectSearchRequest) Reset ¶
func (m *RectSearchRequest) Reset()
func (*RectSearchRequest) String ¶
func (m *RectSearchRequest) String() string
func (*RectSearchRequest) XXX_DiscardUnknown ¶
func (m *RectSearchRequest) XXX_DiscardUnknown()
func (*RectSearchRequest) XXX_Marshal ¶
func (m *RectSearchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RectSearchRequest) XXX_Merge ¶
func (dst *RectSearchRequest) XXX_Merge(src proto.Message)
func (*RectSearchRequest) XXX_Size ¶
func (m *RectSearchRequest) XXX_Size() int
func (*RectSearchRequest) XXX_Unmarshal ¶
func (m *RectSearchRequest) XXX_Unmarshal(b []byte) error
type Server ¶
type Server struct { Health *health.Server GeoDB storage.Indexer // contains filtered or unexported fields }
func (*Server) GetAll ¶
func (s *Server) GetAll(ctx context.Context, in *GetRequest) (*DataPoints, error)
func (*Server) HandleMessage ¶
func (s *Server) HandleMessage(ctx context.Context, msg *types.UplinkMessage)
HandleMessage handles message from TTN
func (*Server) RadiusSearch ¶
func (s *Server) RadiusSearch(ctx context.Context, req *RadiusSearchRequest) (*DataPoints, error)
func (*Server) RectSearch ¶
func (s *Server) RectSearch(ctx context.Context, req *RectSearchRequest) (*DataPoints, error)
Click to show internal directories.
Click to hide internal directories.