Documentation ¶
Index ¶
- func PostHealthcheckToDiscord(healthcheck HealthcheckWebsiteResult) string
- func PostToDiscord(item StoredItem) string
- func PutMainItem(item MainItem) string
- func StoreItems(items TwitterSearchResult, keyword string) string
- func TranslateToEnglish(originalText string, languageCode string) string
- type DiscordBotCredentials
- type DownforHttpCheckResponse
- type DynamoDBMainItem
- type DynamoDBNewKeywordItem
- type DynamoDBStoredItem
- type GenericConfig
- type HealthcheckWebsiteResult
- type KeywordConfig
- type MainItem
- type MainItemKey
- type MappingsConfig
- type NewKeywordItem
- type StoredItem
- type StoredItemKey
- type TwitterBotCredentials
- type TwitterData
- type TwitterGetUserDetailResult
- type TwitterSearchResult
- type TwitterSearchResultMetadata
- type TwitterSearchResultTweet
- type TwitterUserDetails
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PostHealthcheckToDiscord ¶
func PostHealthcheckToDiscord(healthcheck HealthcheckWebsiteResult) string
func PostToDiscord ¶
func PostToDiscord(item StoredItem) string
func PutMainItem ¶
func StoreItems ¶
func StoreItems(items TwitterSearchResult, keyword string) string
func TranslateToEnglish ¶
Types ¶
type DiscordBotCredentials ¶
func GetDiscordCredentials ¶
func GetDiscordCredentials() DiscordBotCredentials
type DynamoDBMainItem ¶
type DynamoDBNewKeywordItem ¶
type DynamoDBStoredItem ¶
type GenericConfig ¶
type GenericConfig struct {
Channels []string `yaml:"channels"`
}
type HealthcheckWebsiteResult ¶
func HealthcheckWebsite ¶
func HealthcheckWebsite(website string) HealthcheckWebsiteResult
Based on: https://downforeveryoneorjustme.com/
type KeywordConfig ¶
type MainItem ¶
type MainItem struct { ID string // Type|ID Type string // healthcheck UpdatedAt time.Time Data string }
func FromDynamoDBMainItemToMainItem ¶
func FromDynamoDBMainItemToMainItem(dbitem DynamoDBMainItem) (MainItem, error)
func GetMainItem ¶
func GetMainItem(key MainItemKey) (MainItem, error)
type MainItemKey ¶
type MappingsConfig ¶
type MappingsConfig struct { Keyword []KeywordConfig `yaml:"keywords"` HealthCheck GenericConfig `yaml:"healthcheck"` }
func GetMappingsConfig ¶
func GetMappingsConfig() MappingsConfig
type NewKeywordItem ¶
type StoredItem ¶
type StoredItem struct { ID string // Source|Hash ItemIndex int // 0 = initial, >0 = aggregate HappenedAt time.Time SourceType string // twitter Keyword string Link string Data TwitterData }
func FromDynamoDStoredItemToMainItem ¶
func FromDynamoDStoredItemToMainItem(dbitem DynamoDBStoredItem) (StoredItem, error)
func GetStoredItem ¶
func GetStoredItem(key StoredItemKey) (StoredItem, error)
type StoredItemKey ¶
type TwitterBotCredentials ¶
type TwitterBotCredentials struct { APIKey string `json:"ApiKey"` APISecretKey string `json:"ApiSecretKey"` BearerToken string `json:"BearerToken"` }
func GetTwitterCredentials ¶
func GetTwitterCredentials() TwitterBotCredentials
type TwitterData ¶
type TwitterData struct { TwitterSearchResultTweet // important: don't use a comma here TranslatedText string `json:"translated_text"` }
type TwitterGetUserDetailResult ¶
type TwitterGetUserDetailResult struct { Data struct { PublicMetrics struct { Followers int `json:"followers_count"` } `json:"public_metrics"` } `json:"data"` }
type TwitterSearchResult ¶
type TwitterSearchResult struct { Data []TwitterSearchResultTweet `json:"data"` Meta TwitterSearchResultMetadata `json:"meta"` }
func SearchTwitter ¶
func SearchTwitter(keyword string) TwitterSearchResult
type TwitterUserDetails ¶
func GetTwitterUserDetails ¶
func GetTwitterUserDetails(userId string) (TwitterUserDetails, error)
Click to show internal directories.
Click to hide internal directories.