Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) RemoveItem ¶
func (*Cache) UpsertItem ¶
func (c *Cache) UpsertItem(key uuid.UUID, value *Subscriber)
type Cacher ¶
type Cacher interface { UpsertItem(key uuid.UUID, value *Subscriber) GetItem(key uuid.UUID) (*Subscriber, bool) }
type DataProvider ¶
type DataProvider interface { Create(*Subscriber) error Update(*Subscriber) error GetByID(uuid.UUID) (*Subscriber, error) }
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
func (*Repo) Create ¶
func (r *Repo) Create(item *Subscriber) error
func (*Repo) Update ¶
func (r *Repo) Update(item *Subscriber) error
type Server ¶
type Server struct { feedpb.UnimplementedSubscriberServer // contains filtered or unexported fields }
func NewServer ¶
func NewServer(sp SubscriberProvider) *Server
func (*Server) Create ¶
func (s *Server) Create(ctx context.Context, req *feedpb.CreateSubscriberRequest) (*feedpb.CreateSubscriberResponse, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(r DataProvider, c Cacher) (*Service, error)
type Subscriber ¶
type SubscriberProvider ¶
type SubscriberProvider interface { GetByID(_ context.Context, id uuid.UUID) (*Subscriber, error) Create(_ context.Context, webhookURL string) (*Subscriber, error) Update(_ context.Context, item Subscriber) error }
Click to show internal directories.
Click to hide internal directories.