Documentation ¶ Index ¶ Variables func NewTelegramHandler(svc Service) telegram.Handler type Link type Message type Service func NewLoggingService(ctx context.Context, s Service) Service func NewService(s Store, providers ...provider.Provider) Service type Store func NewStoreMock() Store Constants ¶ This section is empty. Variables ¶ View Source var ( ErrProviderNotFound = errors.New("provider not found") ErrLinkNotFound = errors.New("link not found in message") ErrLinksNotFound = errors.New("links not found") ErrHasAlreadyShare = errors.New("already share it") ) Functions ¶ func NewTelegramHandler ¶ added in v1.0.0 func NewTelegramHandler(svc Service) telegram.Handler Types ¶ type Link ¶ added in v1.0.0 type Link struct { URL string Name string } type Message ¶ type Message struct { URL string `bson:"url"` Title string `bson:"title"` Links []Link `bson:"links,omitempty"` UserID int `bson:"user_id"` } type Service ¶ type Service interface { FindLinks(ctx context.Context, m *Message) (*Message, error) GetList(ctx context.Context, userID int) (string, error) } func NewLoggingService ¶ func NewLoggingService(ctx context.Context, s Service) Service func NewService ¶ func NewService(s Store, providers ...provider.Provider) Service type Store ¶ type Store interface { Save(ctx context.Context, m *Message) error FindByURL(ctx context.Context, url string) (*Message, error) FindByUser(ctx context.Context, userID int) ([]Message, error) } func NewStoreMock ¶ func NewStoreMock() Store Source Files ¶ View all Source files logging.goservice.gostore-mock.gotransport.go Click to show internal directories. Click to hide internal directories.