repository

package
v0.0.0-...-102fae3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chats

type Chats interface {
	GenerateStateForChat(chatID int64) (string, error)
	AddChat(chatId int64) error
	DeleteChat(chatID int64) error
	DeleteUUID(chat *models.Chat) error
	SetToken(chat *models.Chat, token twitchmodels.UserAccessToken) error
	SetTwitchID(chat *models.Chat, twitchID string) error
	SetUUID(chatID int64, uuid string) error
	GetChatByUUID(uuid string) (*models.Chat, error)
	GetChatByTwitchID(twitchID string) (*models.Chat, error)
	GetChat(chatID int64) (*models.Chat, error)
}

type ChatsPostgre

type ChatsPostgre struct {
	DB *gorm.DB
	// contains filtered or unexported fields
}

func NewChatPostgre

func NewChatPostgre(db *gorm.DB, api *twitch.TwitchAPI) *ChatsPostgre

func (*ChatsPostgre) AddChat

func (repository *ChatsPostgre) AddChat(chatId int64) error

func (*ChatsPostgre) DeleteChat

func (repository *ChatsPostgre) DeleteChat(chatID int64) error

Delete chats and follows that are not used anymore

func (*ChatsPostgre) DeleteUUID

func (repository *ChatsPostgre) DeleteUUID(chat *models.Chat) error

func (*ChatsPostgre) GenerateStateForChat

func (repository *ChatsPostgre) GenerateStateForChat(chatID int64) (string, error)

func (*ChatsPostgre) GetChat

func (repository *ChatsPostgre) GetChat(chatID int64) (*models.Chat, error)

func (*ChatsPostgre) GetChatByTwitchID

func (repository *ChatsPostgre) GetChatByTwitchID(twitchID string) (*models.Chat, error)

func (*ChatsPostgre) GetChatByUUID

func (repository *ChatsPostgre) GetChatByUUID(uuid string) (*models.Chat, error)

func (*ChatsPostgre) SetToken

func (repository *ChatsPostgre) SetToken(chat *models.Chat, token twitchmodels.UserAccessToken) error

func (*ChatsPostgre) SetTwitchID

func (repository *ChatsPostgre) SetTwitchID(chat *models.Chat, twitchID string) error

func (*ChatsPostgre) SetUUID

func (repository *ChatsPostgre) SetUUID(chatID int64, uuid string) error

type Follows

type Follows interface {
	GetChatsByFollow(followID string) ([]models.Chat, error)
	GetFollow(id string) (*models.Follow, error)
	GetUnSubedFollows() ([]models.Follow, error)
	SaveFollow(follow *models.Follow) error
	UpdateSubID(followID string, subID string) error
	AddFollow(chatID int64, follow models.Follow) error
}

type FollowsPostgre

type FollowsPostgre struct {
	DB *gorm.DB
}

func NewFollowsPostgre

func NewFollowsPostgre(db *gorm.DB) *FollowsPostgre

func (*FollowsPostgre) AddFollow

func (repository *FollowsPostgre) AddFollow(chatID int64, follow models.Follow) error

func (*FollowsPostgre) GetChatsByFollow

func (repository *FollowsPostgre) GetChatsByFollow(followID string) ([]models.Chat, error)

func (*FollowsPostgre) GetFollow

func (repository *FollowsPostgre) GetFollow(id string) (*models.Follow, error)

func (*FollowsPostgre) GetUnSubedFollows

func (repository *FollowsPostgre) GetUnSubedFollows() ([]models.Follow, error)

func (*FollowsPostgre) SaveFollow

func (repository *FollowsPostgre) SaveFollow(follow *models.Follow) error

func (*FollowsPostgre) UpdateSubID

func (repository *FollowsPostgre) UpdateSubID(followID string, subID string) error

type Repository

type Repository struct {
	Chats
	Follows
	Streamers
}

func NewRepository

func NewRepository(db *gorm.DB, twitchAPI *twitch.TwitchAPI) *Repository

type Streamers

type Streamers interface {
	GetStreamerByID(broadcasterID string) (*models.StreamerAccount, error)
	UpdateStreamer(streamer *models.StreamerAccount) error
	CreateStreamer(streamer *models.StreamerAccount) error
}

type StreamersGORM

type StreamersGORM struct {
	DB *gorm.DB
}

func NewStreamersGORMRepository

func NewStreamersGORMRepository(db *gorm.DB) *StreamersGORM

func (*StreamersGORM) CreateStreamer

func (repository *StreamersGORM) CreateStreamer(streamer *models.StreamerAccount) error

func (*StreamersGORM) GetStreamerByID

func (repository *StreamersGORM) GetStreamerByID(broadcasterID string) (*models.StreamerAccount, error)

func (*StreamersGORM) UpdateStreamer

func (repository *StreamersGORM) UpdateStreamer(streamer *models.StreamerAccount) error

Jump to

Keyboard shortcuts

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