v1

package
v0.2.61 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EventType_name = map[int32]string{
		0: "TYPE_UNSPECIFIED",
		1: "TYPE_CIRCLE",
		2: "TYPE_USER",
		3: "TYPE_COMMENT",
		4: "TYPE_POST",
	}
	EventType_value = map[string]int32{
		"TYPE_UNSPECIFIED": 0,
		"TYPE_CIRCLE":      1,
		"TYPE_USER":        2,
		"TYPE_COMMENT":     3,
		"TYPE_POST":        4,
	}
)

Enum value maps for EventType.

View Source
var (
	NotifyResult_FailReason_name = map[int32]string{
		0: "None",
		1: "Unknown",
		2: "UserOffline",
	}
	NotifyResult_FailReason_value = map[string]int32{
		"None":        0,
		"Unknown":     1,
		"UserOffline": 2,
	}
)

Enum value maps for NotifyResult_FailReason.

View Source
var File_notification_api_notify_broker_v1_notify_broker_proto protoreflect.FileDescriptor
View Source
var NotifyAPI_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "notify_broker.v1.NotifyAPI",
	HandlerType: (*NotifyAPIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "NotifyUser",
			Handler:    _NotifyAPI_NotifyUser_Handler,
		},
		{
			MethodName: "NotifyUsersBatch",
			Handler:    _NotifyAPI_NotifyUsersBatch_Handler,
		},
		{
			MethodName: "NotifyGroups",
			Handler:    _NotifyAPI_NotifyGroups_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "notification-api/notify_broker/v1/notify_broker.proto",
}

NotifyAPI_ServiceDesc is the grpc.ServiceDesc for NotifyAPI service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterNotifyAPIServer

func RegisterNotifyAPIServer(s grpc.ServiceRegistrar, srv NotifyAPIServer)

Types

type Empty

type Empty struct {
	// contains filtered or unexported fields
}

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

func (x *Empty) ProtoReflect() protoreflect.Message

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type EventType

type EventType int32
const (
	EventType_TYPE_UNSPECIFIED EventType = 0
	EventType_TYPE_CIRCLE      EventType = 1
	EventType_TYPE_USER        EventType = 2
	EventType_TYPE_COMMENT     EventType = 3
	EventType_TYPE_POST        EventType = 4
)

func (EventType) Descriptor

func (EventType) Descriptor() protoreflect.EnumDescriptor

func (EventType) Enum

func (x EventType) Enum() *EventType

func (EventType) EnumDescriptor deprecated

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

Deprecated: Use EventType.Descriptor instead.

func (EventType) Number

func (x EventType) Number() protoreflect.EnumNumber

func (EventType) String

func (x EventType) String() string

func (EventType) Type

type NotificationEvent

type NotificationEvent struct {
	FromId        string    `protobuf:"bytes,1,opt,name=fromId,proto3" json:"fromId,omitempty"`
	FromType      EventType `protobuf:"varint,2,opt,name=fromType,proto3,enum=notify_broker.v1.EventType" json:"fromType,omitempty"`
	Title         string    `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
	Message       string    `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"`
	SourceId      string    `protobuf:"bytes,5,opt,name=sourceId,proto3" json:"sourceId,omitempty"`
	SourceType    EventType `protobuf:"varint,6,opt,name=sourceType,proto3,enum=notify_broker.v1.EventType" json:"sourceType,omitempty"`
	SubSourceId   string    `protobuf:"bytes,7,opt,name=subSourceId,proto3" json:"subSourceId,omitempty"`
	SubSourceType EventType `protobuf:"varint,8,opt,name=subSourceType,proto3,enum=notify_broker.v1.EventType" json:"subSourceType,omitempty"`
	Action        string    `protobuf:"bytes,9,opt,name=action,proto3" json:"action,omitempty"`
	ImageUrl      string    `protobuf:"bytes,10,opt,name=image_url,json=imageUrl,proto3" json:"image_url,omitempty"`
	// contains filtered or unexported fields
}

func (*NotificationEvent) Descriptor deprecated

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

Deprecated: Use NotificationEvent.ProtoReflect.Descriptor instead.

func (*NotificationEvent) GetAction

func (x *NotificationEvent) GetAction() string

func (*NotificationEvent) GetFromId

func (x *NotificationEvent) GetFromId() string

func (*NotificationEvent) GetFromType

func (x *NotificationEvent) GetFromType() EventType

func (*NotificationEvent) GetImageUrl

func (x *NotificationEvent) GetImageUrl() string

func (*NotificationEvent) GetMessage

func (x *NotificationEvent) GetMessage() string

func (*NotificationEvent) GetSourceId

func (x *NotificationEvent) GetSourceId() string

func (*NotificationEvent) GetSourceType

func (x *NotificationEvent) GetSourceType() EventType

func (*NotificationEvent) GetSubSourceId

func (x *NotificationEvent) GetSubSourceId() string

func (*NotificationEvent) GetSubSourceType

func (x *NotificationEvent) GetSubSourceType() EventType

func (*NotificationEvent) GetTitle

func (x *NotificationEvent) GetTitle() string

func (*NotificationEvent) ProtoMessage

func (*NotificationEvent) ProtoMessage()

func (*NotificationEvent) ProtoReflect

func (x *NotificationEvent) ProtoReflect() protoreflect.Message

func (*NotificationEvent) Reset

func (x *NotificationEvent) Reset()

func (*NotificationEvent) String

func (x *NotificationEvent) String() string

type NotifyAPIClient

type NotifyAPIClient interface {
	NotifyUser(ctx context.Context, in *NotifyUserRequest, opts ...grpc.CallOption) (*NotifyUserResponse, error)
	NotifyUsersBatch(ctx context.Context, in *NotifyUsersBatchRequest, opts ...grpc.CallOption) (*NotifyUsersBatchResponse, error)
	NotifyGroups(ctx context.Context, in *NotifyGroupsRequest, opts ...grpc.CallOption) (*Empty, error)
}

NotifyAPIClient is the client API for NotifyAPI 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.

func NewNotifyAPIClient

func NewNotifyAPIClient(cc grpc.ClientConnInterface) NotifyAPIClient

type NotifyAPIServer

type NotifyAPIServer interface {
	NotifyUser(context.Context, *NotifyUserRequest) (*NotifyUserResponse, error)
	NotifyUsersBatch(context.Context, *NotifyUsersBatchRequest) (*NotifyUsersBatchResponse, error)
	NotifyGroups(context.Context, *NotifyGroupsRequest) (*Empty, error)
	// contains filtered or unexported methods
}

NotifyAPIServer is the server API for NotifyAPI service. All implementations must embed UnimplementedNotifyAPIServer for forward compatibility

type NotifyGroupsRequest

type NotifyGroupsRequest struct {
	Ids   []string           `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"`
	Event *NotificationEvent `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"`
	// contains filtered or unexported fields
}

func (*NotifyGroupsRequest) Descriptor deprecated

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

Deprecated: Use NotifyGroupsRequest.ProtoReflect.Descriptor instead.

func (*NotifyGroupsRequest) GetEvent

func (x *NotifyGroupsRequest) GetEvent() *NotificationEvent

func (*NotifyGroupsRequest) GetIds

func (x *NotifyGroupsRequest) GetIds() []string

func (*NotifyGroupsRequest) ProtoMessage

func (*NotifyGroupsRequest) ProtoMessage()

func (*NotifyGroupsRequest) ProtoReflect

func (x *NotifyGroupsRequest) ProtoReflect() protoreflect.Message

func (*NotifyGroupsRequest) Reset

func (x *NotifyGroupsRequest) Reset()

func (*NotifyGroupsRequest) String

func (x *NotifyGroupsRequest) String() string

type NotifyResult

type NotifyResult struct {
	Success    bool                    `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	FailReason NotifyResult_FailReason `protobuf:"varint,2,opt,name=failReason,proto3,enum=notify_broker.v1.NotifyResult_FailReason" json:"failReason,omitempty"`
	// contains filtered or unexported fields
}

func (*NotifyResult) Descriptor deprecated

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

Deprecated: Use NotifyResult.ProtoReflect.Descriptor instead.

func (*NotifyResult) GetFailReason

func (x *NotifyResult) GetFailReason() NotifyResult_FailReason

func (*NotifyResult) GetSuccess

func (x *NotifyResult) GetSuccess() bool

func (*NotifyResult) ProtoMessage

func (*NotifyResult) ProtoMessage()

func (*NotifyResult) ProtoReflect

func (x *NotifyResult) ProtoReflect() protoreflect.Message

func (*NotifyResult) Reset

func (x *NotifyResult) Reset()

func (*NotifyResult) String

func (x *NotifyResult) String() string

type NotifyResult_FailReason

type NotifyResult_FailReason int32
const (
	NotifyResult_None        NotifyResult_FailReason = 0
	NotifyResult_Unknown     NotifyResult_FailReason = 1
	NotifyResult_UserOffline NotifyResult_FailReason = 2
)

func (NotifyResult_FailReason) Descriptor

func (NotifyResult_FailReason) Enum

func (NotifyResult_FailReason) EnumDescriptor deprecated

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

Deprecated: Use NotifyResult_FailReason.Descriptor instead.

func (NotifyResult_FailReason) Number

func (NotifyResult_FailReason) String

func (x NotifyResult_FailReason) String() string

func (NotifyResult_FailReason) Type

type NotifyUserRequest

type NotifyUserRequest struct {
	UserId string             `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"`
	Event  *NotificationEvent `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"`
	// contains filtered or unexported fields
}

func (*NotifyUserRequest) Descriptor deprecated

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

Deprecated: Use NotifyUserRequest.ProtoReflect.Descriptor instead.

func (*NotifyUserRequest) GetEvent

func (x *NotifyUserRequest) GetEvent() *NotificationEvent

func (*NotifyUserRequest) GetUserId

func (x *NotifyUserRequest) GetUserId() string

func (*NotifyUserRequest) ProtoMessage

func (*NotifyUserRequest) ProtoMessage()

func (*NotifyUserRequest) ProtoReflect

func (x *NotifyUserRequest) ProtoReflect() protoreflect.Message

func (*NotifyUserRequest) Reset

func (x *NotifyUserRequest) Reset()

func (*NotifyUserRequest) String

func (x *NotifyUserRequest) String() string

type NotifyUserResponse

type NotifyUserResponse struct {
	Result *NotifyResult `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*NotifyUserResponse) Descriptor deprecated

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

Deprecated: Use NotifyUserResponse.ProtoReflect.Descriptor instead.

func (*NotifyUserResponse) GetResult

func (x *NotifyUserResponse) GetResult() *NotifyResult

func (*NotifyUserResponse) ProtoMessage

func (*NotifyUserResponse) ProtoMessage()

func (*NotifyUserResponse) ProtoReflect

func (x *NotifyUserResponse) ProtoReflect() protoreflect.Message

func (*NotifyUserResponse) Reset

func (x *NotifyUserResponse) Reset()

func (*NotifyUserResponse) String

func (x *NotifyUserResponse) String() string

type NotifyUsersBatchRequest

type NotifyUsersBatchRequest struct {
	UserIds []string           `protobuf:"bytes,1,rep,name=userIds,proto3" json:"userIds,omitempty"`
	Event   *NotificationEvent `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"`
	// contains filtered or unexported fields
}

func (*NotifyUsersBatchRequest) Descriptor deprecated

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

Deprecated: Use NotifyUsersBatchRequest.ProtoReflect.Descriptor instead.

func (*NotifyUsersBatchRequest) GetEvent

func (*NotifyUsersBatchRequest) GetUserIds

func (x *NotifyUsersBatchRequest) GetUserIds() []string

func (*NotifyUsersBatchRequest) ProtoMessage

func (*NotifyUsersBatchRequest) ProtoMessage()

func (*NotifyUsersBatchRequest) ProtoReflect

func (x *NotifyUsersBatchRequest) ProtoReflect() protoreflect.Message

func (*NotifyUsersBatchRequest) Reset

func (x *NotifyUsersBatchRequest) Reset()

func (*NotifyUsersBatchRequest) String

func (x *NotifyUsersBatchRequest) String() string

type NotifyUsersBatchResponse

type NotifyUsersBatchResponse struct {
	Results map[string]*NotifyResult `` /* 155-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*NotifyUsersBatchResponse) Descriptor deprecated

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

Deprecated: Use NotifyUsersBatchResponse.ProtoReflect.Descriptor instead.

func (*NotifyUsersBatchResponse) GetResults

func (x *NotifyUsersBatchResponse) GetResults() map[string]*NotifyResult

func (*NotifyUsersBatchResponse) ProtoMessage

func (*NotifyUsersBatchResponse) ProtoMessage()

func (*NotifyUsersBatchResponse) ProtoReflect

func (x *NotifyUsersBatchResponse) ProtoReflect() protoreflect.Message

func (*NotifyUsersBatchResponse) Reset

func (x *NotifyUsersBatchResponse) Reset()

func (*NotifyUsersBatchResponse) String

func (x *NotifyUsersBatchResponse) String() string

type UnimplementedNotifyAPIServer

type UnimplementedNotifyAPIServer struct {
}

UnimplementedNotifyAPIServer must be embedded to have forward compatible implementations.

func (UnimplementedNotifyAPIServer) NotifyGroups

func (UnimplementedNotifyAPIServer) NotifyUser

func (UnimplementedNotifyAPIServer) NotifyUsersBatch

type UnsafeNotifyAPIServer

type UnsafeNotifyAPIServer interface {
	// contains filtered or unexported methods
}

UnsafeNotifyAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NotifyAPIServer will result in compilation errors.

Jump to

Keyboard shortcuts

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