subscriptions

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GroupLogic_name = map[int32]string{
		0: "And",
		1: "Or",
		2: "Xor",
	}
	GroupLogic_value = map[string]int32{
		"And": 0,
		"Or":  1,
		"Xor": 2,
	}
)

Enum value maps for GroupLogic.

View Source
var ErrBusy = errors.New("subscription is busy, retry the operation")

ErrBusy indicates a storage entity is locked and the operation should be retried.

View Source
var ErrInternal = errors.New("internal failure")

ErrInternal indicates some unexpected internal failure.

View Source
var ErrInvalid = errors.New("invalid subscription")

ErrInvalid indicates the invalid subscription.

View Source
var ErrNotFound = errors.New("subscription was not found")

ErrNotFound indicates the subscription is missing in the storage and can not be read/updated/deleted.

View Source
var File_api_grpc_subscriptions_service_proto protoreflect.FileDescriptor

Functions

func RegisterServiceServer added in v0.0.2

func RegisterServiceServer(s *grpc.Server, srv ServiceServer)

Types

type ConditionInput added in v0.0.2

type ConditionInput struct {
	Not bool `protobuf:"varint,1,opt,name=not,proto3" json:"not,omitempty"`
	// Types that are assignable to Cond:
	//
	//	*ConditionInput_Gc
	//	*ConditionInput_Ktc
	Cond isConditionInput_Cond `protobuf_oneof:"cond"`
	// contains filtered or unexported fields
}

ConditionInput represents the Subscription routing Condition data that is immutable once Subscription is created.

func (*ConditionInput) Descriptor deprecated added in v0.0.2

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

Deprecated: Use ConditionInput.ProtoReflect.Descriptor instead.

func (*ConditionInput) GetCond added in v0.0.2

func (m *ConditionInput) GetCond() isConditionInput_Cond

func (*ConditionInput) GetGc added in v0.0.2

func (x *ConditionInput) GetGc() *GroupConditionInput

func (*ConditionInput) GetKtc added in v0.0.2

func (*ConditionInput) GetNot added in v0.0.2

func (x *ConditionInput) GetNot() bool

func (*ConditionInput) ProtoMessage added in v0.0.2

func (*ConditionInput) ProtoMessage()

func (*ConditionInput) ProtoReflect added in v0.0.2

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

func (*ConditionInput) Reset added in v0.0.2

func (x *ConditionInput) Reset()

func (*ConditionInput) String added in v0.0.2

func (x *ConditionInput) String() string

type ConditionInput_Gc added in v0.0.2

type ConditionInput_Gc struct {
	Gc *GroupConditionInput `protobuf:"bytes,2,opt,name=gc,proto3,oneof"`
}

type ConditionInput_Ktc added in v0.0.2

type ConditionInput_Ktc struct {
	Ktc *KiwiTreeConditionInput `protobuf:"bytes,3,opt,name=ktc,proto3,oneof"`
}

type ConditionOutput added in v0.0.2

type ConditionOutput struct {
	Not bool `protobuf:"varint,1,opt,name=not,proto3" json:"not,omitempty"`
	// Types that are assignable to Cond:
	//
	//	*ConditionOutput_Gc
	//	*ConditionOutput_Kc
	Cond isConditionOutput_Cond `protobuf_oneof:"cond"`
	// contains filtered or unexported fields
}

func (*ConditionOutput) Descriptor deprecated added in v0.0.2

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

Deprecated: Use ConditionOutput.ProtoReflect.Descriptor instead.

func (*ConditionOutput) GetCond added in v0.0.2

func (m *ConditionOutput) GetCond() isConditionOutput_Cond

func (*ConditionOutput) GetGc added in v0.0.2

func (*ConditionOutput) GetKc added in v0.0.2

func (*ConditionOutput) GetNot added in v0.0.2

func (x *ConditionOutput) GetNot() bool

func (*ConditionOutput) ProtoMessage added in v0.0.2

func (*ConditionOutput) ProtoMessage()

func (*ConditionOutput) ProtoReflect added in v0.0.2

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

func (*ConditionOutput) Reset added in v0.0.2

func (x *ConditionOutput) Reset()

func (*ConditionOutput) String added in v0.0.2

func (x *ConditionOutput) String() string

type ConditionOutput_Gc added in v0.0.2

type ConditionOutput_Gc struct {
	Gc *GroupConditionOutput `protobuf:"bytes,2,opt,name=gc,proto3,oneof"`
}

type ConditionOutput_Kc added in v0.0.2

type ConditionOutput_Kc struct {
	Kc *KiwiConditionOutput `protobuf:"bytes,3,opt,name=kc,proto3,oneof"`
}

type CreateRequest added in v0.0.2

type CreateRequest struct {
	Md   *Metadata       `protobuf:"bytes,1,opt,name=md,proto3" json:"md,omitempty"`
	Cond *ConditionInput `protobuf:"bytes,2,opt,name=cond,proto3" json:"cond,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateRequest) Descriptor deprecated added in v0.0.2

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

Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.

func (*CreateRequest) GetCond added in v0.0.2

func (x *CreateRequest) GetCond() *ConditionInput

func (*CreateRequest) GetMd added in v0.0.2

func (x *CreateRequest) GetMd() *Metadata

func (*CreateRequest) ProtoMessage added in v0.0.2

func (*CreateRequest) ProtoMessage()

func (*CreateRequest) ProtoReflect added in v0.0.2

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

func (*CreateRequest) Reset added in v0.0.2

func (x *CreateRequest) Reset()

func (*CreateRequest) String added in v0.0.2

func (x *CreateRequest) String() string

type CreateResponse added in v0.0.2

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

func (*CreateResponse) Descriptor deprecated added in v0.0.2

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

Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead.

func (*CreateResponse) GetId added in v0.0.2

func (x *CreateResponse) GetId() string

func (*CreateResponse) ProtoMessage added in v0.0.2

func (*CreateResponse) ProtoMessage()

func (*CreateResponse) ProtoReflect added in v0.0.2

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

func (*CreateResponse) Reset added in v0.0.2

func (x *CreateResponse) Reset()

func (*CreateResponse) String added in v0.0.2

func (x *CreateResponse) String() string

type DeleteRequest added in v0.0.2

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

func (*DeleteRequest) Descriptor deprecated added in v0.0.2

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

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetId added in v0.0.2

func (x *DeleteRequest) GetId() string

func (*DeleteRequest) ProtoMessage added in v0.0.2

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect added in v0.0.2

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

func (*DeleteRequest) Reset added in v0.0.2

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String added in v0.0.2

func (x *DeleteRequest) String() string

type GroupConditionInput added in v0.0.2

type GroupConditionInput struct {
	Logic GroupLogic        `protobuf:"varint,1,opt,name=logic,proto3,enum=awakari.subscriptions.GroupLogic" json:"logic,omitempty"`
	Group []*ConditionInput `protobuf:"bytes,2,rep,name=group,proto3" json:"group,omitempty"`
	// contains filtered or unexported fields
}

func (*GroupConditionInput) Descriptor deprecated added in v0.0.2

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

Deprecated: Use GroupConditionInput.ProtoReflect.Descriptor instead.

func (*GroupConditionInput) GetGroup added in v0.0.2

func (x *GroupConditionInput) GetGroup() []*ConditionInput

func (*GroupConditionInput) GetLogic added in v0.0.2

func (x *GroupConditionInput) GetLogic() GroupLogic

func (*GroupConditionInput) ProtoMessage added in v0.0.2

func (*GroupConditionInput) ProtoMessage()

func (*GroupConditionInput) ProtoReflect added in v0.0.2

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

func (*GroupConditionInput) Reset added in v0.0.2

func (x *GroupConditionInput) Reset()

func (*GroupConditionInput) String added in v0.0.2

func (x *GroupConditionInput) String() string

type GroupConditionOutput added in v0.0.2

type GroupConditionOutput struct {
	Logic GroupLogic         `protobuf:"varint,1,opt,name=logic,proto3,enum=awakari.subscriptions.GroupLogic" json:"logic,omitempty"`
	Group []*ConditionOutput `protobuf:"bytes,2,rep,name=group,proto3" json:"group,omitempty"`
	// contains filtered or unexported fields
}

func (*GroupConditionOutput) Descriptor deprecated added in v0.0.2

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

Deprecated: Use GroupConditionOutput.ProtoReflect.Descriptor instead.

func (*GroupConditionOutput) GetGroup added in v0.0.2

func (x *GroupConditionOutput) GetGroup() []*ConditionOutput

func (*GroupConditionOutput) GetLogic added in v0.0.2

func (x *GroupConditionOutput) GetLogic() GroupLogic

func (*GroupConditionOutput) ProtoMessage added in v0.0.2

func (*GroupConditionOutput) ProtoMessage()

func (*GroupConditionOutput) ProtoReflect added in v0.0.2

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

func (*GroupConditionOutput) Reset added in v0.0.2

func (x *GroupConditionOutput) Reset()

func (*GroupConditionOutput) String added in v0.0.2

func (x *GroupConditionOutput) String() string

type GroupLogic added in v0.0.2

type GroupLogic int32
const (
	GroupLogic_And GroupLogic = 0
	GroupLogic_Or  GroupLogic = 1
	GroupLogic_Xor GroupLogic = 2
)

func (GroupLogic) Descriptor added in v0.0.2

func (GroupLogic) Descriptor() protoreflect.EnumDescriptor

func (GroupLogic) Enum added in v0.0.2

func (x GroupLogic) Enum() *GroupLogic

func (GroupLogic) EnumDescriptor deprecated added in v0.0.2

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

Deprecated: Use GroupLogic.Descriptor instead.

func (GroupLogic) Number added in v0.0.2

func (x GroupLogic) Number() protoreflect.EnumNumber

func (GroupLogic) String added in v0.0.2

func (x GroupLogic) String() string

func (GroupLogic) Type added in v0.0.2

type KiwiConditionOutput added in v0.0.2

type KiwiConditionOutput struct {
	Id      string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Key     string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	Pattern string `protobuf:"bytes,3,opt,name=pattern,proto3" json:"pattern,omitempty"`
	Partial bool   `protobuf:"varint,4,opt,name=partial,proto3" json:"partial,omitempty"`
	// contains filtered or unexported fields
}

func (*KiwiConditionOutput) Descriptor deprecated added in v0.0.2

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

Deprecated: Use KiwiConditionOutput.ProtoReflect.Descriptor instead.

func (*KiwiConditionOutput) GetId added in v0.0.2

func (x *KiwiConditionOutput) GetId() string

func (*KiwiConditionOutput) GetKey added in v0.0.2

func (x *KiwiConditionOutput) GetKey() string

func (*KiwiConditionOutput) GetPartial added in v0.0.2

func (x *KiwiConditionOutput) GetPartial() bool

func (*KiwiConditionOutput) GetPattern added in v0.0.2

func (x *KiwiConditionOutput) GetPattern() string

func (*KiwiConditionOutput) ProtoMessage added in v0.0.2

func (*KiwiConditionOutput) ProtoMessage()

func (*KiwiConditionOutput) ProtoReflect added in v0.0.2

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

func (*KiwiConditionOutput) Reset added in v0.0.2

func (x *KiwiConditionOutput) Reset()

func (*KiwiConditionOutput) String added in v0.0.2

func (x *KiwiConditionOutput) String() string

type KiwiTreeConditionInput added in v0.0.2

type KiwiTreeConditionInput struct {
	Key     string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Pattern string `protobuf:"bytes,2,opt,name=pattern,proto3" json:"pattern,omitempty"`
	Partial bool   `protobuf:"varint,3,opt,name=partial,proto3" json:"partial,omitempty"`
	// contains filtered or unexported fields
}

marker type

func (*KiwiTreeConditionInput) Descriptor deprecated added in v0.0.2

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

Deprecated: Use KiwiTreeConditionInput.ProtoReflect.Descriptor instead.

func (*KiwiTreeConditionInput) GetKey added in v0.0.2

func (x *KiwiTreeConditionInput) GetKey() string

func (*KiwiTreeConditionInput) GetPartial added in v0.0.2

func (x *KiwiTreeConditionInput) GetPartial() bool

func (*KiwiTreeConditionInput) GetPattern added in v0.0.2

func (x *KiwiTreeConditionInput) GetPattern() string

func (*KiwiTreeConditionInput) ProtoMessage added in v0.0.2

func (*KiwiTreeConditionInput) ProtoMessage()

func (*KiwiTreeConditionInput) ProtoReflect added in v0.0.2

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

func (*KiwiTreeConditionInput) Reset added in v0.0.2

func (x *KiwiTreeConditionInput) Reset()

func (*KiwiTreeConditionInput) String added in v0.0.2

func (x *KiwiTreeConditionInput) String() string

type Metadata added in v0.0.2

type Metadata struct {
	Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
	Enabled     bool   `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"`
	// contains filtered or unexported fields
}

Metadata represents the mutable part of the Subscription data.

func (*Metadata) Descriptor deprecated added in v0.0.2

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

Deprecated: Use Metadata.ProtoReflect.Descriptor instead.

func (*Metadata) GetDescription added in v0.0.2

func (x *Metadata) GetDescription() string

func (*Metadata) GetEnabled added in v0.0.2

func (x *Metadata) GetEnabled() bool

func (*Metadata) ProtoMessage added in v0.0.2

func (*Metadata) ProtoMessage()

func (*Metadata) ProtoReflect added in v0.0.2

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

func (*Metadata) Reset added in v0.0.2

func (x *Metadata) Reset()

func (*Metadata) String added in v0.0.2

func (x *Metadata) String() string

type ReadRequest added in v0.0.2

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

func (*ReadRequest) Descriptor deprecated added in v0.0.2

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

Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead.

func (*ReadRequest) GetId added in v0.0.2

func (x *ReadRequest) GetId() string

func (*ReadRequest) ProtoMessage added in v0.0.2

func (*ReadRequest) ProtoMessage()

func (*ReadRequest) ProtoReflect added in v0.0.2

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

func (*ReadRequest) Reset added in v0.0.2

func (x *ReadRequest) Reset()

func (*ReadRequest) String added in v0.0.2

func (x *ReadRequest) String() string

type ReadResponse added in v0.0.2

type ReadResponse struct {
	Md   *Metadata        `protobuf:"bytes,1,opt,name=md,proto3" json:"md,omitempty"`
	Cond *ConditionOutput `protobuf:"bytes,2,opt,name=cond,proto3" json:"cond,omitempty"`
	// contains filtered or unexported fields
}

func (*ReadResponse) Descriptor deprecated added in v0.0.2

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

Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead.

func (*ReadResponse) GetCond added in v0.0.2

func (x *ReadResponse) GetCond() *ConditionOutput

func (*ReadResponse) GetMd added in v0.0.2

func (x *ReadResponse) GetMd() *Metadata

func (*ReadResponse) ProtoMessage added in v0.0.2

func (*ReadResponse) ProtoMessage()

func (*ReadResponse) ProtoReflect added in v0.0.2

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

func (*ReadResponse) Reset added in v0.0.2

func (x *ReadResponse) Reset()

func (*ReadResponse) String added in v0.0.2

func (x *ReadResponse) String() string

type SearchOwnRequest added in v0.0.2

type SearchOwnRequest struct {
	Cursor string `protobuf:"bytes,1,opt,name=cursor,proto3" json:"cursor,omitempty"`
	Limit  uint32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

func (*SearchOwnRequest) Descriptor deprecated added in v0.0.2

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

Deprecated: Use SearchOwnRequest.ProtoReflect.Descriptor instead.

func (*SearchOwnRequest) GetCursor added in v0.0.2

func (x *SearchOwnRequest) GetCursor() string

func (*SearchOwnRequest) GetLimit added in v0.0.2

func (x *SearchOwnRequest) GetLimit() uint32

func (*SearchOwnRequest) ProtoMessage added in v0.0.2

func (*SearchOwnRequest) ProtoMessage()

func (*SearchOwnRequest) ProtoReflect added in v0.0.2

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

func (*SearchOwnRequest) Reset added in v0.0.2

func (x *SearchOwnRequest) Reset()

func (*SearchOwnRequest) String added in v0.0.2

func (x *SearchOwnRequest) String() string

type SearchOwnResponse added in v0.0.2

type SearchOwnResponse struct {
	Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"`
	// contains filtered or unexported fields
}

func (*SearchOwnResponse) Descriptor deprecated added in v0.0.2

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

Deprecated: Use SearchOwnResponse.ProtoReflect.Descriptor instead.

func (*SearchOwnResponse) GetIds added in v0.0.2

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

func (*SearchOwnResponse) ProtoMessage added in v0.0.2

func (*SearchOwnResponse) ProtoMessage()

func (*SearchOwnResponse) ProtoReflect added in v0.0.2

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

func (*SearchOwnResponse) Reset added in v0.0.2

func (x *SearchOwnResponse) Reset()

func (*SearchOwnResponse) String added in v0.0.2

func (x *SearchOwnResponse) String() string

type Service

type Service interface {

	// Create a subscription with the specified fields.
	Create(ctx context.Context, userId string, subData subscription.Data) (id string, err error)

	// Read returns the subscription specified by the id. Returns ErrNotFound if subscription is missing.
	Read(ctx context.Context, userId, subId string) (subData subscription.Data, err error)

	// UpdateMetadata updates the mutable part of the subscription.Data
	UpdateMetadata(ctx context.Context, userId, subId string, md subscription.Metadata) (err error)

	// Delete the specified subscription all associated conditions those not in use by any other subscription.
	// Returns ErrNotFound if a subscription with the specified id is missing.
	Delete(ctx context.Context, userId, subId string) (err error)

	// SearchOwn returns all subscription ids those have the requested user id.
	SearchOwn(ctx context.Context, userId string, limit uint32, cursor string) (ids []string, err error)
}

func NewService

func NewService(client ServiceClient) Service

func NewServiceMock

func NewServiceMock() Service

type ServiceClient added in v0.0.2

type ServiceClient interface {
	Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
	Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error)
	UpdateMetadata(ctx context.Context, in *UpdateMetadataRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	SearchOwn(ctx context.Context, in *SearchOwnRequest, opts ...grpc.CallOption) (*SearchOwnResponse, error)
}

ServiceClient is the client API for Service service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewServiceClient added in v0.0.2

func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient

type ServiceServer added in v0.0.2

ServiceServer is the server API for Service service.

type UnimplementedServiceServer added in v0.0.2

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedServiceServer) Create added in v0.0.2

func (*UnimplementedServiceServer) Delete added in v0.0.2

func (*UnimplementedServiceServer) Read added in v0.0.2

func (*UnimplementedServiceServer) SearchOwn added in v0.0.2

func (*UnimplementedServiceServer) UpdateMetadata added in v0.0.2

type UpdateMetadataRequest added in v0.0.2

type UpdateMetadataRequest struct {
	Id string    `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Md *Metadata `protobuf:"bytes,2,opt,name=md,proto3" json:"md,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateMetadataRequest) Descriptor deprecated added in v0.0.2

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

Deprecated: Use UpdateMetadataRequest.ProtoReflect.Descriptor instead.

func (*UpdateMetadataRequest) GetId added in v0.0.2

func (x *UpdateMetadataRequest) GetId() string

func (*UpdateMetadataRequest) GetMd added in v0.0.2

func (x *UpdateMetadataRequest) GetMd() *Metadata

func (*UpdateMetadataRequest) ProtoMessage added in v0.0.2

func (*UpdateMetadataRequest) ProtoMessage()

func (*UpdateMetadataRequest) ProtoReflect added in v0.0.2

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

func (*UpdateMetadataRequest) Reset added in v0.0.2

func (x *UpdateMetadataRequest) Reset()

func (*UpdateMetadataRequest) String added in v0.0.2

func (x *UpdateMetadataRequest) String() string

Jump to

Keyboard shortcuts

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