devicepresence

package
v0.0.0-...-f307744 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2015 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package devicepresence is a generated protocol buffer package.

It is generated from these files:

devicepresence.proto

It has these top-level messages:

StatusRequest
StatusReply
DevicesRequest
Device
Event

Index

Constants

View Source
const (
	BucketSize = time.Minute
	NumBuckets = 5
)

Variables

View Source
var Device_Status_name = map[int32]string{
	0: "ONLINE",
	1: "OFFLINE",
}
View Source
var Device_Status_value = map[string]int32{
	"ONLINE":  0,
	"OFFLINE": 1,
}
View Source
var Device_Type_name = map[int32]string{
	0: "WS",
}
View Source
var Device_Type_value = map[string]int32{
	"WS": 0,
}

Functions

func RegisterPresenceManagerServer

func RegisterPresenceManagerServer(s *grpc.Server, srv PresenceManagerServer)

Types

type Device

type Device struct {
	Id     string        `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	Type   Device_Type   `protobuf:"varint,2,opt,name=type,enum=devicepresence.Device_Type" json:"type,omitempty"`
	UserId string        `protobuf:"bytes,3,opt,name=user_id" json:"user_id,omitempty"`
	Status Device_Status `protobuf:"varint,4,opt,name=status,enum=devicepresence.Device_Status" json:"status,omitempty"`
}

func (*Device) ProtoMessage

func (*Device) ProtoMessage()

func (*Device) Reset

func (m *Device) Reset()

func (*Device) String

func (m *Device) String() string

type Device_Status

type Device_Status int32
const (
	Device_ONLINE  Device_Status = 0
	Device_OFFLINE Device_Status = 1
)

func (Device_Status) String

func (x Device_Status) String() string

type Device_Type

type Device_Type int32
const (
	Device_WS Device_Type = 0
)

func (Device_Type) String

func (x Device_Type) String() string

type DevicesRequest

type DevicesRequest struct {
	UserId string `protobuf:"bytes,1,opt,name=user_id" json:"user_id,omitempty"`
}

func (*DevicesRequest) ProtoMessage

func (*DevicesRequest) ProtoMessage()

func (*DevicesRequest) Reset

func (m *DevicesRequest) Reset()

func (*DevicesRequest) String

func (m *DevicesRequest) String() string

type Event

type Event struct {
	Timestamp int64   `protobuf:"varint,1,opt,name=timestamp" json:"timestamp,omitempty"`
	Device    *Device `protobuf:"bytes,2,opt,name=device" json:"device,omitempty"`
}

func (*Event) GetDevice

func (m *Event) GetDevice() *Device

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) Reset

func (m *Event) Reset()

func (*Event) String

func (m *Event) String() string

type Manager

type Manager struct {
	Redis  *redis.Pool
	Stream sarama.SyncProducer
}

func (*Manager) GetDevices

func (m *Manager) GetDevices(req *DevicesRequest, stream PresenceManager_GetDevicesServer) error

func (*Manager) SetStatus

func (m *Manager) SetStatus(ctx context.Context, req *StatusRequest) (*StatusReply, error)

type PresenceManagerClient

type PresenceManagerClient interface {
	SetStatus(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusReply, error)
	GetDevices(ctx context.Context, in *DevicesRequest, opts ...grpc.CallOption) (PresenceManager_GetDevicesClient, error)
}

func NewPresenceManagerClient

func NewPresenceManagerClient(cc *grpc.ClientConn) PresenceManagerClient

type PresenceManagerServer

type PresenceManagerServer interface {
	SetStatus(context.Context, *StatusRequest) (*StatusReply, error)
	GetDevices(*DevicesRequest, PresenceManager_GetDevicesServer) error
}

type PresenceManager_GetDevicesClient

type PresenceManager_GetDevicesClient interface {
	Recv() (*Device, error)
	grpc.ClientStream
}

type PresenceManager_GetDevicesServer

type PresenceManager_GetDevicesServer interface {
	Send(*Device) error
	grpc.ServerStream
}

type StatusReply

type StatusReply struct {
}

func (*StatusReply) ProtoMessage

func (*StatusReply) ProtoMessage()

func (*StatusReply) Reset

func (m *StatusReply) Reset()

func (*StatusReply) String

func (m *StatusReply) String() string

type StatusRequest

type StatusRequest struct {
	Device *Device `protobuf:"bytes,1,opt,name=device" json:"device,omitempty"`
}

func (*StatusRequest) GetDevice

func (m *StatusRequest) GetDevice() *Device

func (*StatusRequest) ProtoMessage

func (*StatusRequest) ProtoMessage()

func (*StatusRequest) Reset

func (m *StatusRequest) Reset()

func (*StatusRequest) String

func (m *StatusRequest) String() string

Jump to

Keyboard shortcuts

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