service

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReturnError

func ReturnError() string

Return a friendly error message

Types

type Chat

type Chat struct {
	Id             string     `json:"id"`
	TelegramChatId string     `json:"TelegramChatId"`
	TelegramUserId string     `json:"TelegramUserId"`
	Tags           string     `json:"Tags"`
	LastTimeParsed *time.Time `json:"LastTimeParsed"`
}

type ChatDeleteFeedResponse added in v1.3.0

type ChatDeleteFeedResponse struct {
	Deleted bool `json:"deleted"`
}

type ChatFeedLinkResponse added in v1.4.0

type ChatFeedLinkResponse struct {
	Added bool `json:"added"`
}

type ChatFeedsResponse added in v1.1.0

type ChatFeedsResponse struct {
	Feeds []Feeds `json:"feeds"`
}

type ChatResponse

type ChatResponse struct {
	Chat Chat `json:"chat"`
}

type ChatTagsResponse added in v1.2.0

type ChatTagsResponse struct {
	Tags []string `json:"tags"`
}

type Feed added in v1.4.0

type Feed struct {
	Id  string `json:"id"`
	Url string `json:"url"`
}

type FeedResponse added in v1.4.0

type FeedResponse struct {
	Feed Feed `json:"feed"`
}

type Feeds added in v1.3.0

type Feeds struct {
	Id  string `json:"id"`
	Url string `json:"url"`
}

type IOttoService

type IOttoService interface {
	InitChat(chatId string, userId string, threadId string, tags []string) *Chat
	ListFeeds(chatId string) []Feeds
	ListTags(chatId string) []string
	AddFeed(feedUrl string) *Feed
	LinkFeedToChat(chatId string, feedId string) bool
	DeleteTag(chatId string, tag string) bool
	AddTags(chatId string, tags []string) []string
	DisableFeeds(chatId string, feedId string) bool
}

func NewOttoService

func NewOttoService() IOttoService

Initiate an Otto service

type OttoService

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

func (*OttoService) AddFeed added in v1.4.0

func (s *OttoService) AddFeed(feedUrl string) *Feed

Add feed to the chat

func (*OttoService) AddTags added in v1.2.0

func (s *OttoService) AddTags(chatId string, tags []string) []string

Add tags to the chats

func (*OttoService) DeleteTag added in v1.2.0

func (s *OttoService) DeleteTag(chatId string, tag string) bool

Delete one tag from the chat

func (*OttoService) DisableFeeds added in v1.3.0

func (s *OttoService) DisableFeeds(chatId string, feedId string) bool

func (*OttoService) InitChat

func (s *OttoService) InitChat(chatId string, userId string, threadId string, tags []string) *Chat

Create the chat in Otto DB

func (*OttoService) LinkFeedToChat added in v1.4.0

func (s *OttoService) LinkFeedToChat(chatId string, feedId string) bool

link feed to the current chat

func (*OttoService) ListFeeds added in v1.1.0

func (s *OttoService) ListFeeds(chatId string) []Feeds

Retrieve all feeds attached to a chatId

func (*OttoService) ListTags added in v1.2.0

func (s *OttoService) ListTags(chatId string) []string

Retrieve all tags attached to a chatId

Jump to

Keyboard shortcuts

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