diff --git a/go.mod b/go.mod index 8cea1746..420c7912 100644 --- a/go.mod +++ b/go.mod @@ -17,6 +17,7 @@ require ( github.com/manifoldco/promptui v0.8.0 github.com/maxbrunsfeld/counterfeiter/v6 v6.3.0 github.com/mitchellh/go-homedir v1.1.0 + github.com/mustafaturan/bus v1.0.2 // indirect github.com/pion/ion-log v1.0.0 github.com/pion/ion-sfu v1.7.7 github.com/pion/rtcp v1.2.6 diff --git a/go.sum b/go.sum index 0c77a107..723c967d 100644 --- a/go.sum +++ b/go.sum @@ -275,6 +275,9 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mustafaturan/bus v1.0.2 h1:2x3ErwZ0uUPwwZ5ZZoknEQprdaxr68Yl3mY8jDye1Ws= +github.com/mustafaturan/bus v1.0.2/go.mod h1:h7gfehm8TThv4Dcaa+wDQG7r7j6p74v+7ftr0Rq9i1Q= +github.com/mustafaturan/monoton v0.3.1/go.mod h1:FOnE7NV3s3EWPXb8/7+/OSdiMBbdlkV0Lz8p1dc+vy8= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= diff --git a/pkg/routing/node.go b/pkg/routing/node.go index d36d21a8..6569fc12 100644 --- a/pkg/routing/node.go +++ b/pkg/routing/node.go @@ -35,6 +35,10 @@ func NewLocalNode(conf *config.Config) (LocalNode, error) { Id: fmt.Sprintf("%s%16.16X", utils.NodePrefix, macUint64()), Ip: ip, NumCpus: uint32(runtime.NumCPU()), + Stats: &livekit.NodeStats{ + StartedAt: time.Now().Unix(), + UpdatedAt: time.Now().Unix(), + }, }, nil } diff --git a/pkg/routing/redis.go b/pkg/routing/redis.go index 3d08bfc0..9d7f595a 100644 --- a/pkg/routing/redis.go +++ b/pkg/routing/redis.go @@ -2,6 +2,7 @@ package routing import ( "context" + "sync" "github.com/go-redis/redis/v8" "google.golang.org/protobuf/proto" @@ -68,6 +69,7 @@ type RedisSink struct { rc *redis.Client nodeId string participantId string + once sync.Once onClose func() } @@ -75,6 +77,7 @@ func NewRedisSink(rc *redis.Client, nodeId, participantId string) *RedisSink { return &RedisSink{ rc: rc, nodeId: nodeId, + once: sync.Once{}, participantId: participantId, } } @@ -84,10 +87,12 @@ func (s *RedisSink) WriteMessage(msg proto.Message) error { } func (s *RedisSink) Close() { - publishRouterMessage(s.rc, s.nodeId, s.participantId, &livekit.EndSession{}) - if s.onClose != nil { - s.onClose() - } + s.once.Do(func() { + publishRouterMessage(s.rc, s.nodeId, s.participantId, &livekit.EndSession{}) + if s.onClose != nil { + s.onClose() + } + }) } func (s *RedisSink) OnClose(f func()) { diff --git a/pkg/routing/redisrouter.go b/pkg/routing/redisrouter.go index 769dff76..89b2411d 100644 --- a/pkg/routing/redisrouter.go +++ b/pkg/routing/redisrouter.go @@ -2,6 +2,7 @@ package routing import ( "context" + "sync" "time" "github.com/go-redis/redis/v8" @@ -14,7 +15,8 @@ import ( ) const ( - defaultCacheTTL = time.Minute + // expire participant mappings after a day + participantMappingTTL = 24 * time.Hour ) // TODO: need to implement redis key cleanup, for when clients disconnect and such @@ -25,6 +27,7 @@ type RedisRouter struct { rc *redis.Client cr *utils.CachedRedis ctx context.Context + once sync.Once redisSinks map[string]*RedisSink cancel func() @@ -35,6 +38,7 @@ func NewRedisRouter(currentNode LocalNode, rc *redis.Client, useLocal bool) *Red LocalRouter: *NewLocalRouter(currentNode), useLocal: useLocal, rc: rc, + once: sync.Once{}, redisSinks: make(map[string]*RedisSink), } rr.ctx, rr.cancel = context.WithCancel(context.Background()) @@ -55,8 +59,8 @@ func (r *RedisRouter) RegisterNode() error { } func (r *RedisRouter) UnregisterNode() error { - r.rc.HDel(r.ctx, NodesKey, r.currentNode.Id) - return nil + // could be called after Stop(), so we'd want to use an unrelated context + return r.rc.HDel(context.Background(), NodesKey, r.currentNode.Id).Err() } func (r *RedisRouter) GetNodeForRoom(roomName string) (string, error) { @@ -102,7 +106,7 @@ func (r *RedisRouter) ListNodes() ([]*livekit.Node, error) { func (r *RedisRouter) SetParticipantRTCNode(participantId, nodeId string) error { r.cr.Expire(participantRTCKey(participantId)) - err := r.rc.Set(r.ctx, participantRTCKey(participantId), nodeId, 0).Err() + err := r.rc.Set(r.ctx, participantRTCKey(participantId), nodeId, participantMappingTTL).Err() if err != nil { err = errors.Wrap(err, "could not set rtc node") } @@ -173,18 +177,23 @@ func (r *RedisRouter) StartParticipant(roomName, participantId, participantName if r.onNewParticipant == nil { return ErrHandlerNotDefined } + + resSink := r.getOrCreateRedisSink(signalNode, participantId) r.onNewParticipant( roomName, participantId, participantName, r.getOrCreateMessageChannel(r.requestChannels, participantId), - r.getOrCreateRedisSink(signalNode, participantId), + resSink, ) return nil } func (r *RedisRouter) Start() error { - go r.subscribeWorker() + r.once.Do(func() { + go r.statsWorker() + go r.subscribeWorker() + }) return nil } @@ -194,7 +203,7 @@ func (r *RedisRouter) Stop() { func (r *RedisRouter) setParticipantSignalNode(participantId, nodeId string) error { r.cr.Expire(participantSignalKey(participantId)) - if err := r.rc.Set(r.ctx, participantSignalKey(participantId), nodeId, 0).Err(); err != nil { + if err := r.rc.Set(r.ctx, participantSignalKey(participantId), nodeId, participantMappingTTL).Err(); err != nil { return errors.Wrap(err, "could not set signal node") } return nil @@ -229,6 +238,18 @@ func (r *RedisRouter) getParticipantSignalNode(participantId string) (nodeId str return r.cr.CachedGet(participantSignalKey(participantId)) } +// update node stats and cleanup +func (r *RedisRouter) statsWorker() { + for r.ctx.Err() == nil { + // update every 10 seconds + <-time.After(10 * time.Second) + r.currentNode.Stats.UpdatedAt = time.Now().Unix() + if err := r.RegisterNode(); err != nil { + logger.Errorw("could not update node", "error", err) + } + } +} + func (r *RedisRouter) subscribeWorker() { sub := r.rc.Subscribe(redisCtx, nodeChannel(r.currentNode.Id)) diff --git a/pkg/rtc/errors.go b/pkg/rtc/errors.go index 4dd4e946..b4d0aa75 100644 --- a/pkg/rtc/errors.go +++ b/pkg/rtc/errors.go @@ -3,10 +3,11 @@ package rtc import "errors" var ( - ErrRoomIdMissing = errors.New("room is not passed in") - ErrInvalidRoomName = errors.New("room must have a unique name") - ErrRoomNotFound = errors.New("requested room does not exist") - ErrPermissionDenied = errors.New("no permissions to access the room") - ErrUnexpectedOffer = errors.New("expected answer SDP, received offer") - ErrUnexpectedNegotiation = errors.New("client negotiation has not been granted") + ErrInvalidRoomName = errors.New("room must have a unique name") + ErrRoomNotFound = errors.New("requested room does not exist") + ErrRoomClosed = errors.New("room has already closed") + ErrPermissionDenied = errors.New("no permissions to access the room") + ErrMaxParticipantsExceeded = errors.New("room has exceeded its max participants") + ErrUnexpectedOffer = errors.New("expected answer SDP, received offer") + ErrUnexpectedNegotiation = errors.New("client negotiation has not been granted") ) diff --git a/pkg/rtc/participant.go b/pkg/rtc/participant.go index 3cd269fa..cb65847f 100644 --- a/pkg/rtc/participant.go +++ b/pkg/rtc/participant.go @@ -172,9 +172,11 @@ func (p *ParticipantImpl) ToProto() *livekit.ParticipantInfo { State: p.state, } + p.lock.RLock() for _, t := range p.publishedTracks { info.Tracks = append(info.Tracks, ToProtoTrack(t)) } + p.lock.RUnlock() return info } diff --git a/pkg/rtc/room.go b/pkg/rtc/room.go index c1fff42a..900bb698 100644 --- a/pkg/rtc/room.go +++ b/pkg/rtc/room.go @@ -2,6 +2,7 @@ package rtc import ( "sync" + "time" "github.com/thoas/go-funk" @@ -16,6 +17,9 @@ type Room struct { lock sync.RWMutex // map of participantId -> Participant participants map[string]types.Participant + hasJoined bool + isClosed bool + onClose func() } func NewRoom(room *livekit.Room, config WebRTCConfig) *Room { @@ -40,9 +44,19 @@ func (r *Room) GetParticipants() []types.Participant { } func (r *Room) Join(participant types.Participant) error { + if r.isClosed { + return ErrRoomClosed + } + r.lock.Lock() defer r.lock.Unlock() + if r.MaxParticipants > 0 && int(r.MaxParticipants) == len(r.participants) { + return ErrMaxParticipantsExceeded + } + + r.hasJoined = true + // it's important to set this before connection, we don't want to miss out on any publishedTracks participant.OnTrackPublished(r.onTrackAdded) participant.OnStateChange(func(p types.Participant, oldState livekit.ParticipantInfo_State) { @@ -102,6 +116,36 @@ func (r *Room) RemoveParticipant(id string) { } delete(r.participants, id) + + go r.CloseIfEmpty() +} + +// Close the room if all participants had left, or it's still empty past timeout +func (r *Room) CloseIfEmpty() { + if r.isClosed { + return + } + + r.lock.RLock() + numParticipants := len(r.participants) + r.lock.RUnlock() + + if numParticipants > 0 { + return + } + + elapsed := uint32(time.Now().Unix() - r.CreationTime) + logger.Infow("comparing elapsed", "elapsed", elapsed, "timeout", r.EmptyTimeout) + if r.hasJoined || (r.EmptyTimeout > 0 && elapsed >= r.EmptyTimeout) { + r.isClosed = true + if r.onClose != nil { + r.onClose() + } + } +} + +func (r *Room) OnClose(f func()) { + r.onClose = f } // a ParticipantImpl in the room added a new remoteTrack, subscribe other participants to it diff --git a/pkg/rtc/room_test.go b/pkg/rtc/room_test.go index dce87655..f810a080 100644 --- a/pkg/rtc/room_test.go +++ b/pkg/rtc/room_test.go @@ -13,6 +13,7 @@ import ( const ( numParticipants = 3 + defaultDelay = 10 * time.Millisecond ) func TestRoomJoin(t *testing.T) { @@ -61,7 +62,7 @@ func TestRoomJoin(t *testing.T) { rm.RemoveParticipant(p.ID()) p.OnStateChangeArgsForCall(0)(p, livekit.ParticipantInfo_ACTIVE) - time.Sleep(10 * time.Millisecond) + time.Sleep(defaultDelay) for _, op := range participants { if op == p { @@ -72,6 +73,58 @@ func TestRoomJoin(t *testing.T) { assert.Equal(t, 1, fakeP.SendParticipantUpdateCallCount()) } }) + + t.Run("cannot exceed max participants", func(t *testing.T) { + rm := newRoomWithParticipants(t, 1) + rm.MaxParticipants = 1 + p := newMockParticipant("second") + + err := rm.Join(p) + assert.Equal(t, rtc.ErrMaxParticipantsExceeded, err) + }) +} + +func TestRoomClosure(t *testing.T) { + t.Run("room closes after participant leaves", func(t *testing.T) { + rm := newRoomWithParticipants(t, 1) + isClosed := false + rm.OnClose(func() { + isClosed = true + }) + p := rm.GetParticipants()[0] + rm.RemoveParticipant(p.ID()) + + time.Sleep(defaultDelay) + + assert.Len(t, rm.GetParticipants(), 0) + assert.True(t, isClosed) + + assert.Equal(t, rtc.ErrRoomClosed, rm.Join(p)) + }) + + t.Run("room does not close before empty timeout", func(t *testing.T) { + rm := newRoomWithParticipants(t, 0) + isClosed := false + rm.OnClose(func() { + isClosed = true + }) + + rm.CloseIfEmpty() + assert.False(t, isClosed) + }) + + t.Run("room closes after empty timeout", func(t *testing.T) { + rm := newRoomWithParticipants(t, 0) + isClosed := false + rm.OnClose(func() { + isClosed = true + }) + rm.EmptyTimeout = 1 + + time.Sleep(1010 * time.Millisecond) + rm.CloseIfEmpty() + assert.True(t, isClosed) + }) } func TestNewTrack(t *testing.T) { diff --git a/pkg/service/localroomstore.go b/pkg/service/localroomstore.go index 0da693a4..f0b786be 100644 --- a/pkg/service/localroomstore.go +++ b/pkg/service/localroomstore.go @@ -2,6 +2,7 @@ package service import ( "sync" + "time" "github.com/thoas/go-funk" @@ -26,6 +27,9 @@ func NewLocalRoomStore() *LocalRoomStore { } func (p *LocalRoomStore) CreateRoom(room *livekit.Room) error { + if room.CreationTime == 0 { + room.CreationTime = time.Now().Unix() + } p.lock.Lock() p.rooms[room.Sid] = room p.roomIds[room.Name] = room.Sid diff --git a/pkg/service/redisroomstore.go b/pkg/service/redisroomstore.go index 9ffeaa65..ef77a3ac 100644 --- a/pkg/service/redisroomstore.go +++ b/pkg/service/redisroomstore.go @@ -2,6 +2,7 @@ package service import ( "context" + "time" "github.com/go-redis/redis/v8" "github.com/pkg/errors" @@ -31,9 +32,12 @@ func NewRedisRoomStore(rc *redis.Client) *RedisRoomStore { } func (p *RedisRoomStore) CreateRoom(room *livekit.Room) error { + if room.CreationTime == 0 { + room.CreationTime = time.Now().Unix() + } err := p.rc.HSet(p.ctx, RoomIdMap, room.Sid, room.Name).Err() if err != nil { - return err + return errors.Wrap(err, "could not create room") } data, err := proto.Marshal(room) diff --git a/pkg/service/rtcrunner.go b/pkg/service/rtcrunner.go index ff9bda88..2630ec21 100644 --- a/pkg/service/rtcrunner.go +++ b/pkg/service/rtcrunner.go @@ -90,6 +90,15 @@ func (r *RTCRunner) getOrCreateRoom(roomName string) (*rtc.Room, error) { } room = rtc.NewRoom(ri, *r.config) + room.OnClose(func() { + r.lock.Lock() + delete(r.rooms, roomName) + r.lock.Unlock() + // also delete room from db + if err := r.roomProvider.DeleteRoom(roomName); err != nil { + logger.Errorw("could not delete room", "error", err) + } + }) r.lock.Lock() r.rooms[roomName] = room r.lock.Unlock() diff --git a/pkg/service/server.go b/pkg/service/server.go index 65770fd5..737ce09d 100644 --- a/pkg/service/server.go +++ b/pkg/service/server.go @@ -103,6 +103,10 @@ func (s *LivekitServer) Start() error { <-s.doneChan + if err := s.router.UnregisterNode(); err != nil { + logger.Errorw("could not unregister node", "error", err) + } + // wait for shutdown ctx, _ := context.WithTimeout(context.Background(), time.Second*5) s.httpServer.Shutdown(ctx) diff --git a/proto/internal.proto b/proto/internal.proto index 46f58760..869744b6 100644 --- a/proto/internal.proto +++ b/proto/internal.proto @@ -14,8 +14,14 @@ message Node { } message NodeStats { - int32 num_rooms = 1; - int32 num_clients = 2; + // when server was started + int64 started_at = 1; + // when server last reported its status + int64 updated_at = 2; + uint32 num_rooms = 3; + uint32 num_clients = 4; + uint32 num_tracks_in = 5; + uint32 num_tracks_out = 6; } // message for a node through the router diff --git a/proto/livekit/internal.pb.go b/proto/livekit/internal.pb.go index dc6f1b80..2f6e002b 100644 --- a/proto/livekit/internal.pb.go +++ b/proto/livekit/internal.pb.go @@ -101,8 +101,14 @@ type NodeStats struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - NumRooms int32 `protobuf:"varint,1,opt,name=num_rooms,json=numRooms,proto3" json:"num_rooms,omitempty"` - NumClients int32 `protobuf:"varint,2,opt,name=num_clients,json=numClients,proto3" json:"num_clients,omitempty"` + // when server was started + StartedAt int64 `protobuf:"varint,1,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"` + // when server last reported its status + UpdatedAt int64 `protobuf:"varint,2,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + NumRooms uint32 `protobuf:"varint,3,opt,name=num_rooms,json=numRooms,proto3" json:"num_rooms,omitempty"` + NumClients uint32 `protobuf:"varint,4,opt,name=num_clients,json=numClients,proto3" json:"num_clients,omitempty"` + NumTracksIn uint32 `protobuf:"varint,5,opt,name=num_tracks_in,json=numTracksIn,proto3" json:"num_tracks_in,omitempty"` + NumTracksOut uint32 `protobuf:"varint,6,opt,name=num_tracks_out,json=numTracksOut,proto3" json:"num_tracks_out,omitempty"` } func (x *NodeStats) Reset() { @@ -137,20 +143,48 @@ func (*NodeStats) Descriptor() ([]byte, []int) { return file_internal_proto_rawDescGZIP(), []int{1} } -func (x *NodeStats) GetNumRooms() int32 { +func (x *NodeStats) GetStartedAt() int64 { + if x != nil { + return x.StartedAt + } + return 0 +} + +func (x *NodeStats) GetUpdatedAt() int64 { + if x != nil { + return x.UpdatedAt + } + return 0 +} + +func (x *NodeStats) GetNumRooms() uint32 { if x != nil { return x.NumRooms } return 0 } -func (x *NodeStats) GetNumClients() int32 { +func (x *NodeStats) GetNumClients() uint32 { if x != nil { return x.NumClients } return 0 } +func (x *NodeStats) GetNumTracksIn() uint32 { + if x != nil { + return x.NumTracksIn + } + return 0 +} + +func (x *NodeStats) GetNumTracksOut() uint32 { + if x != nil { + return x.NumTracksOut + } + return 0 +} + // message for a node through the router type RouterMessage struct { state protoimpl.MessageState @@ -373,40 +407,48 @@ var file_internal_proto_rawDesc = []byte{ 0x6e, 0x75, 0x6d, 0x43, 0x70, 0x75, 0x73, 0x12, 0x28, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, - 0x73, 0x22, 0x49, 0x0a, 0x09, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x1b, - 0x0a, 0x09, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x6f, 0x6f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x08, 0x6e, 0x75, 0x6d, 0x52, 0x6f, 0x6f, 0x6d, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, - 0x75, 0x6d, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x0a, 0x6e, 0x75, 0x6d, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xa2, 0x02, 0x0a, - 0x0d, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3c, - 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, - 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0c, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x07, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, - 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x08, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x0b, 0x65, 0x6e, 0x64, 0x5f, 0x73, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6c, - 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x45, 0x6e, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x48, 0x00, 0x52, 0x0a, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x25, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, - 0x70, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x22, 0x56, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x29, - 0x0a, 0x10, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, - 0x69, 0x70, 0x61, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x0c, 0x0a, 0x0a, 0x45, 0x6e, 0x64, - 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2f, 0x6c, 0x69, - 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x73, 0x22, 0xd1, 0x01, 0x0a, 0x09, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, + 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, + 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1b, 0x0a, + 0x09, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x6f, 0x6f, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x08, 0x6e, 0x75, 0x6d, 0x52, 0x6f, 0x6f, 0x6d, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x75, + 0x6d, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x0a, 0x6e, 0x75, 0x6d, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x6e, + 0x75, 0x6d, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x73, 0x5f, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x0b, 0x6e, 0x75, 0x6d, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x73, 0x49, 0x6e, 0x12, + 0x24, 0x0a, 0x0e, 0x6e, 0x75, 0x6d, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x73, 0x5f, 0x6f, 0x75, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x6e, 0x75, 0x6d, 0x54, 0x72, 0x61, 0x63, + 0x6b, 0x73, 0x4f, 0x75, 0x74, 0x22, 0xa2, 0x02, 0x0a, 0x0d, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3c, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, + 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, + 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6c, 0x69, + 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x36, 0x0a, 0x0b, 0x65, 0x6e, 0x64, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, + 0x45, 0x6e, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0a, 0x65, 0x6e, + 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x74, + 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x42, + 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x56, 0x0a, 0x0c, 0x53, 0x74, + 0x61, 0x72, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, + 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, + 0x6f, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x61, 0x72, 0x74, 0x69, + 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x4e, 0x61, + 0x6d, 0x65, 0x22, 0x0c, 0x0a, 0x0a, 0x45, 0x6e, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, + 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2d, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6c, 0x69, 0x76, 0x65, + 0x6b, 0x69, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var (