transport

package
v0.0.0-...-008069a Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package transport is a generated protocol buffer package.

It is generated from these files:

transport.proto

It has these top-level messages:

Broadcast
Roomcast
Result

Index

Constants

This section is empty.

Variables

View Source
var DataType_name = map[int32]string{
	0: "STR",
	1: "BIN",
	2: "JSON",
}
View Source
var DataType_value = map[string]int32{
	"STR":  0,
	"BIN":  1,
	"JSON": 2,
}

Functions

func RegisterPropagateServer

func RegisterPropagateServer(s *grpc.Server, srv PropagateServer)

Types

type Broadcast

type Broadcast struct {
	// unix nano timestamp
	Timestamp uint64   `protobuf:"fixed64,1,opt,name=timestamp" json:"timestamp,omitempty"`
	Event     string   `protobuf:"bytes,2,opt,name=event" json:"event,omitempty"`
	Data      []byte   `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	DataType  DataType `protobuf:"varint,4,opt,name=dataType,enum=transport.DataType" json:"dataType,omitempty"`
}

func (*Broadcast) Descriptor

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

func (*Broadcast) GetData

func (m *Broadcast) GetData() []byte

func (*Broadcast) GetDataType

func (m *Broadcast) GetDataType() DataType

func (*Broadcast) GetEvent

func (m *Broadcast) GetEvent() string

func (*Broadcast) GetTimestamp

func (m *Broadcast) GetTimestamp() uint64

func (*Broadcast) ProtoMessage

func (*Broadcast) ProtoMessage()

func (*Broadcast) Reset

func (m *Broadcast) Reset()

func (*Broadcast) String

func (m *Broadcast) String() string

type DataType

type DataType int32
const (
	DataType_STR  DataType = 0
	DataType_BIN  DataType = 1
	DataType_JSON DataType = 2
)

func (DataType) EnumDescriptor

func (DataType) EnumDescriptor() ([]byte, []int)

func (DataType) String

func (x DataType) String() string

type PropagateClient

type PropagateClient interface {
	DoBroadcast(ctx context.Context, in *Broadcast, opts ...grpc.CallOption) (*Result, error)
	DoRoomcast(ctx context.Context, in *Roomcast, opts ...grpc.CallOption) (*Result, error)
}

func NewPropagateClient

func NewPropagateClient(cc *grpc.ClientConn) PropagateClient

type PropagateServer

type PropagateServer interface {
	DoBroadcast(context.Context, *Broadcast) (*Result, error)
	DoRoomcast(context.Context, *Roomcast) (*Result, error)
}

type Result

type Result struct {
	Success bool `protobuf:"varint,1,opt,name=success" json:"success,omitempty"`
	//
	// should be the original unix nano timestamp sent by the client
	// useful for calculating round trip time
	Timestamp uint64 `protobuf:"fixed64,2,opt,name=timestamp" json:"timestamp,omitempty"`
}

func (*Result) Descriptor

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

func (*Result) GetSuccess

func (m *Result) GetSuccess() bool

func (*Result) GetTimestamp

func (m *Result) GetTimestamp() uint64

func (*Result) ProtoMessage

func (*Result) ProtoMessage()

func (*Result) Reset

func (m *Result) Reset()

func (*Result) String

func (m *Result) String() string

type Roomcast

type Roomcast struct {
	// unix nano timestamp
	Timestamp uint64   `protobuf:"fixed64,1,opt,name=timestamp" json:"timestamp,omitempty"`
	Room      string   `protobuf:"bytes,2,opt,name=room" json:"room,omitempty"`
	Event     string   `protobuf:"bytes,3,opt,name=event" json:"event,omitempty"`
	Data      []byte   `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
	DataType  DataType `protobuf:"varint,5,opt,name=dataType,enum=transport.DataType" json:"dataType,omitempty"`
}

func (*Roomcast) Descriptor

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

func (*Roomcast) GetData

func (m *Roomcast) GetData() []byte

func (*Roomcast) GetDataType

func (m *Roomcast) GetDataType() DataType

func (*Roomcast) GetEvent

func (m *Roomcast) GetEvent() string

func (*Roomcast) GetRoom

func (m *Roomcast) GetRoom() string

func (*Roomcast) GetTimestamp

func (m *Roomcast) GetTimestamp() uint64

func (*Roomcast) ProtoMessage

func (*Roomcast) ProtoMessage()

func (*Roomcast) Reset

func (m *Roomcast) Reset()

func (*Roomcast) String

func (m *Roomcast) String() string

Jump to

Keyboard shortcuts

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