Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4b8b0f094f | |||
| 5c5bb28ebc | |||
| 5f4f42b9b9 |
312
gen/events.pb.go
312
gen/events.pb.go
@@ -29,6 +29,7 @@ const (
|
|||||||
EventType_SLUG_CHANGE EventType = 1
|
EventType_SLUG_CHANGE EventType = 1
|
||||||
EventType_SLUG_CHANGE_RESPONSE EventType = 2
|
EventType_SLUG_CHANGE_RESPONSE EventType = 2
|
||||||
EventType_GET_SESSIONS EventType = 3
|
EventType_GET_SESSIONS EventType = 3
|
||||||
|
EventType_TERMINATE_SESSION EventType = 4
|
||||||
)
|
)
|
||||||
|
|
||||||
// Enum value maps for EventType.
|
// Enum value maps for EventType.
|
||||||
@@ -38,12 +39,14 @@ var (
|
|||||||
1: "SLUG_CHANGE",
|
1: "SLUG_CHANGE",
|
||||||
2: "SLUG_CHANGE_RESPONSE",
|
2: "SLUG_CHANGE_RESPONSE",
|
||||||
3: "GET_SESSIONS",
|
3: "GET_SESSIONS",
|
||||||
|
4: "TERMINATE_SESSION",
|
||||||
}
|
}
|
||||||
EventType_value = map[string]int32{
|
EventType_value = map[string]int32{
|
||||||
"AUTHENTICATION": 0,
|
"AUTHENTICATION": 0,
|
||||||
"SLUG_CHANGE": 1,
|
"SLUG_CHANGE": 1,
|
||||||
"SLUG_CHANGE_RESPONSE": 2,
|
"SLUG_CHANGE_RESPONSE": 2,
|
||||||
"GET_SESSIONS": 3,
|
"GET_SESSIONS": 3,
|
||||||
|
"TERMINATE_SESSION": 4,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -74,6 +77,55 @@ func (EventType) EnumDescriptor() ([]byte, []int) {
|
|||||||
return file_events_proto_rawDescGZIP(), []int{0}
|
return file_events_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type TunnelType int32
|
||||||
|
|
||||||
|
const (
|
||||||
|
TunnelType_UNSPECIFIED TunnelType = 0
|
||||||
|
TunnelType_HTTP TunnelType = 1
|
||||||
|
TunnelType_TCP TunnelType = 2
|
||||||
|
)
|
||||||
|
|
||||||
|
// Enum value maps for TunnelType.
|
||||||
|
var (
|
||||||
|
TunnelType_name = map[int32]string{
|
||||||
|
0: "UNSPECIFIED",
|
||||||
|
1: "HTTP",
|
||||||
|
2: "TCP",
|
||||||
|
}
|
||||||
|
TunnelType_value = map[string]int32{
|
||||||
|
"UNSPECIFIED": 0,
|
||||||
|
"HTTP": 1,
|
||||||
|
"TCP": 2,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
func (x TunnelType) Enum() *TunnelType {
|
||||||
|
p := new(TunnelType)
|
||||||
|
*p = x
|
||||||
|
return p
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x TunnelType) String() string {
|
||||||
|
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (TunnelType) Descriptor() protoreflect.EnumDescriptor {
|
||||||
|
return file_events_proto_enumTypes[1].Descriptor()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (TunnelType) Type() protoreflect.EnumType {
|
||||||
|
return &file_events_proto_enumTypes[1]
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x TunnelType) Number() protoreflect.EnumNumber {
|
||||||
|
return protoreflect.EnumNumber(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use TunnelType.Descriptor instead.
|
||||||
|
func (TunnelType) EnumDescriptor() ([]byte, []int) {
|
||||||
|
return file_events_proto_rawDescGZIP(), []int{1}
|
||||||
|
}
|
||||||
|
|
||||||
type Events struct {
|
type Events struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
Type EventType `protobuf:"varint,1,opt,name=type,proto3,enum=events.EventType" json:"type,omitempty"`
|
Type EventType `protobuf:"varint,1,opt,name=type,proto3,enum=events.EventType" json:"type,omitempty"`
|
||||||
@@ -81,6 +133,7 @@ type Events struct {
|
|||||||
//
|
//
|
||||||
// *Events_SlugEvent
|
// *Events_SlugEvent
|
||||||
// *Events_GetSessionsEvent
|
// *Events_GetSessionsEvent
|
||||||
|
// *Events_TerminateSessionEvent
|
||||||
Payload isEvents_Payload `protobuf_oneof:"payload"`
|
Payload isEvents_Payload `protobuf_oneof:"payload"`
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@@ -148,6 +201,15 @@ func (x *Events) GetGetSessionsEvent() *GetSessionsEvent {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *Events) GetTerminateSessionEvent() *TerminateSessionEvent {
|
||||||
|
if x != nil {
|
||||||
|
if x, ok := x.Payload.(*Events_TerminateSessionEvent); ok {
|
||||||
|
return x.TerminateSessionEvent
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
type isEvents_Payload interface {
|
type isEvents_Payload interface {
|
||||||
isEvents_Payload()
|
isEvents_Payload()
|
||||||
}
|
}
|
||||||
@@ -160,10 +222,16 @@ type Events_GetSessionsEvent struct {
|
|||||||
GetSessionsEvent *GetSessionsEvent `protobuf:"bytes,12,opt,name=get_sessions_event,json=getSessionsEvent,proto3,oneof"`
|
GetSessionsEvent *GetSessionsEvent `protobuf:"bytes,12,opt,name=get_sessions_event,json=getSessionsEvent,proto3,oneof"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Events_TerminateSessionEvent struct {
|
||||||
|
TerminateSessionEvent *TerminateSessionEvent `protobuf:"bytes,13,opt,name=terminate_session_event,json=terminateSessionEvent,proto3,oneof"`
|
||||||
|
}
|
||||||
|
|
||||||
func (*Events_SlugEvent) isEvents_Payload() {}
|
func (*Events_SlugEvent) isEvents_Payload() {}
|
||||||
|
|
||||||
func (*Events_GetSessionsEvent) isEvents_Payload() {}
|
func (*Events_GetSessionsEvent) isEvents_Payload() {}
|
||||||
|
|
||||||
|
func (*Events_TerminateSessionEvent) isEvents_Payload() {}
|
||||||
|
|
||||||
type Node struct {
|
type Node struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
Type EventType `protobuf:"varint,1,opt,name=type,proto3,enum=events.EventType" json:"type,omitempty"`
|
Type EventType `protobuf:"varint,1,opt,name=type,proto3,enum=events.EventType" json:"type,omitempty"`
|
||||||
@@ -172,6 +240,7 @@ type Node struct {
|
|||||||
// *Node_AuthEvent
|
// *Node_AuthEvent
|
||||||
// *Node_SlugEventResponse
|
// *Node_SlugEventResponse
|
||||||
// *Node_GetSessionsEvent
|
// *Node_GetSessionsEvent
|
||||||
|
// *Node_TerminateSessionEventResponse
|
||||||
Payload isNode_Payload `protobuf_oneof:"payload"`
|
Payload isNode_Payload `protobuf_oneof:"payload"`
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@@ -248,6 +317,15 @@ func (x *Node) GetGetSessionsEvent() *GetSessionsResponse {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *Node) GetTerminateSessionEventResponse() *TerminateSessionEventResponse {
|
||||||
|
if x != nil {
|
||||||
|
if x, ok := x.Payload.(*Node_TerminateSessionEventResponse); ok {
|
||||||
|
return x.TerminateSessionEventResponse
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
type isNode_Payload interface {
|
type isNode_Payload interface {
|
||||||
isNode_Payload()
|
isNode_Payload()
|
||||||
}
|
}
|
||||||
@@ -264,12 +342,18 @@ type Node_GetSessionsEvent struct {
|
|||||||
GetSessionsEvent *GetSessionsResponse `protobuf:"bytes,12,opt,name=get_sessions_event,json=getSessionsEvent,proto3,oneof"`
|
GetSessionsEvent *GetSessionsResponse `protobuf:"bytes,12,opt,name=get_sessions_event,json=getSessionsEvent,proto3,oneof"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Node_TerminateSessionEventResponse struct {
|
||||||
|
TerminateSessionEventResponse *TerminateSessionEventResponse `protobuf:"bytes,13,opt,name=terminate_session_event_response,json=terminateSessionEventResponse,proto3,oneof"`
|
||||||
|
}
|
||||||
|
|
||||||
func (*Node_AuthEvent) isNode_Payload() {}
|
func (*Node_AuthEvent) isNode_Payload() {}
|
||||||
|
|
||||||
func (*Node_SlugEventResponse) isNode_Payload() {}
|
func (*Node_SlugEventResponse) isNode_Payload() {}
|
||||||
|
|
||||||
func (*Node_GetSessionsEvent) isNode_Payload() {}
|
func (*Node_GetSessionsEvent) isNode_Payload() {}
|
||||||
|
|
||||||
|
func (*Node_TerminateSessionEventResponse) isNode_Payload() {}
|
||||||
|
|
||||||
type Authentication struct {
|
type Authentication struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
AuthToken string `protobuf:"bytes,1,opt,name=auth_token,json=authToken,proto3" json:"auth_token,omitempty"`
|
AuthToken string `protobuf:"bytes,1,opt,name=auth_token,json=authToken,proto3" json:"auth_token,omitempty"`
|
||||||
@@ -324,8 +408,9 @@ func (x *Authentication) GetIdentity() string {
|
|||||||
|
|
||||||
type SlugChangeEvent struct {
|
type SlugChangeEvent struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
Old string `protobuf:"bytes,1,opt,name=old,proto3" json:"old,omitempty"`
|
User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
|
||||||
New string `protobuf:"bytes,2,opt,name=new,proto3" json:"new,omitempty"`
|
Old string `protobuf:"bytes,2,opt,name=old,proto3" json:"old,omitempty"`
|
||||||
|
New string `protobuf:"bytes,3,opt,name=new,proto3" json:"new,omitempty"`
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
}
|
}
|
||||||
@@ -360,6 +445,13 @@ func (*SlugChangeEvent) Descriptor() ([]byte, []int) {
|
|||||||
return file_events_proto_rawDescGZIP(), []int{3}
|
return file_events_proto_rawDescGZIP(), []int{3}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *SlugChangeEvent) GetUser() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.User
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
func (x *SlugChangeEvent) GetOld() string {
|
func (x *SlugChangeEvent) GetOld() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Old
|
return x.Old
|
||||||
@@ -598,32 +690,147 @@ func (x *Detail) GetStartedAt() *timestamppb.Timestamp {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type TerminateSessionEvent struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
|
||||||
|
TunnelType TunnelType `protobuf:"varint,2,opt,name=tunnelType,proto3,enum=events.TunnelType" json:"tunnelType,omitempty"`
|
||||||
|
Slug string `protobuf:"bytes,3,opt,name=slug,proto3" json:"slug,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *TerminateSessionEvent) Reset() {
|
||||||
|
*x = TerminateSessionEvent{}
|
||||||
|
mi := &file_events_proto_msgTypes[8]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *TerminateSessionEvent) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*TerminateSessionEvent) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *TerminateSessionEvent) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_events_proto_msgTypes[8]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use TerminateSessionEvent.ProtoReflect.Descriptor instead.
|
||||||
|
func (*TerminateSessionEvent) Descriptor() ([]byte, []int) {
|
||||||
|
return file_events_proto_rawDescGZIP(), []int{8}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *TerminateSessionEvent) GetUser() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.User
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *TerminateSessionEvent) GetTunnelType() TunnelType {
|
||||||
|
if x != nil {
|
||||||
|
return x.TunnelType
|
||||||
|
}
|
||||||
|
return TunnelType_UNSPECIFIED
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *TerminateSessionEvent) GetSlug() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Slug
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
type TerminateSessionEventResponse struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
||||||
|
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *TerminateSessionEventResponse) Reset() {
|
||||||
|
*x = TerminateSessionEventResponse{}
|
||||||
|
mi := &file_events_proto_msgTypes[9]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *TerminateSessionEventResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*TerminateSessionEventResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *TerminateSessionEventResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_events_proto_msgTypes[9]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use TerminateSessionEventResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*TerminateSessionEventResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_events_proto_rawDescGZIP(), []int{9}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *TerminateSessionEventResponse) GetSuccess() bool {
|
||||||
|
if x != nil {
|
||||||
|
return x.Success
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *TerminateSessionEventResponse) GetMessage() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Message
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
var File_events_proto protoreflect.FileDescriptor
|
var File_events_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
const file_events_proto_rawDesc = "" +
|
const file_events_proto_rawDesc = "" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"\fevents.proto\x12\x06events\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbe\x01\n" +
|
"\fevents.proto\x12\x06events\x1a\x1fgoogle/protobuf/timestamp.proto\"\x97\x02\n" +
|
||||||
"\x06Events\x12%\n" +
|
"\x06Events\x12%\n" +
|
||||||
"\x04type\x18\x01 \x01(\x0e2\x11.events.EventTypeR\x04type\x128\n" +
|
"\x04type\x18\x01 \x01(\x0e2\x11.events.EventTypeR\x04type\x128\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"slug_event\x18\v \x01(\v2\x17.events.SlugChangeEventH\x00R\tslugEvent\x12H\n" +
|
"slug_event\x18\v \x01(\v2\x17.events.SlugChangeEventH\x00R\tslugEvent\x12H\n" +
|
||||||
"\x12get_sessions_event\x18\f \x01(\v2\x18.events.GetSessionsEventH\x00R\x10getSessionsEventB\t\n" +
|
"\x12get_sessions_event\x18\f \x01(\v2\x18.events.GetSessionsEventH\x00R\x10getSessionsEvent\x12W\n" +
|
||||||
"\apayload\"\x91\x02\n" +
|
"\x17terminate_session_event\x18\r \x01(\v2\x1d.events.TerminateSessionEventH\x00R\x15terminateSessionEventB\t\n" +
|
||||||
|
"\apayload\"\x83\x03\n" +
|
||||||
"\x04Node\x12%\n" +
|
"\x04Node\x12%\n" +
|
||||||
"\x04type\x18\x01 \x01(\x0e2\x11.events.EventTypeR\x04type\x127\n" +
|
"\x04type\x18\x01 \x01(\x0e2\x11.events.EventTypeR\x04type\x127\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"auth_event\x18\n" +
|
"auth_event\x18\n" +
|
||||||
" \x01(\v2\x16.events.AuthenticationH\x00R\tauthEvent\x12Q\n" +
|
" \x01(\v2\x16.events.AuthenticationH\x00R\tauthEvent\x12Q\n" +
|
||||||
"\x13slug_event_response\x18\v \x01(\v2\x1f.events.SlugChangeEventResponseH\x00R\x11slugEventResponse\x12K\n" +
|
"\x13slug_event_response\x18\v \x01(\v2\x1f.events.SlugChangeEventResponseH\x00R\x11slugEventResponse\x12K\n" +
|
||||||
"\x12get_sessions_event\x18\f \x01(\v2\x1b.events.GetSessionsResponseH\x00R\x10getSessionsEventB\t\n" +
|
"\x12get_sessions_event\x18\f \x01(\v2\x1b.events.GetSessionsResponseH\x00R\x10getSessionsEvent\x12p\n" +
|
||||||
|
" terminate_session_event_response\x18\r \x01(\v2%.events.TerminateSessionEventResponseH\x00R\x1dterminateSessionEventResponseB\t\n" +
|
||||||
"\apayload\"K\n" +
|
"\apayload\"K\n" +
|
||||||
"\x0eAuthentication\x12\x1d\n" +
|
"\x0eAuthentication\x12\x1d\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"auth_token\x18\x01 \x01(\tR\tauthToken\x12\x1a\n" +
|
"auth_token\x18\x01 \x01(\tR\tauthToken\x12\x1a\n" +
|
||||||
"\bidentity\x18\x02 \x01(\tR\bidentity\"5\n" +
|
"\bidentity\x18\x02 \x01(\tR\bidentity\"I\n" +
|
||||||
"\x0fSlugChangeEvent\x12\x10\n" +
|
"\x0fSlugChangeEvent\x12\x12\n" +
|
||||||
"\x03old\x18\x01 \x01(\tR\x03old\x12\x10\n" +
|
"\x04user\x18\x01 \x01(\tR\x04user\x12\x10\n" +
|
||||||
"\x03new\x18\x02 \x01(\tR\x03new\"M\n" +
|
"\x03old\x18\x02 \x01(\tR\x03old\x12\x10\n" +
|
||||||
|
"\x03new\x18\x03 \x01(\tR\x03new\"M\n" +
|
||||||
"\x17SlugChangeEventResponse\x12\x18\n" +
|
"\x17SlugChangeEventResponse\x12\x18\n" +
|
||||||
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
|
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
|
||||||
"\amessage\x18\x02 \x01(\tR\amessage\".\n" +
|
"\amessage\x18\x02 \x01(\tR\amessage\".\n" +
|
||||||
@@ -638,12 +845,27 @@ const file_events_proto_rawDesc = "" +
|
|||||||
"\auser_id\x18\x04 \x01(\tR\x06userId\x12\x16\n" +
|
"\auser_id\x18\x04 \x01(\tR\x06userId\x12\x16\n" +
|
||||||
"\x06active\x18\x05 \x01(\bR\x06active\x129\n" +
|
"\x06active\x18\x05 \x01(\bR\x06active\x129\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"started_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tstartedAt*\\\n" +
|
"started_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tstartedAt\"s\n" +
|
||||||
|
"\x15TerminateSessionEvent\x12\x12\n" +
|
||||||
|
"\x04user\x18\x01 \x01(\tR\x04user\x122\n" +
|
||||||
|
"\n" +
|
||||||
|
"tunnelType\x18\x02 \x01(\x0e2\x12.events.TunnelTypeR\n" +
|
||||||
|
"tunnelType\x12\x12\n" +
|
||||||
|
"\x04slug\x18\x03 \x01(\tR\x04slug\"S\n" +
|
||||||
|
"\x1dTerminateSessionEventResponse\x12\x18\n" +
|
||||||
|
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
|
||||||
|
"\amessage\x18\x02 \x01(\tR\amessage*s\n" +
|
||||||
"\tEventType\x12\x12\n" +
|
"\tEventType\x12\x12\n" +
|
||||||
"\x0eAUTHENTICATION\x10\x00\x12\x0f\n" +
|
"\x0eAUTHENTICATION\x10\x00\x12\x0f\n" +
|
||||||
"\vSLUG_CHANGE\x10\x01\x12\x18\n" +
|
"\vSLUG_CHANGE\x10\x01\x12\x18\n" +
|
||||||
"\x14SLUG_CHANGE_RESPONSE\x10\x02\x12\x10\n" +
|
"\x14SLUG_CHANGE_RESPONSE\x10\x02\x12\x10\n" +
|
||||||
"\fGET_SESSIONS\x10\x032=\n" +
|
"\fGET_SESSIONS\x10\x03\x12\x15\n" +
|
||||||
|
"\x11TERMINATE_SESSION\x10\x04*0\n" +
|
||||||
|
"\n" +
|
||||||
|
"TunnelType\x12\x0f\n" +
|
||||||
|
"\vUNSPECIFIED\x10\x00\x12\b\n" +
|
||||||
|
"\x04HTTP\x10\x01\x12\a\n" +
|
||||||
|
"\x03TCP\x10\x022=\n" +
|
||||||
"\fEventService\x12-\n" +
|
"\fEventService\x12-\n" +
|
||||||
"\tSubscribe\x12\f.events.Node\x1a\x0e.events.Events(\x010\x01B\aZ\x05./genb\x06proto3"
|
"\tSubscribe\x12\f.events.Node\x1a\x0e.events.Events(\x010\x01B\aZ\x05./genb\x06proto3"
|
||||||
|
|
||||||
@@ -659,37 +881,43 @@ func file_events_proto_rawDescGZIP() []byte {
|
|||||||
return file_events_proto_rawDescData
|
return file_events_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_events_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
var file_events_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
||||||
var file_events_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
|
var file_events_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
|
||||||
var file_events_proto_goTypes = []any{
|
var file_events_proto_goTypes = []any{
|
||||||
(EventType)(0), // 0: events.EventType
|
(EventType)(0), // 0: events.EventType
|
||||||
(*Events)(nil), // 1: events.Events
|
(TunnelType)(0), // 1: events.TunnelType
|
||||||
(*Node)(nil), // 2: events.Node
|
(*Events)(nil), // 2: events.Events
|
||||||
(*Authentication)(nil), // 3: events.Authentication
|
(*Node)(nil), // 3: events.Node
|
||||||
(*SlugChangeEvent)(nil), // 4: events.SlugChangeEvent
|
(*Authentication)(nil), // 4: events.Authentication
|
||||||
(*SlugChangeEventResponse)(nil), // 5: events.SlugChangeEventResponse
|
(*SlugChangeEvent)(nil), // 5: events.SlugChangeEvent
|
||||||
(*GetSessionsEvent)(nil), // 6: events.GetSessionsEvent
|
(*SlugChangeEventResponse)(nil), // 6: events.SlugChangeEventResponse
|
||||||
(*GetSessionsResponse)(nil), // 7: events.GetSessionsResponse
|
(*GetSessionsEvent)(nil), // 7: events.GetSessionsEvent
|
||||||
(*Detail)(nil), // 8: events.Detail
|
(*GetSessionsResponse)(nil), // 8: events.GetSessionsResponse
|
||||||
(*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp
|
(*Detail)(nil), // 9: events.Detail
|
||||||
|
(*TerminateSessionEvent)(nil), // 10: events.TerminateSessionEvent
|
||||||
|
(*TerminateSessionEventResponse)(nil), // 11: events.TerminateSessionEventResponse
|
||||||
|
(*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp
|
||||||
}
|
}
|
||||||
var file_events_proto_depIdxs = []int32{
|
var file_events_proto_depIdxs = []int32{
|
||||||
0, // 0: events.Events.type:type_name -> events.EventType
|
0, // 0: events.Events.type:type_name -> events.EventType
|
||||||
4, // 1: events.Events.slug_event:type_name -> events.SlugChangeEvent
|
5, // 1: events.Events.slug_event:type_name -> events.SlugChangeEvent
|
||||||
6, // 2: events.Events.get_sessions_event:type_name -> events.GetSessionsEvent
|
7, // 2: events.Events.get_sessions_event:type_name -> events.GetSessionsEvent
|
||||||
0, // 3: events.Node.type:type_name -> events.EventType
|
10, // 3: events.Events.terminate_session_event:type_name -> events.TerminateSessionEvent
|
||||||
3, // 4: events.Node.auth_event:type_name -> events.Authentication
|
0, // 4: events.Node.type:type_name -> events.EventType
|
||||||
5, // 5: events.Node.slug_event_response:type_name -> events.SlugChangeEventResponse
|
4, // 5: events.Node.auth_event:type_name -> events.Authentication
|
||||||
7, // 6: events.Node.get_sessions_event:type_name -> events.GetSessionsResponse
|
6, // 6: events.Node.slug_event_response:type_name -> events.SlugChangeEventResponse
|
||||||
8, // 7: events.GetSessionsResponse.details:type_name -> events.Detail
|
8, // 7: events.Node.get_sessions_event:type_name -> events.GetSessionsResponse
|
||||||
9, // 8: events.Detail.started_at:type_name -> google.protobuf.Timestamp
|
11, // 8: events.Node.terminate_session_event_response:type_name -> events.TerminateSessionEventResponse
|
||||||
2, // 9: events.EventService.Subscribe:input_type -> events.Node
|
9, // 9: events.GetSessionsResponse.details:type_name -> events.Detail
|
||||||
1, // 10: events.EventService.Subscribe:output_type -> events.Events
|
12, // 10: events.Detail.started_at:type_name -> google.protobuf.Timestamp
|
||||||
10, // [10:11] is the sub-list for method output_type
|
1, // 11: events.TerminateSessionEvent.tunnelType:type_name -> events.TunnelType
|
||||||
9, // [9:10] is the sub-list for method input_type
|
3, // 12: events.EventService.Subscribe:input_type -> events.Node
|
||||||
9, // [9:9] is the sub-list for extension type_name
|
2, // 13: events.EventService.Subscribe:output_type -> events.Events
|
||||||
9, // [9:9] is the sub-list for extension extendee
|
13, // [13:14] is the sub-list for method output_type
|
||||||
0, // [0:9] is the sub-list for field type_name
|
12, // [12:13] is the sub-list for method input_type
|
||||||
|
12, // [12:12] is the sub-list for extension type_name
|
||||||
|
12, // [12:12] is the sub-list for extension extendee
|
||||||
|
0, // [0:12] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_events_proto_init() }
|
func init() { file_events_proto_init() }
|
||||||
@@ -700,19 +928,21 @@ func file_events_proto_init() {
|
|||||||
file_events_proto_msgTypes[0].OneofWrappers = []any{
|
file_events_proto_msgTypes[0].OneofWrappers = []any{
|
||||||
(*Events_SlugEvent)(nil),
|
(*Events_SlugEvent)(nil),
|
||||||
(*Events_GetSessionsEvent)(nil),
|
(*Events_GetSessionsEvent)(nil),
|
||||||
|
(*Events_TerminateSessionEvent)(nil),
|
||||||
}
|
}
|
||||||
file_events_proto_msgTypes[1].OneofWrappers = []any{
|
file_events_proto_msgTypes[1].OneofWrappers = []any{
|
||||||
(*Node_AuthEvent)(nil),
|
(*Node_AuthEvent)(nil),
|
||||||
(*Node_SlugEventResponse)(nil),
|
(*Node_SlugEventResponse)(nil),
|
||||||
(*Node_GetSessionsEvent)(nil),
|
(*Node_GetSessionsEvent)(nil),
|
||||||
|
(*Node_TerminateSessionEventResponse)(nil),
|
||||||
}
|
}
|
||||||
type x struct{}
|
type x struct{}
|
||||||
out := protoimpl.TypeBuilder{
|
out := protoimpl.TypeBuilder{
|
||||||
File: protoimpl.DescBuilder{
|
File: protoimpl.DescBuilder{
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_events_proto_rawDesc), len(file_events_proto_rawDesc)),
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_events_proto_rawDesc), len(file_events_proto_rawDesc)),
|
||||||
NumEnums: 1,
|
NumEnums: 2,
|
||||||
NumMessages: 8,
|
NumMessages: 10,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 1,
|
NumServices: 1,
|
||||||
},
|
},
|
||||||
|
|||||||
202
gen/slug.pb.go
202
gen/slug.pb.go
@@ -1,202 +0,0 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// protoc-gen-go v1.36.11
|
|
||||||
// protoc v6.33.2
|
|
||||||
// source: slug.proto
|
|
||||||
|
|
||||||
package gen
|
|
||||||
|
|
||||||
import (
|
|
||||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
||||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
||||||
reflect "reflect"
|
|
||||||
sync "sync"
|
|
||||||
unsafe "unsafe"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
// Verify that this generated code is sufficiently up-to-date.
|
|
||||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
|
||||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
|
||||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
|
||||||
)
|
|
||||||
|
|
||||||
type ChangeSlugRequest struct {
|
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
|
||||||
Node string `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
|
|
||||||
Old string `protobuf:"bytes,2,opt,name=old,proto3" json:"old,omitempty"`
|
|
||||||
New string `protobuf:"bytes,3,opt,name=new,proto3" json:"new,omitempty"`
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChangeSlugRequest) Reset() {
|
|
||||||
*x = ChangeSlugRequest{}
|
|
||||||
mi := &file_slug_proto_msgTypes[0]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChangeSlugRequest) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*ChangeSlugRequest) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *ChangeSlugRequest) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_slug_proto_msgTypes[0]
|
|
||||||
if x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use ChangeSlugRequest.ProtoReflect.Descriptor instead.
|
|
||||||
func (*ChangeSlugRequest) Descriptor() ([]byte, []int) {
|
|
||||||
return file_slug_proto_rawDescGZIP(), []int{0}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChangeSlugRequest) GetNode() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.Node
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChangeSlugRequest) GetOld() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.Old
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChangeSlugRequest) GetNew() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.New
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
type ChangeSlugResponse struct {
|
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
|
||||||
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
|
||||||
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChangeSlugResponse) Reset() {
|
|
||||||
*x = ChangeSlugResponse{}
|
|
||||||
mi := &file_slug_proto_msgTypes[1]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChangeSlugResponse) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*ChangeSlugResponse) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *ChangeSlugResponse) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_slug_proto_msgTypes[1]
|
|
||||||
if x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use ChangeSlugResponse.ProtoReflect.Descriptor instead.
|
|
||||||
func (*ChangeSlugResponse) Descriptor() ([]byte, []int) {
|
|
||||||
return file_slug_proto_rawDescGZIP(), []int{1}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChangeSlugResponse) GetSuccess() bool {
|
|
||||||
if x != nil {
|
|
||||||
return x.Success
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChangeSlugResponse) GetMessage() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.Message
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
var File_slug_proto protoreflect.FileDescriptor
|
|
||||||
|
|
||||||
const file_slug_proto_rawDesc = "" +
|
|
||||||
"\n" +
|
|
||||||
"\n" +
|
|
||||||
"slug.proto\x12\x04slug\"K\n" +
|
|
||||||
"\x11ChangeSlugRequest\x12\x12\n" +
|
|
||||||
"\x04node\x18\x01 \x01(\tR\x04node\x12\x10\n" +
|
|
||||||
"\x03old\x18\x02 \x01(\tR\x03old\x12\x10\n" +
|
|
||||||
"\x03new\x18\x03 \x01(\tR\x03new\"H\n" +
|
|
||||||
"\x12ChangeSlugResponse\x12\x18\n" +
|
|
||||||
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
|
|
||||||
"\amessage\x18\x02 \x01(\tR\amessage2T\n" +
|
|
||||||
"\n" +
|
|
||||||
"SlugChange\x12F\n" +
|
|
||||||
"\x11RequestChangeSlug\x12\x17.slug.ChangeSlugRequest\x1a\x18.slug.ChangeSlugResponseB\aZ\x05./genb\x06proto3"
|
|
||||||
|
|
||||||
var (
|
|
||||||
file_slug_proto_rawDescOnce sync.Once
|
|
||||||
file_slug_proto_rawDescData []byte
|
|
||||||
)
|
|
||||||
|
|
||||||
func file_slug_proto_rawDescGZIP() []byte {
|
|
||||||
file_slug_proto_rawDescOnce.Do(func() {
|
|
||||||
file_slug_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_slug_proto_rawDesc), len(file_slug_proto_rawDesc)))
|
|
||||||
})
|
|
||||||
return file_slug_proto_rawDescData
|
|
||||||
}
|
|
||||||
|
|
||||||
var file_slug_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
|
||||||
var file_slug_proto_goTypes = []any{
|
|
||||||
(*ChangeSlugRequest)(nil), // 0: slug.ChangeSlugRequest
|
|
||||||
(*ChangeSlugResponse)(nil), // 1: slug.ChangeSlugResponse
|
|
||||||
}
|
|
||||||
var file_slug_proto_depIdxs = []int32{
|
|
||||||
0, // 0: slug.SlugChange.RequestChangeSlug:input_type -> slug.ChangeSlugRequest
|
|
||||||
1, // 1: slug.SlugChange.RequestChangeSlug:output_type -> slug.ChangeSlugResponse
|
|
||||||
1, // [1:2] is the sub-list for method output_type
|
|
||||||
0, // [0:1] is the sub-list for method input_type
|
|
||||||
0, // [0:0] is the sub-list for extension type_name
|
|
||||||
0, // [0:0] is the sub-list for extension extendee
|
|
||||||
0, // [0:0] is the sub-list for field type_name
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() { file_slug_proto_init() }
|
|
||||||
func file_slug_proto_init() {
|
|
||||||
if File_slug_proto != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
type x struct{}
|
|
||||||
out := protoimpl.TypeBuilder{
|
|
||||||
File: protoimpl.DescBuilder{
|
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
||||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_slug_proto_rawDesc), len(file_slug_proto_rawDesc)),
|
|
||||||
NumEnums: 0,
|
|
||||||
NumMessages: 2,
|
|
||||||
NumExtensions: 0,
|
|
||||||
NumServices: 1,
|
|
||||||
},
|
|
||||||
GoTypes: file_slug_proto_goTypes,
|
|
||||||
DependencyIndexes: file_slug_proto_depIdxs,
|
|
||||||
MessageInfos: file_slug_proto_msgTypes,
|
|
||||||
}.Build()
|
|
||||||
File_slug_proto = out.File
|
|
||||||
file_slug_proto_goTypes = nil
|
|
||||||
file_slug_proto_depIdxs = nil
|
|
||||||
}
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// - protoc-gen-go-grpc v1.6.0
|
|
||||||
// - protoc v6.33.2
|
|
||||||
// source: slug.proto
|
|
||||||
|
|
||||||
package gen
|
|
||||||
|
|
||||||
import (
|
|
||||||
context "context"
|
|
||||||
grpc "google.golang.org/grpc"
|
|
||||||
codes "google.golang.org/grpc/codes"
|
|
||||||
status "google.golang.org/grpc/status"
|
|
||||||
)
|
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
|
||||||
// is compatible with the grpc package it is being compiled against.
|
|
||||||
// Requires gRPC-Go v1.64.0 or later.
|
|
||||||
const _ = grpc.SupportPackageIsVersion9
|
|
||||||
|
|
||||||
const (
|
|
||||||
SlugChange_RequestChangeSlug_FullMethodName = "/slug.SlugChange/RequestChangeSlug"
|
|
||||||
)
|
|
||||||
|
|
||||||
// SlugChangeClient is the client API for SlugChange service.
|
|
||||||
//
|
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
||||||
type SlugChangeClient interface {
|
|
||||||
RequestChangeSlug(ctx context.Context, in *ChangeSlugRequest, opts ...grpc.CallOption) (*ChangeSlugResponse, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
type slugChangeClient struct {
|
|
||||||
cc grpc.ClientConnInterface
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewSlugChangeClient(cc grpc.ClientConnInterface) SlugChangeClient {
|
|
||||||
return &slugChangeClient{cc}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *slugChangeClient) RequestChangeSlug(ctx context.Context, in *ChangeSlugRequest, opts ...grpc.CallOption) (*ChangeSlugResponse, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(ChangeSlugResponse)
|
|
||||||
err := c.cc.Invoke(ctx, SlugChange_RequestChangeSlug_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// SlugChangeServer is the server API for SlugChange service.
|
|
||||||
// All implementations must embed UnimplementedSlugChangeServer
|
|
||||||
// for forward compatibility.
|
|
||||||
type SlugChangeServer interface {
|
|
||||||
RequestChangeSlug(context.Context, *ChangeSlugRequest) (*ChangeSlugResponse, error)
|
|
||||||
mustEmbedUnimplementedSlugChangeServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnimplementedSlugChangeServer must be embedded to have
|
|
||||||
// forward compatible implementations.
|
|
||||||
//
|
|
||||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
|
||||||
// pointer dereference when methods are called.
|
|
||||||
type UnimplementedSlugChangeServer struct{}
|
|
||||||
|
|
||||||
func (UnimplementedSlugChangeServer) RequestChangeSlug(context.Context, *ChangeSlugRequest) (*ChangeSlugResponse, error) {
|
|
||||||
return nil, status.Error(codes.Unimplemented, "method RequestChangeSlug not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedSlugChangeServer) mustEmbedUnimplementedSlugChangeServer() {}
|
|
||||||
func (UnimplementedSlugChangeServer) testEmbeddedByValue() {}
|
|
||||||
|
|
||||||
// UnsafeSlugChangeServer may be embedded to opt out of forward compatibility for this service.
|
|
||||||
// Use of this interface is not recommended, as added methods to SlugChangeServer will
|
|
||||||
// result in compilation errors.
|
|
||||||
type UnsafeSlugChangeServer interface {
|
|
||||||
mustEmbedUnimplementedSlugChangeServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterSlugChangeServer(s grpc.ServiceRegistrar, srv SlugChangeServer) {
|
|
||||||
// If the following call panics, it indicates UnimplementedSlugChangeServer was
|
|
||||||
// embedded by pointer and is nil. This will cause panics if an
|
|
||||||
// unimplemented method is ever invoked, so we test this at initialization
|
|
||||||
// time to prevent it from happening at runtime later due to I/O.
|
|
||||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
||||||
t.testEmbeddedByValue()
|
|
||||||
}
|
|
||||||
s.RegisterService(&SlugChange_ServiceDesc, srv)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _SlugChange_RequestChangeSlug_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(ChangeSlugRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(SlugChangeServer).RequestChangeSlug(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: SlugChange_RequestChangeSlug_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(SlugChangeServer).RequestChangeSlug(ctx, req.(*ChangeSlugRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SlugChange_ServiceDesc is the grpc.ServiceDesc for SlugChange service.
|
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
|
||||||
// and not to be introspected or modified (even as a copy)
|
|
||||||
var SlugChange_ServiceDesc = grpc.ServiceDesc{
|
|
||||||
ServiceName: "slug.SlugChange",
|
|
||||||
HandlerType: (*SlugChangeServer)(nil),
|
|
||||||
Methods: []grpc.MethodDesc{
|
|
||||||
{
|
|
||||||
MethodName: "RequestChangeSlug",
|
|
||||||
Handler: _SlugChange_RequestChangeSlug_Handler,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Streams: []grpc.StreamDesc{},
|
|
||||||
Metadata: "slug.proto",
|
|
||||||
}
|
|
||||||
4
go.mod
4
go.mod
@@ -13,3 +13,7 @@ require (
|
|||||||
golang.org/x/text v0.31.0 // indirect
|
golang.org/x/text v0.31.0 // indirect
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20251029180050-ab9386a59fda // indirect
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20251029180050-ab9386a59fda // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
|
replace (
|
||||||
|
git.fossy.my.id/bagas/tunnel-please-grpc => ../tunnel-please-grpc
|
||||||
|
)
|
||||||
@@ -15,6 +15,7 @@ enum EventType {
|
|||||||
SLUG_CHANGE = 1;
|
SLUG_CHANGE = 1;
|
||||||
SLUG_CHANGE_RESPONSE = 2;
|
SLUG_CHANGE_RESPONSE = 2;
|
||||||
GET_SESSIONS = 3;
|
GET_SESSIONS = 3;
|
||||||
|
TERMINATE_SESSION = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Events {
|
message Events {
|
||||||
@@ -23,6 +24,7 @@ message Events {
|
|||||||
oneof payload {
|
oneof payload {
|
||||||
SlugChangeEvent slug_event = 11;
|
SlugChangeEvent slug_event = 11;
|
||||||
GetSessionsEvent get_sessions_event = 12;
|
GetSessionsEvent get_sessions_event = 12;
|
||||||
|
TerminateSessionEvent terminate_session_event = 13;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,6 +35,7 @@ message Node {
|
|||||||
Authentication auth_event = 10;
|
Authentication auth_event = 10;
|
||||||
SlugChangeEventResponse slug_event_response = 11;
|
SlugChangeEventResponse slug_event_response = 11;
|
||||||
GetSessionsResponse get_sessions_event = 12;
|
GetSessionsResponse get_sessions_event = 12;
|
||||||
|
TerminateSessionEventResponse terminate_session_event_response = 13;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,8 +45,9 @@ message Authentication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message SlugChangeEvent {
|
message SlugChangeEvent {
|
||||||
string old = 1;
|
string user = 1;
|
||||||
string new = 2;
|
string old = 2;
|
||||||
|
string new = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SlugChangeEventResponse {
|
message SlugChangeEventResponse {
|
||||||
@@ -66,4 +70,21 @@ message Detail {
|
|||||||
string user_id = 4;
|
string user_id = 4;
|
||||||
bool active = 5;
|
bool active = 5;
|
||||||
google.protobuf.Timestamp started_at = 6;
|
google.protobuf.Timestamp started_at = 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum TunnelType {
|
||||||
|
UNSPECIFIED = 0;
|
||||||
|
HTTP = 1;
|
||||||
|
TCP = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message TerminateSessionEvent {
|
||||||
|
string user = 1;
|
||||||
|
TunnelType tunnelType = 2;
|
||||||
|
string slug = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message TerminateSessionEventResponse {
|
||||||
|
bool success = 1;
|
||||||
|
string message = 2;
|
||||||
}
|
}
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package slug;
|
|
||||||
|
|
||||||
option go_package = "./gen";
|
|
||||||
|
|
||||||
service SlugChange {
|
|
||||||
rpc RequestChangeSlug(ChangeSlugRequest) returns (ChangeSlugResponse);
|
|
||||||
}
|
|
||||||
|
|
||||||
message ChangeSlugRequest {
|
|
||||||
string node = 1;
|
|
||||||
string old = 2;
|
|
||||||
string new = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ChangeSlugResponse {
|
|
||||||
bool success = 1;
|
|
||||||
string message = 2;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user