query

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterQueryServiceServer

func RegisterQueryServiceServer(s *grpc.Server, srv QueryServiceServer)

Types

type DetectionEvent

type DetectionEvent struct {
	Time                 []*timestamp.Timestamp `protobuf:"bytes,1,rep,name=time,proto3" json:"time,omitempty"`
	DeviceId             string                 `protobuf:"bytes,2,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"`
	DetectorId           string                 `protobuf:"bytes,3,opt,name=detector_id,json=detectorId,proto3" json:"detector_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{}               `json:"-"`
	XXX_unrecognized     []byte                 `json:"-"`
	XXX_sizecache        int32                  `json:"-"`
}

func (*DetectionEvent) Descriptor

func (*DetectionEvent) Descriptor() ([]byte, []int)

func (*DetectionEvent) GetDetectorId

func (m *DetectionEvent) GetDetectorId() string

func (*DetectionEvent) GetDeviceId

func (m *DetectionEvent) GetDeviceId() string

func (*DetectionEvent) GetTime

func (m *DetectionEvent) GetTime() []*timestamp.Timestamp

func (*DetectionEvent) ProtoMessage

func (*DetectionEvent) ProtoMessage()

func (*DetectionEvent) Reset

func (m *DetectionEvent) Reset()

func (*DetectionEvent) String

func (m *DetectionEvent) String() string

func (*DetectionEvent) XXX_DiscardUnknown

func (m *DetectionEvent) XXX_DiscardUnknown()

func (*DetectionEvent) XXX_Marshal

func (m *DetectionEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DetectionEvent) XXX_Merge

func (m *DetectionEvent) XXX_Merge(src proto.Message)

func (*DetectionEvent) XXX_Size

func (m *DetectionEvent) XXX_Size() int

func (*DetectionEvent) XXX_Unmarshal

func (m *DetectionEvent) XXX_Unmarshal(b []byte) error

type Event

type Event struct {
	DetectorID string
	DeviceID   string
	Time       time.Time
}

type GetBatteryVoltageRequest

type GetBatteryVoltageRequest struct {
	DetectorIds          []string `protobuf:"bytes,1,rep,name=detector_ids,json=detectorIds,proto3" json:"detector_ids,omitempty"`
	Range                *Range   `protobuf:"bytes,2,opt,name=range,proto3" json:"range,omitempty"`
	Limit                int64    `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetBatteryVoltageRequest) Descriptor

func (*GetBatteryVoltageRequest) Descriptor() ([]byte, []int)

func (*GetBatteryVoltageRequest) GetDetectorIds

func (m *GetBatteryVoltageRequest) GetDetectorIds() []string

func (*GetBatteryVoltageRequest) GetLimit

func (m *GetBatteryVoltageRequest) GetLimit() int64

func (*GetBatteryVoltageRequest) GetRange

func (m *GetBatteryVoltageRequest) GetRange() *Range

func (*GetBatteryVoltageRequest) ProtoMessage

func (*GetBatteryVoltageRequest) ProtoMessage()

func (*GetBatteryVoltageRequest) Reset

func (m *GetBatteryVoltageRequest) Reset()

func (*GetBatteryVoltageRequest) String

func (m *GetBatteryVoltageRequest) String() string

func (*GetBatteryVoltageRequest) XXX_DiscardUnknown

func (m *GetBatteryVoltageRequest) XXX_DiscardUnknown()

func (*GetBatteryVoltageRequest) XXX_Marshal

func (m *GetBatteryVoltageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetBatteryVoltageRequest) XXX_Merge

func (m *GetBatteryVoltageRequest) XXX_Merge(src proto.Message)

func (*GetBatteryVoltageRequest) XXX_Size

func (m *GetBatteryVoltageRequest) XXX_Size() int

func (*GetBatteryVoltageRequest) XXX_Unmarshal

func (m *GetBatteryVoltageRequest) XXX_Unmarshal(b []byte) error

type GetBatteryVoltageResponse

type GetBatteryVoltageResponse struct {
	Reports              []*VoltageReport `protobuf:"bytes,1,rep,name=reports,proto3" json:"reports,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (*GetBatteryVoltageResponse) Descriptor

func (*GetBatteryVoltageResponse) Descriptor() ([]byte, []int)

func (*GetBatteryVoltageResponse) GetReports

func (m *GetBatteryVoltageResponse) GetReports() []*VoltageReport

func (*GetBatteryVoltageResponse) ProtoMessage

func (*GetBatteryVoltageResponse) ProtoMessage()

func (*GetBatteryVoltageResponse) Reset

func (m *GetBatteryVoltageResponse) Reset()

func (*GetBatteryVoltageResponse) String

func (m *GetBatteryVoltageResponse) String() string

func (*GetBatteryVoltageResponse) XXX_DiscardUnknown

func (m *GetBatteryVoltageResponse) XXX_DiscardUnknown()

func (*GetBatteryVoltageResponse) XXX_Marshal

func (m *GetBatteryVoltageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetBatteryVoltageResponse) XXX_Merge

func (m *GetBatteryVoltageResponse) XXX_Merge(src proto.Message)

func (*GetBatteryVoltageResponse) XXX_Size

func (m *GetBatteryVoltageResponse) XXX_Size() int

func (*GetBatteryVoltageResponse) XXX_Unmarshal

func (m *GetBatteryVoltageResponse) XXX_Unmarshal(b []byte) error

type GetEventsRequest

type GetEventsRequest struct {
	DetectorIds          []string `protobuf:"bytes,1,rep,name=detector_ids,json=detectorIds,proto3" json:"detector_ids,omitempty"`
	Range                *Range   `protobuf:"bytes,2,opt,name=range,proto3" json:"range,omitempty"`
	Limit                int64    `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetEventsRequest) Descriptor

func (*GetEventsRequest) Descriptor() ([]byte, []int)

func (*GetEventsRequest) GetDetectorIds

func (m *GetEventsRequest) GetDetectorIds() []string

func (*GetEventsRequest) GetLimit

func (m *GetEventsRequest) GetLimit() int64

func (*GetEventsRequest) GetRange

func (m *GetEventsRequest) GetRange() *Range

func (*GetEventsRequest) ProtoMessage

func (*GetEventsRequest) ProtoMessage()

func (*GetEventsRequest) Reset

func (m *GetEventsRequest) Reset()

func (*GetEventsRequest) String

func (m *GetEventsRequest) String() string

func (*GetEventsRequest) XXX_DiscardUnknown

func (m *GetEventsRequest) XXX_DiscardUnknown()

func (*GetEventsRequest) XXX_Marshal

func (m *GetEventsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetEventsRequest) XXX_Merge

func (m *GetEventsRequest) XXX_Merge(src proto.Message)

func (*GetEventsRequest) XXX_Size

func (m *GetEventsRequest) XXX_Size() int

func (*GetEventsRequest) XXX_Unmarshal

func (m *GetEventsRequest) XXX_Unmarshal(b []byte) error

type GetEventsResponse

type GetEventsResponse struct {
	Events               []*DetectionEvent `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*GetEventsResponse) Descriptor

func (*GetEventsResponse) Descriptor() ([]byte, []int)

func (*GetEventsResponse) GetEvents

func (m *GetEventsResponse) GetEvents() []*DetectionEvent

func (*GetEventsResponse) ProtoMessage

func (*GetEventsResponse) ProtoMessage()

func (*GetEventsResponse) Reset

func (m *GetEventsResponse) Reset()

func (*GetEventsResponse) String

func (m *GetEventsResponse) String() string

func (*GetEventsResponse) XXX_DiscardUnknown

func (m *GetEventsResponse) XXX_DiscardUnknown()

func (*GetEventsResponse) XXX_Marshal

func (m *GetEventsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetEventsResponse) XXX_Merge

func (m *GetEventsResponse) XXX_Merge(src proto.Message)

func (*GetEventsResponse) XXX_Size

func (m *GetEventsResponse) XXX_Size() int

func (*GetEventsResponse) XXX_Unmarshal

func (m *GetEventsResponse) XXX_Unmarshal(b []byte) error

type QueryServiceClient

type QueryServiceClient interface {
	GetEvents(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (*GetEventsResponse, error)
	// NOTICE: not implemented
	StreamEvents(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (QueryService_StreamEventsClient, error)
	GetBatteryVoltage(ctx context.Context, in *GetBatteryVoltageRequest, opts ...grpc.CallOption) (*GetBatteryVoltageResponse, error)
}

QueryServiceClient is the client API for QueryService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryServiceClient

func NewQueryServiceClient(cc *grpc.ClientConn) QueryServiceClient

type QueryServiceServer

type QueryServiceServer interface {
	GetEvents(context.Context, *GetEventsRequest) (*GetEventsResponse, error)
	// NOTICE: not implemented
	StreamEvents(*GetEventsRequest, QueryService_StreamEventsServer) error
	GetBatteryVoltage(context.Context, *GetBatteryVoltageRequest) (*GetBatteryVoltageResponse, error)
}

QueryServiceServer is the server API for QueryService service.

func NewQueryService

func NewQueryService(repo Repository, logger log15.Logger) QueryServiceServer

type QueryService_StreamEventsClient

type QueryService_StreamEventsClient interface {
	Recv() (*DetectionEvent, error)
	grpc.ClientStream
}

type QueryService_StreamEventsServer

type QueryService_StreamEventsServer interface {
	Send(*DetectionEvent) error
	grpc.ServerStream
}

type Range

type Range struct {
	After                *timestamp.Timestamp `protobuf:"bytes,1,opt,name=after,proto3" json:"after,omitempty"`
	Before               *timestamp.Timestamp `protobuf:"bytes,2,opt,name=before,proto3" json:"before,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

func (*Range) Descriptor

func (*Range) Descriptor() ([]byte, []int)

func (*Range) GetAfter

func (m *Range) GetAfter() *timestamp.Timestamp

func (*Range) GetBefore

func (m *Range) GetBefore() *timestamp.Timestamp

func (*Range) ProtoMessage

func (*Range) ProtoMessage()

func (*Range) Reset

func (m *Range) Reset()

func (*Range) String

func (m *Range) String() string

func (*Range) XXX_DiscardUnknown

func (m *Range) XXX_DiscardUnknown()

func (*Range) XXX_Marshal

func (m *Range) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Range) XXX_Merge

func (m *Range) XXX_Merge(src proto.Message)

func (*Range) XXX_Size

func (m *Range) XXX_Size() int

func (*Range) XXX_Unmarshal

func (m *Range) XXX_Unmarshal(b []byte) error

type Repository

type Repository interface {
	GetEvents(ctx context.Context, detectors []string, after, before time.Time, limit int64) ([]*Event, error)
}

func NewEtcdRepository

func NewEtcdRepository(prefix string, endpoints []string, logger log15.Logger) (Repository, error)

type UnimplementedQueryServiceServer

type UnimplementedQueryServiceServer struct {
}

UnimplementedQueryServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServiceServer) GetBatteryVoltage

func (*UnimplementedQueryServiceServer) GetEvents

func (*UnimplementedQueryServiceServer) StreamEvents

type VoltageReport

type VoltageReport struct {
	DetectorId           string    `protobuf:"bytes,1,opt,name=detector_id,json=detectorId,proto3" json:"detector_id,omitempty"`
	Voltage              []float64 `protobuf:"fixed64,2,rep,packed,name=voltage,proto3" json:"voltage,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*VoltageReport) Descriptor

func (*VoltageReport) Descriptor() ([]byte, []int)

func (*VoltageReport) GetDetectorId

func (m *VoltageReport) GetDetectorId() string

func (*VoltageReport) GetVoltage

func (m *VoltageReport) GetVoltage() []float64

func (*VoltageReport) ProtoMessage

func (*VoltageReport) ProtoMessage()

func (*VoltageReport) Reset

func (m *VoltageReport) Reset()

func (*VoltageReport) String

func (m *VoltageReport) String() string

func (*VoltageReport) XXX_DiscardUnknown

func (m *VoltageReport) XXX_DiscardUnknown()

func (*VoltageReport) XXX_Marshal

func (m *VoltageReport) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*VoltageReport) XXX_Merge

func (m *VoltageReport) XXX_Merge(src proto.Message)

func (*VoltageReport) XXX_Size

func (m *VoltageReport) XXX_Size() int

func (*VoltageReport) XXX_Unmarshal

func (m *VoltageReport) XXX_Unmarshal(b []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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