Documentation ¶
Overview ¶
*
- File : config.go
- Author : Alexandre Saison <alexandre.saison@inarix.com>
- Date : 08.11.2021
- Last Modified Date: 14.11.2021
- Last Modified By : Alexandre Saison <alexandre.saison@inarix.com>
*
- File : db.go
- Author : Alexandre Saison <alexandre.saison@inarix.com>
- Date : 14.11.2021
- Last Modified Date: 16.11.2021
- Last Modified By : Alexandre Saison <alexandre.saison@inarix.com>
*
- File : scheduler.go
- Author : Alexandre Saison <alexandre.saison@inarix.com>
- Date : 08.11.2021
- Last Modified Date: 14.11.2021
- Last Modified By : Alexandre Saison <alexandre.saison@inarix.com>
*
- File : slack.go
- Author : Alexandre Saison <alexandre.saison@inarix.com>
- Date : 08.11.2021
- Last Modified Date: 14.11.2021
- Last Modified By : Alexandre Saison <alexandre.saison@inarix.com>
*
- File : structs.go
- Author : Alexandre Saison <alexandre.saison@inarix.com>
- Date : 14.11.2021
- Last Modified Date: 14.11.2021
- Last Modified By : Alexandre Saison <alexandre.saison@inarix.com>
Index ¶
- func AddingContextAuthor(authorName string) *slack.ContextBlock
- func ContextInputText() *slack.InputBlock
- func DownloadFile(filepath string, url string, overide bool) error
- func FetchRelatedGif(buzzWord string) (string, string, error)
- func FetchUserById(slackClient *slack.Client, userId string) (*slack.User, error)
- func FetchUsersFromChannel(slackClient *slack.Client, channelId string) (*slack.Channel, []*slack.User, error)
- func GenerateBuzzWords() []string
- func GenerateRandomIndexBuzzWord(words []string) int
- func HasAlreadySetMood(dbClient *gorm.DB, slackClient *slack.Client, userID, threadTS string) (bool, error)
- func InitDbClient(dbHost, dbUser, dbPassword, dbName string, migrate bool) *gorm.DB
- func InitScheduler(dbClient *gorm.DB, client *slack.Client, config *Config, threadTS string) (*gocron.Scheduler, *gocron.Job, error)
- func IsUserAdmin(dbClient *gorm.DB, userId string) (bool, error)
- func SendImage(client *slack.Client, channelId, filePath, title, comment string) error
- func SendSlackBlocks(client *slack.Client, config *Config, dbClient *gorm.DB, threadTS string, ...) (string, error)
- func SendSlackMessage(client *slack.Client, config *Config, message string) (string, error)
- func SendSlackMessageToUser(client *slack.Client, userId, message string) (string, error)
- func SendSlackTSMessage(client *slack.Client, config *Config, message string, ts string) (string, error)
- func UpdateMessage(client *slack.Client, config *Config, dbClient *gorm.DB, threadTS string, ...) (string, error)
- type Config
- type DailyMood
- func FetchMoodFromThreadTS(dbClient *gorm.DB, threadTS string, userId uint) (*DailyMood, error)
- func HandleAddDailyMood(dbClient *gorm.DB, slackClient *slack.Client, ...) (*DailyMood, error)
- func UpdateMood(dbClient *gorm.DB, sourceMood *DailyMood, feeling *string, context *string) (*DailyMood, error)
- func UpdateMoodById(dbClient *gorm.DB, moodId string, feeling *string, context *string) (*DailyMood, error)
- type DbConfig
- type ErrMoodAlreadySet
- type ErrNoActionFound
- type GiphyResponse
- type SlackVerificationStruct
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddingContextAuthor ¶
func AddingContextAuthor(authorName string) *slack.ContextBlock
func ContextInputText ¶
func ContextInputText() *slack.InputBlock
func DownloadFile ¶
DownloadFile will download a url to a local file. It's efficient because it will write as it downloads and not load the whole file into memory.
func FetchRelatedGif ¶
@params buzzWord: string @returns title:string, url:string, err:error
func FetchUserById ¶
func FetchUsersFromChannel ¶
func GenerateBuzzWords ¶
func GenerateBuzzWords() []string
func HasAlreadySetMood ¶
func InitDbClient ¶
func InitScheduler ¶
func SendSlackBlocks ¶
func SendSlackMessage ¶
func SendSlackMessageToUser ¶
func SendSlackTSMessage ¶
Types ¶
type Config ¶
type Config struct { CHANNEL_ID string SLACK_API_TOKEN string APP_PORT string CRON_EXPRESSION string SLACK_MESSAGE_CHANNEL chan string DB *DbConfig }
func InitConfig ¶
type DailyMood ¶
type DailyMood struct { gorm.Model CreatedAt time.Time UserID uint Mood string Feeling string ThreadTS string Context string }
func FetchMoodFromThreadTS ¶
func HandleAddDailyMood ¶
func UpdateMood ¶
type ErrMoodAlreadySet ¶
type ErrMoodAlreadySet struct {
UserId string
}
func NewErrMoodAlreadySet ¶
func NewErrMoodAlreadySet(userId string) *ErrMoodAlreadySet
func (*ErrMoodAlreadySet) Error ¶
func (err *ErrMoodAlreadySet) Error() string
type ErrNoActionFound ¶
------------------------------//
func NewErrNoActionFound ¶
func NewErrNoActionFound(actionId, actionValue string) *ErrNoActionFound
func (*ErrNoActionFound) Error ¶
func (err *ErrNoActionFound) Error() string
type GiphyResponse ¶
type GiphyResponse struct { Meta giphyResponseMeta `json:"meta"` Pagination giphyResponsePagination `json:"pagination,omitempty"` Data []giphyResponseData `json:"data,omitempty"` }
type SlackVerificationStruct ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.