feat: add user proto
This commit is contained in:
128
gen/events.pb.go
128
gen/events.pb.go
@@ -27,6 +27,7 @@ const (
|
||||
EventType_AUTHENTICATION EventType = 0
|
||||
EventType_SLUG_CHANGE EventType = 1
|
||||
EventType_SLUG_CHANGE_RESPONSE EventType = 2
|
||||
EventType_GET_SESSIONS EventType = 3
|
||||
)
|
||||
|
||||
// Enum value maps for EventType.
|
||||
@@ -35,11 +36,13 @@ var (
|
||||
0: "AUTHENTICATION",
|
||||
1: "SLUG_CHANGE",
|
||||
2: "SLUG_CHANGE_RESPONSE",
|
||||
3: "GET_SESSIONS",
|
||||
}
|
||||
EventType_value = map[string]int32{
|
||||
"AUTHENTICATION": 0,
|
||||
"SLUG_CHANGE": 1,
|
||||
"SLUG_CHANGE_RESPONSE": 2,
|
||||
"GET_SESSIONS": 3,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -76,6 +79,7 @@ type Controller struct {
|
||||
// Types that are valid to be assigned to Payload:
|
||||
//
|
||||
// *Controller_SlugEvent
|
||||
// *Controller_GetSessionsEvent
|
||||
Payload isController_Payload `protobuf_oneof:"payload"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
@@ -134,6 +138,15 @@ func (x *Controller) GetSlugEvent() *SlugChangeEvent {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Controller) GetGetSessionsEvent() *GetSessionsEvent {
|
||||
if x != nil {
|
||||
if x, ok := x.Payload.(*Controller_GetSessionsEvent); ok {
|
||||
return x.GetSessionsEvent
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isController_Payload interface {
|
||||
isController_Payload()
|
||||
}
|
||||
@@ -142,8 +155,14 @@ type Controller_SlugEvent struct {
|
||||
SlugEvent *SlugChangeEvent `protobuf:"bytes,11,opt,name=slug_event,json=slugEvent,proto3,oneof"`
|
||||
}
|
||||
|
||||
type Controller_GetSessionsEvent struct {
|
||||
GetSessionsEvent *GetSessionsEvent `protobuf:"bytes,12,opt,name=get_sessions_event,json=getSessionsEvent,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*Controller_SlugEvent) isController_Payload() {}
|
||||
|
||||
func (*Controller_GetSessionsEvent) isController_Payload() {}
|
||||
|
||||
type Client struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Type EventType `protobuf:"varint,1,opt,name=type,proto3,enum=slug.EventType" json:"type,omitempty"`
|
||||
@@ -151,6 +170,7 @@ type Client struct {
|
||||
//
|
||||
// *Client_AuthEvent
|
||||
// *Client_SlugEventResponse
|
||||
// *Client_GetSessionsEvent
|
||||
Payload isClient_Payload `protobuf_oneof:"payload"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
@@ -218,6 +238,15 @@ func (x *Client) GetSlugEventResponse() *SlugChangeEventResponse {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Client) GetGetSessionsEvent() *GetSessionsResponse {
|
||||
if x != nil {
|
||||
if x, ok := x.Payload.(*Client_GetSessionsEvent); ok {
|
||||
return x.GetSessionsEvent
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isClient_Payload interface {
|
||||
isClient_Payload()
|
||||
}
|
||||
@@ -230,10 +259,16 @@ type Client_SlugEventResponse struct {
|
||||
SlugEventResponse *SlugChangeEventResponse `protobuf:"bytes,11,opt,name=slug_event_response,json=slugEventResponse,proto3,oneof"`
|
||||
}
|
||||
|
||||
type Client_GetSessionsEvent struct {
|
||||
GetSessionsEvent *GetSessionsResponse `protobuf:"bytes,12,opt,name=get_sessions_event,json=getSessionsEvent,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*Client_AuthEvent) isClient_Payload() {}
|
||||
|
||||
func (*Client_SlugEventResponse) isClient_Payload() {}
|
||||
|
||||
func (*Client_GetSessionsEvent) isClient_Payload() {}
|
||||
|
||||
type Authentication struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
AuthToken string `protobuf:"bytes,1,opt,name=auth_token,json=authToken,proto3" json:"auth_token,omitempty"`
|
||||
@@ -390,23 +425,70 @@ func (x *SlugChangeEventResponse) GetMessage() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetSessionsEvent struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetSessionsEvent) Reset() {
|
||||
*x = GetSessionsEvent{}
|
||||
mi := &file_events_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetSessionsEvent) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetSessionsEvent) ProtoMessage() {}
|
||||
|
||||
func (x *GetSessionsEvent) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_events_proto_msgTypes[5]
|
||||
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 GetSessionsEvent.ProtoReflect.Descriptor instead.
|
||||
func (*GetSessionsEvent) Descriptor() ([]byte, []int) {
|
||||
return file_events_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *GetSessionsEvent) GetIdentity() string {
|
||||
if x != nil {
|
||||
return x.Identity
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_events_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_events_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\fevents.proto\x12\x04slug\"t\n" +
|
||||
"\fevents.proto\x12\x04slug\x1a\n" +
|
||||
"user.proto\"\xbc\x01\n" +
|
||||
"\n" +
|
||||
"Controller\x12#\n" +
|
||||
"\x04type\x18\x01 \x01(\x0e2\x0f.slug.EventTypeR\x04type\x126\n" +
|
||||
"\n" +
|
||||
"slug_event\x18\v \x01(\v2\x15.slug.SlugChangeEventH\x00R\tslugEventB\t\n" +
|
||||
"\apayload\"\xc0\x01\n" +
|
||||
"slug_event\x18\v \x01(\v2\x15.slug.SlugChangeEventH\x00R\tslugEvent\x12F\n" +
|
||||
"\x12get_sessions_event\x18\f \x01(\v2\x16.slug.GetSessionsEventH\x00R\x10getSessionsEventB\t\n" +
|
||||
"\apayload\"\x8b\x02\n" +
|
||||
"\x06Client\x12#\n" +
|
||||
"\x04type\x18\x01 \x01(\x0e2\x0f.slug.EventTypeR\x04type\x125\n" +
|
||||
"\n" +
|
||||
"auth_event\x18\n" +
|
||||
" \x01(\v2\x14.slug.AuthenticationH\x00R\tauthEvent\x12O\n" +
|
||||
"\x13slug_event_response\x18\v \x01(\v2\x1d.slug.SlugChangeEventResponseH\x00R\x11slugEventResponseB\t\n" +
|
||||
"\x13slug_event_response\x18\v \x01(\v2\x1d.slug.SlugChangeEventResponseH\x00R\x11slugEventResponse\x12I\n" +
|
||||
"\x12get_sessions_event\x18\f \x01(\v2\x19.slug.GetSessionsResponseH\x00R\x10getSessionsEventB\t\n" +
|
||||
"\apayload\"K\n" +
|
||||
"\x0eAuthentication\x12\x1d\n" +
|
||||
"\n" +
|
||||
@@ -417,11 +499,14 @@ const file_events_proto_rawDesc = "" +
|
||||
"\x03new\x18\x02 \x01(\tR\x03new\"M\n" +
|
||||
"\x17SlugChangeEventResponse\x12\x18\n" +
|
||||
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
|
||||
"\amessage\x18\x02 \x01(\tR\amessage*J\n" +
|
||||
"\amessage\x18\x02 \x01(\tR\amessage\".\n" +
|
||||
"\x10GetSessionsEvent\x12\x1a\n" +
|
||||
"\bidentity\x18\x01 \x01(\tR\bidentity*\\\n" +
|
||||
"\tEventType\x12\x12\n" +
|
||||
"\x0eAUTHENTICATION\x10\x00\x12\x0f\n" +
|
||||
"\vSLUG_CHANGE\x10\x01\x12\x18\n" +
|
||||
"\x14SLUG_CHANGE_RESPONSE\x10\x022?\n" +
|
||||
"\x14SLUG_CHANGE_RESPONSE\x10\x02\x12\x10\n" +
|
||||
"\fGET_SESSIONS\x10\x032?\n" +
|
||||
"\fEventService\x12/\n" +
|
||||
"\tSubscribe\x12\f.slug.Client\x1a\x10.slug.Controller(\x010\x01B\aZ\x05./genb\x06proto3"
|
||||
|
||||
@@ -438,7 +523,7 @@ func file_events_proto_rawDescGZIP() []byte {
|
||||
}
|
||||
|
||||
var file_events_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_events_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_events_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_events_proto_goTypes = []any{
|
||||
(EventType)(0), // 0: slug.EventType
|
||||
(*Controller)(nil), // 1: slug.Controller
|
||||
@@ -446,20 +531,24 @@ var file_events_proto_goTypes = []any{
|
||||
(*Authentication)(nil), // 3: slug.Authentication
|
||||
(*SlugChangeEvent)(nil), // 4: slug.SlugChangeEvent
|
||||
(*SlugChangeEventResponse)(nil), // 5: slug.SlugChangeEventResponse
|
||||
(*GetSessionsEvent)(nil), // 6: slug.GetSessionsEvent
|
||||
(*GetSessionsResponse)(nil), // 7: slug.GetSessionsResponse
|
||||
}
|
||||
var file_events_proto_depIdxs = []int32{
|
||||
0, // 0: slug.Controller.type:type_name -> slug.EventType
|
||||
4, // 1: slug.Controller.slug_event:type_name -> slug.SlugChangeEvent
|
||||
0, // 2: slug.Client.type:type_name -> slug.EventType
|
||||
3, // 3: slug.Client.auth_event:type_name -> slug.Authentication
|
||||
5, // 4: slug.Client.slug_event_response:type_name -> slug.SlugChangeEventResponse
|
||||
2, // 5: slug.EventService.Subscribe:input_type -> slug.Client
|
||||
1, // 6: slug.EventService.Subscribe:output_type -> slug.Controller
|
||||
6, // [6:7] is the sub-list for method output_type
|
||||
5, // [5:6] is the sub-list for method input_type
|
||||
5, // [5:5] is the sub-list for extension type_name
|
||||
5, // [5:5] is the sub-list for extension extendee
|
||||
0, // [0:5] is the sub-list for field type_name
|
||||
6, // 2: slug.Controller.get_sessions_event:type_name -> slug.GetSessionsEvent
|
||||
0, // 3: slug.Client.type:type_name -> slug.EventType
|
||||
3, // 4: slug.Client.auth_event:type_name -> slug.Authentication
|
||||
5, // 5: slug.Client.slug_event_response:type_name -> slug.SlugChangeEventResponse
|
||||
7, // 6: slug.Client.get_sessions_event:type_name -> slug.GetSessionsResponse
|
||||
2, // 7: slug.EventService.Subscribe:input_type -> slug.Client
|
||||
1, // 8: slug.EventService.Subscribe:output_type -> slug.Controller
|
||||
8, // [8:9] is the sub-list for method output_type
|
||||
7, // [7:8] is the sub-list for method input_type
|
||||
7, // [7:7] is the sub-list for extension type_name
|
||||
7, // [7:7] is the sub-list for extension extendee
|
||||
0, // [0:7] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_events_proto_init() }
|
||||
@@ -467,12 +556,15 @@ func file_events_proto_init() {
|
||||
if File_events_proto != nil {
|
||||
return
|
||||
}
|
||||
file_user_proto_init()
|
||||
file_events_proto_msgTypes[0].OneofWrappers = []any{
|
||||
(*Controller_SlugEvent)(nil),
|
||||
(*Controller_GetSessionsEvent)(nil),
|
||||
}
|
||||
file_events_proto_msgTypes[1].OneofWrappers = []any{
|
||||
(*Client_AuthEvent)(nil),
|
||||
(*Client_SlugEventResponse)(nil),
|
||||
(*Client_GetSessionsEvent)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
@@ -480,7 +572,7 @@ func file_events_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_events_proto_rawDesc), len(file_events_proto_rawDesc)),
|
||||
NumEnums: 1,
|
||||
NumMessages: 5,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
|
||||
415
gen/user.pb.go
Normal file
415
gen/user.pb.go
Normal file
@@ -0,0 +1,415 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v6.33.2
|
||||
// source: user.proto
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||||
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 AuthorizationResponse int32
|
||||
|
||||
const (
|
||||
AuthorizationResponse_MESSAGE_TYPE_AUTHORIZED AuthorizationResponse = 0
|
||||
AuthorizationResponse_MESSAGE_TYPE_UNAUTHORIZED AuthorizationResponse = 1
|
||||
)
|
||||
|
||||
// Enum value maps for AuthorizationResponse.
|
||||
var (
|
||||
AuthorizationResponse_name = map[int32]string{
|
||||
0: "MESSAGE_TYPE_AUTHORIZED",
|
||||
1: "MESSAGE_TYPE_UNAUTHORIZED",
|
||||
}
|
||||
AuthorizationResponse_value = map[string]int32{
|
||||
"MESSAGE_TYPE_AUTHORIZED": 0,
|
||||
"MESSAGE_TYPE_UNAUTHORIZED": 1,
|
||||
}
|
||||
)
|
||||
|
||||
func (x AuthorizationResponse) Enum() *AuthorizationResponse {
|
||||
p := new(AuthorizationResponse)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x AuthorizationResponse) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (AuthorizationResponse) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_user_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (AuthorizationResponse) Type() protoreflect.EnumType {
|
||||
return &file_user_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x AuthorizationResponse) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AuthorizationResponse.Descriptor instead.
|
||||
func (AuthorizationResponse) EnumDescriptor() ([]byte, []int) {
|
||||
return file_user_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type CheckRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
AuthToken string `protobuf:"bytes,1,opt,name=auth_token,json=authToken,proto3" json:"auth_token,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *CheckRequest) Reset() {
|
||||
*x = CheckRequest{}
|
||||
mi := &file_user_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *CheckRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CheckRequest) ProtoMessage() {}
|
||||
|
||||
func (x *CheckRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_user_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 CheckRequest.ProtoReflect.Descriptor instead.
|
||||
func (*CheckRequest) Descriptor() ([]byte, []int) {
|
||||
return file_user_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *CheckRequest) GetAuthToken() string {
|
||||
if x != nil {
|
||||
return x.AuthToken
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type CheckResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Response AuthorizationResponse `protobuf:"varint,1,opt,name=response,proto3,enum=slug.AuthorizationResponse" json:"response,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *CheckResponse) Reset() {
|
||||
*x = CheckResponse{}
|
||||
mi := &file_user_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *CheckResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CheckResponse) ProtoMessage() {}
|
||||
|
||||
func (x *CheckResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_user_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 CheckResponse.ProtoReflect.Descriptor instead.
|
||||
func (*CheckResponse) Descriptor() ([]byte, []int) {
|
||||
return file_user_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *CheckResponse) GetResponse() AuthorizationResponse {
|
||||
if x != nil {
|
||||
return x.Response
|
||||
}
|
||||
return AuthorizationResponse_MESSAGE_TYPE_AUTHORIZED
|
||||
}
|
||||
|
||||
type GetSessionRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetSessionRequest) Reset() {
|
||||
*x = GetSessionRequest{}
|
||||
mi := &file_user_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetSessionRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetSessionRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetSessionRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_user_proto_msgTypes[2]
|
||||
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 GetSessionRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetSessionRequest) Descriptor() ([]byte, []int) {
|
||||
return file_user_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *GetSessionRequest) GetIdentity() string {
|
||||
if x != nil {
|
||||
return x.Identity
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetSessionsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Details []*Detail `protobuf:"bytes,1,rep,name=details,proto3" json:"details,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetSessionsResponse) Reset() {
|
||||
*x = GetSessionsResponse{}
|
||||
mi := &file_user_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetSessionsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetSessionsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetSessionsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_user_proto_msgTypes[3]
|
||||
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 GetSessionsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetSessionsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_user_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *GetSessionsResponse) GetDetails() []*Detail {
|
||||
if x != nil {
|
||||
return x.Details
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Detail struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
ForwardingType string `protobuf:"bytes,1,opt,name=forwarding_type,json=forwardingType,proto3" json:"forwarding_type,omitempty"`
|
||||
Slug string `protobuf:"bytes,2,opt,name=slug,proto3" json:"slug,omitempty"`
|
||||
UserId string `protobuf:"bytes,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
Active bool `protobuf:"varint,4,opt,name=active,proto3" json:"active,omitempty"`
|
||||
StartedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Detail) Reset() {
|
||||
*x = Detail{}
|
||||
mi := &file_user_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Detail) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Detail) ProtoMessage() {}
|
||||
|
||||
func (x *Detail) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_user_proto_msgTypes[4]
|
||||
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 Detail.ProtoReflect.Descriptor instead.
|
||||
func (*Detail) Descriptor() ([]byte, []int) {
|
||||
return file_user_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *Detail) GetForwardingType() string {
|
||||
if x != nil {
|
||||
return x.ForwardingType
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Detail) GetSlug() string {
|
||||
if x != nil {
|
||||
return x.Slug
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Detail) GetUserId() string {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Detail) GetActive() bool {
|
||||
if x != nil {
|
||||
return x.Active
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *Detail) GetStartedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.StartedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_user_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_user_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
"user.proto\x12\x04slug\x1a\x1fgoogle/protobuf/timestamp.proto\"-\n" +
|
||||
"\fCheckRequest\x12\x1d\n" +
|
||||
"\n" +
|
||||
"auth_token\x18\x01 \x01(\tR\tauthToken\"H\n" +
|
||||
"\rCheckResponse\x127\n" +
|
||||
"\bresponse\x18\x01 \x01(\x0e2\x1b.slug.AuthorizationResponseR\bresponse\"/\n" +
|
||||
"\x11GetSessionRequest\x12\x1a\n" +
|
||||
"\bidentity\x18\x01 \x01(\tR\bidentity\"=\n" +
|
||||
"\x13GetSessionsResponse\x12&\n" +
|
||||
"\adetails\x18\x01 \x03(\v2\f.slug.DetailR\adetails\"\xb1\x01\n" +
|
||||
"\x06Detail\x12'\n" +
|
||||
"\x0fforwarding_type\x18\x01 \x01(\tR\x0eforwardingType\x12\x12\n" +
|
||||
"\x04slug\x18\x02 \x01(\tR\x04slug\x12\x17\n" +
|
||||
"\auser_id\x18\x03 \x01(\tR\x06userId\x12\x16\n" +
|
||||
"\x06active\x18\x04 \x01(\bR\x06active\x129\n" +
|
||||
"\n" +
|
||||
"started_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\tstartedAt*S\n" +
|
||||
"\x15AuthorizationResponse\x12\x1b\n" +
|
||||
"\x17MESSAGE_TYPE_AUTHORIZED\x10\x00\x12\x1d\n" +
|
||||
"\x19MESSAGE_TYPE_UNAUTHORIZED\x10\x012?\n" +
|
||||
"\vUserService\x120\n" +
|
||||
"\x05Check\x12\x12.slug.CheckRequest\x1a\x13.slug.CheckResponse2P\n" +
|
||||
"\fUserSessions\x12@\n" +
|
||||
"\n" +
|
||||
"GetSession\x12\x17.slug.GetSessionRequest\x1a\x19.slug.GetSessionsResponseB\aZ\x05./genb\x06proto3"
|
||||
|
||||
var (
|
||||
file_user_proto_rawDescOnce sync.Once
|
||||
file_user_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_user_proto_rawDescGZIP() []byte {
|
||||
file_user_proto_rawDescOnce.Do(func() {
|
||||
file_user_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_user_proto_rawDesc), len(file_user_proto_rawDesc)))
|
||||
})
|
||||
return file_user_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_user_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_user_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_user_proto_goTypes = []any{
|
||||
(AuthorizationResponse)(0), // 0: slug.AuthorizationResponse
|
||||
(*CheckRequest)(nil), // 1: slug.CheckRequest
|
||||
(*CheckResponse)(nil), // 2: slug.CheckResponse
|
||||
(*GetSessionRequest)(nil), // 3: slug.GetSessionRequest
|
||||
(*GetSessionsResponse)(nil), // 4: slug.GetSessionsResponse
|
||||
(*Detail)(nil), // 5: slug.Detail
|
||||
(*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp
|
||||
}
|
||||
var file_user_proto_depIdxs = []int32{
|
||||
0, // 0: slug.CheckResponse.response:type_name -> slug.AuthorizationResponse
|
||||
5, // 1: slug.GetSessionsResponse.details:type_name -> slug.Detail
|
||||
6, // 2: slug.Detail.started_at:type_name -> google.protobuf.Timestamp
|
||||
1, // 3: slug.UserService.Check:input_type -> slug.CheckRequest
|
||||
3, // 4: slug.UserSessions.GetSession:input_type -> slug.GetSessionRequest
|
||||
2, // 5: slug.UserService.Check:output_type -> slug.CheckResponse
|
||||
4, // 6: slug.UserSessions.GetSession:output_type -> slug.GetSessionsResponse
|
||||
5, // [5:7] is the sub-list for method output_type
|
||||
3, // [3:5] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_user_proto_init() }
|
||||
func file_user_proto_init() {
|
||||
if File_user_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_user_proto_rawDesc), len(file_user_proto_rawDesc)),
|
||||
NumEnums: 1,
|
||||
NumMessages: 5,
|
||||
NumExtensions: 0,
|
||||
NumServices: 2,
|
||||
},
|
||||
GoTypes: file_user_proto_goTypes,
|
||||
DependencyIndexes: file_user_proto_depIdxs,
|
||||
EnumInfos: file_user_proto_enumTypes,
|
||||
MessageInfos: file_user_proto_msgTypes,
|
||||
}.Build()
|
||||
File_user_proto = out.File
|
||||
file_user_proto_goTypes = nil
|
||||
file_user_proto_depIdxs = nil
|
||||
}
|
||||
223
gen/user_grpc.pb.go
Normal file
223
gen/user_grpc.pb.go
Normal file
@@ -0,0 +1,223 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.0
|
||||
// - protoc v6.33.2
|
||||
// source: user.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 (
|
||||
UserService_Check_FullMethodName = "/slug.UserService/Check"
|
||||
)
|
||||
|
||||
// UserServiceClient is the client API for UserService 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 UserServiceClient interface {
|
||||
Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error)
|
||||
}
|
||||
|
||||
type userServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient {
|
||||
return &userServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *userServiceClient) Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CheckResponse)
|
||||
err := c.cc.Invoke(ctx, UserService_Check_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// UserServiceServer is the server API for UserService service.
|
||||
// All implementations must embed UnimplementedUserServiceServer
|
||||
// for forward compatibility.
|
||||
type UserServiceServer interface {
|
||||
Check(context.Context, *CheckRequest) (*CheckResponse, error)
|
||||
mustEmbedUnimplementedUserServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedUserServiceServer 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 UnimplementedUserServiceServer struct{}
|
||||
|
||||
func (UnimplementedUserServiceServer) Check(context.Context, *CheckRequest) (*CheckResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Check not implemented")
|
||||
}
|
||||
func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {}
|
||||
func (UnimplementedUserServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to UserServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeUserServiceServer interface {
|
||||
mustEmbedUnimplementedUserServiceServer()
|
||||
}
|
||||
|
||||
func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedUserServiceServer 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(&UserService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _UserService_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CheckRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UserServiceServer).Check(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: UserService_Check_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UserServiceServer).Check(ctx, req.(*CheckRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var UserService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "slug.UserService",
|
||||
HandlerType: (*UserServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Check",
|
||||
Handler: _UserService_Check_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "user.proto",
|
||||
}
|
||||
|
||||
const (
|
||||
UserSessions_GetSession_FullMethodName = "/slug.UserSessions/GetSession"
|
||||
)
|
||||
|
||||
// UserSessionsClient is the client API for UserSessions 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 UserSessionsClient interface {
|
||||
GetSession(ctx context.Context, in *GetSessionRequest, opts ...grpc.CallOption) (*GetSessionsResponse, error)
|
||||
}
|
||||
|
||||
type userSessionsClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewUserSessionsClient(cc grpc.ClientConnInterface) UserSessionsClient {
|
||||
return &userSessionsClient{cc}
|
||||
}
|
||||
|
||||
func (c *userSessionsClient) GetSession(ctx context.Context, in *GetSessionRequest, opts ...grpc.CallOption) (*GetSessionsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetSessionsResponse)
|
||||
err := c.cc.Invoke(ctx, UserSessions_GetSession_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// UserSessionsServer is the server API for UserSessions service.
|
||||
// All implementations must embed UnimplementedUserSessionsServer
|
||||
// for forward compatibility.
|
||||
type UserSessionsServer interface {
|
||||
GetSession(context.Context, *GetSessionRequest) (*GetSessionsResponse, error)
|
||||
mustEmbedUnimplementedUserSessionsServer()
|
||||
}
|
||||
|
||||
// UnimplementedUserSessionsServer 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 UnimplementedUserSessionsServer struct{}
|
||||
|
||||
func (UnimplementedUserSessionsServer) GetSession(context.Context, *GetSessionRequest) (*GetSessionsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetSession not implemented")
|
||||
}
|
||||
func (UnimplementedUserSessionsServer) mustEmbedUnimplementedUserSessionsServer() {}
|
||||
func (UnimplementedUserSessionsServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeUserSessionsServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to UserSessionsServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeUserSessionsServer interface {
|
||||
mustEmbedUnimplementedUserSessionsServer()
|
||||
}
|
||||
|
||||
func RegisterUserSessionsServer(s grpc.ServiceRegistrar, srv UserSessionsServer) {
|
||||
// If the following call panics, it indicates UnimplementedUserSessionsServer 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(&UserSessions_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _UserSessions_GetSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetSessionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UserSessionsServer).GetSession(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: UserSessions_GetSession_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UserSessionsServer).GetSession(ctx, req.(*GetSessionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// UserSessions_ServiceDesc is the grpc.ServiceDesc for UserSessions service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var UserSessions_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "slug.UserSessions",
|
||||
HandlerType: (*UserSessionsServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetSession",
|
||||
Handler: _UserSessions_GetSession_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "user.proto",
|
||||
}
|
||||
@@ -3,7 +3,7 @@ syntax = "proto3";
|
||||
package slug;
|
||||
|
||||
option go_package = "./gen";
|
||||
|
||||
import "user.proto";
|
||||
service EventService {
|
||||
rpc Subscribe(stream Client) returns (stream Controller);
|
||||
}
|
||||
@@ -12,6 +12,7 @@ enum EventType {
|
||||
AUTHENTICATION = 0;
|
||||
SLUG_CHANGE = 1;
|
||||
SLUG_CHANGE_RESPONSE = 2;
|
||||
GET_SESSIONS = 3;
|
||||
}
|
||||
|
||||
message Controller {
|
||||
@@ -19,6 +20,7 @@ message Controller {
|
||||
|
||||
oneof payload {
|
||||
SlugChangeEvent slug_event = 11;
|
||||
GetSessionsEvent get_sessions_event = 12;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +30,7 @@ message Client {
|
||||
oneof payload {
|
||||
Authentication auth_event = 10;
|
||||
SlugChangeEventResponse slug_event_response = 11;
|
||||
GetSessionsResponse get_sessions_event = 12;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,3 +48,7 @@ message SlugChangeEventResponse {
|
||||
bool success = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
message GetSessionsEvent {
|
||||
string identity = 1;
|
||||
}
|
||||
44
proto/user.proto
Normal file
44
proto/user.proto
Normal file
@@ -0,0 +1,44 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package slug;
|
||||
|
||||
option go_package = "./gen";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
service UserService {
|
||||
rpc Check(CheckRequest) returns (CheckResponse);
|
||||
}
|
||||
|
||||
service UserSessions {
|
||||
rpc GetSession(GetSessionRequest) returns (GetSessionsResponse);
|
||||
}
|
||||
|
||||
enum AuthorizationResponse {
|
||||
MESSAGE_TYPE_AUTHORIZED= 0;
|
||||
MESSAGE_TYPE_UNAUTHORIZED = 1;
|
||||
}
|
||||
|
||||
message CheckRequest {
|
||||
string auth_token = 1;
|
||||
}
|
||||
|
||||
message CheckResponse {
|
||||
AuthorizationResponse response = 1;
|
||||
}
|
||||
|
||||
message GetSessionRequest {
|
||||
string identity = 1;
|
||||
}
|
||||
|
||||
message GetSessionsResponse {
|
||||
repeated Detail details = 1;
|
||||
}
|
||||
|
||||
message Detail {
|
||||
string forwarding_type = 1;
|
||||
string slug = 2;
|
||||
string user_id = 3;
|
||||
bool active = 4;
|
||||
google.protobuf.Timestamp started_at = 5;
|
||||
}
|
||||
Reference in New Issue
Block a user