v1

package
v0.0.0-...-10b0fe8 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	NotiService_GetNotifications_FullMethodName         = "/noti.v1.NotiService/GetNotifications"
	NotiService_CountNotificationsUnread_FullMethodName = "/noti.v1.NotiService/CountNotificationsUnread"
	NotiService_ReadNotification_FullMethodName         = "/noti.v1.NotiService/ReadNotification"
)

Variables

View Source
var File_noti_v1_noti_proto protoreflect.FileDescriptor
View Source
var NotiService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "noti.v1.NotiService",
	HandlerType: (*NotiServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetNotifications",
			Handler:    _NotiService_GetNotifications_Handler,
		},
		{
			MethodName: "CountNotificationsUnread",
			Handler:    _NotiService_CountNotificationsUnread_Handler,
		},
		{
			MethodName: "ReadNotification",
			Handler:    _NotiService_ReadNotification_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "noti/v1/noti.proto",
}

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

Functions

func RegisterNotiServiceHandler

func RegisterNotiServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterNotiServiceHandler registers the http handlers for service NotiService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterNotiServiceHandlerClient

func RegisterNotiServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NotiServiceClient) error

RegisterNotiServiceHandlerClient registers the http handlers for service NotiService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NotiServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NotiServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "NotiServiceClient" to call the correct interceptors.

func RegisterNotiServiceHandlerFromEndpoint

func RegisterNotiServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterNotiServiceHandlerFromEndpoint is same as RegisterNotiServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterNotiServiceHandlerServer

func RegisterNotiServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NotiServiceServer) error

RegisterNotiServiceHandlerServer registers the http handlers for service NotiService to "mux". UnaryRPC :call NotiServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterNotiServiceHandlerFromEndpoint instead.

func RegisterNotiServiceServer

func RegisterNotiServiceServer(s grpc.ServiceRegistrar, srv NotiServiceServer)

Types

type CountNotificationsUnreadRequest

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

func (*CountNotificationsUnreadRequest) Descriptor deprecated

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

Deprecated: Use CountNotificationsUnreadRequest.ProtoReflect.Descriptor instead.

func (*CountNotificationsUnreadRequest) ProtoMessage

func (*CountNotificationsUnreadRequest) ProtoMessage()

func (*CountNotificationsUnreadRequest) ProtoReflect

func (*CountNotificationsUnreadRequest) Reset

func (*CountNotificationsUnreadRequest) String

type CountNotificationsUnreadResponse

type CountNotificationsUnreadResponse struct {
	Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
	// contains filtered or unexported fields
}

func (*CountNotificationsUnreadResponse) Descriptor deprecated

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

Deprecated: Use CountNotificationsUnreadResponse.ProtoReflect.Descriptor instead.

func (*CountNotificationsUnreadResponse) GetCount

func (*CountNotificationsUnreadResponse) ProtoMessage

func (*CountNotificationsUnreadResponse) ProtoMessage()

func (*CountNotificationsUnreadResponse) ProtoReflect

func (*CountNotificationsUnreadResponse) Reset

func (*CountNotificationsUnreadResponse) String

type GetNotificationsRequest

type GetNotificationsRequest struct {
	Limit   int32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
	Offset  int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
	Options bool  `protobuf:"varint,3,opt,name=options,proto3" json:"options,omitempty"`
	// contains filtered or unexported fields
}

func (*GetNotificationsRequest) Descriptor deprecated

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

Deprecated: Use GetNotificationsRequest.ProtoReflect.Descriptor instead.

func (*GetNotificationsRequest) GetLimit

func (x *GetNotificationsRequest) GetLimit() int32

func (*GetNotificationsRequest) GetOffset

func (x *GetNotificationsRequest) GetOffset() int32

func (*GetNotificationsRequest) GetOptions

func (x *GetNotificationsRequest) GetOptions() bool

func (*GetNotificationsRequest) ProtoMessage

func (*GetNotificationsRequest) ProtoMessage()

func (*GetNotificationsRequest) ProtoReflect

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

func (*GetNotificationsRequest) Reset

func (x *GetNotificationsRequest) Reset()

func (*GetNotificationsRequest) String

func (x *GetNotificationsRequest) String() string

type GetNotificationsResponse

type GetNotificationsResponse struct {
	Notifications []*Notification `protobuf:"bytes,1,rep,name=notifications,proto3" json:"notifications,omitempty"`
	// contains filtered or unexported fields
}

func (*GetNotificationsResponse) Descriptor deprecated

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

Deprecated: Use GetNotificationsResponse.ProtoReflect.Descriptor instead.

func (*GetNotificationsResponse) GetNotifications

func (x *GetNotificationsResponse) GetNotifications() []*Notification

func (*GetNotificationsResponse) ProtoMessage

func (*GetNotificationsResponse) ProtoMessage()

func (*GetNotificationsResponse) ProtoReflect

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

func (*GetNotificationsResponse) Reset

func (x *GetNotificationsResponse) Reset()

func (*GetNotificationsResponse) String

func (x *GetNotificationsResponse) String() string

type NotiServiceClient

type NotiServiceClient interface {
	GetNotifications(ctx context.Context, in *GetNotificationsRequest, opts ...grpc.CallOption) (*GetNotificationsResponse, error)
	CountNotificationsUnread(ctx context.Context, in *CountNotificationsUnreadRequest, opts ...grpc.CallOption) (*CountNotificationsUnreadResponse, error)
	ReadNotification(ctx context.Context, in *ReadNotificationRequest, opts ...grpc.CallOption) (*ReadNotificationResponse, error)
}

NotiServiceClient is the client API for NotiService 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 NotiServiceServer

type NotiServiceServer interface {
	GetNotifications(context.Context, *GetNotificationsRequest) (*GetNotificationsResponse, error)
	CountNotificationsUnread(context.Context, *CountNotificationsUnreadRequest) (*CountNotificationsUnreadResponse, error)
	ReadNotification(context.Context, *ReadNotificationRequest) (*ReadNotificationResponse, error)
	// contains filtered or unexported methods
}

NotiServiceServer is the server API for NotiService service. All implementations must embed UnimplementedNotiServiceServer for forward compatibility

type Notification

type Notification struct {
	Id         int64                  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	ActorId    string                 `protobuf:"bytes,2,opt,name=actor_id,json=actorId,proto3" json:"actor_id,omitempty"`
	SenderId   string                 `protobuf:"bytes,3,opt,name=sender_id,json=senderId,proto3" json:"sender_id,omitempty"`
	Actor      *v1.User               `protobuf:"bytes,4,opt,name=actor,proto3" json:"actor,omitempty"`
	Data       *structpb.Struct       `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
	ObjectType string                 `protobuf:"bytes,6,opt,name=object_type,json=objectType,proto3" json:"object_type,omitempty"`
	ObjectId   string                 `protobuf:"bytes,7,opt,name=object_id,json=objectId,proto3" json:"object_id,omitempty"`
	ReadAt     *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=read_at,json=readAt,proto3" json:"read_at,omitempty"`
	CreatedAt  *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	UpdatedAt  *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

func (*Notification) Descriptor deprecated

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

Deprecated: Use Notification.ProtoReflect.Descriptor instead.

func (*Notification) GetActor

func (x *Notification) GetActor() *v1.User

func (*Notification) GetActorId

func (x *Notification) GetActorId() string

func (*Notification) GetCreatedAt

func (x *Notification) GetCreatedAt() *timestamppb.Timestamp

func (*Notification) GetData

func (x *Notification) GetData() *structpb.Struct

func (*Notification) GetId

func (x *Notification) GetId() int64

func (*Notification) GetObjectId

func (x *Notification) GetObjectId() string

func (*Notification) GetObjectType

func (x *Notification) GetObjectType() string

func (*Notification) GetReadAt

func (x *Notification) GetReadAt() *timestamppb.Timestamp

func (*Notification) GetSenderId

func (x *Notification) GetSenderId() string

func (*Notification) GetUpdatedAt

func (x *Notification) GetUpdatedAt() *timestamppb.Timestamp

func (*Notification) ProtoMessage

func (*Notification) ProtoMessage()

func (*Notification) ProtoReflect

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

func (*Notification) Reset

func (x *Notification) Reset()

func (*Notification) String

func (x *Notification) String() string

type ReadNotificationRequest

type ReadNotificationRequest struct {
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*ReadNotificationRequest) Descriptor deprecated

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

Deprecated: Use ReadNotificationRequest.ProtoReflect.Descriptor instead.

func (*ReadNotificationRequest) GetId

func (x *ReadNotificationRequest) GetId() int64

func (*ReadNotificationRequest) ProtoMessage

func (*ReadNotificationRequest) ProtoMessage()

func (*ReadNotificationRequest) ProtoReflect

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

func (*ReadNotificationRequest) Reset

func (x *ReadNotificationRequest) Reset()

func (*ReadNotificationRequest) String

func (x *ReadNotificationRequest) String() string

type ReadNotificationResponse

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

func (*ReadNotificationResponse) Descriptor deprecated

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

Deprecated: Use ReadNotificationResponse.ProtoReflect.Descriptor instead.

func (*ReadNotificationResponse) ProtoMessage

func (*ReadNotificationResponse) ProtoMessage()

func (*ReadNotificationResponse) ProtoReflect

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

func (*ReadNotificationResponse) Reset

func (x *ReadNotificationResponse) Reset()

func (*ReadNotificationResponse) String

func (x *ReadNotificationResponse) String() string

type UnimplementedNotiServiceServer

type UnimplementedNotiServiceServer struct {
}

UnimplementedNotiServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedNotiServiceServer) GetNotifications

func (UnimplementedNotiServiceServer) ReadNotification

type UnsafeNotiServiceServer

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

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

Jump to

Keyboard shortcuts

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