storage

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage added in v0.0.5

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

func NewStorage added in v0.1.1

func NewStorage() (*Storage, error)

func (*Storage) AddOrGetUser added in v0.0.5

func (s *Storage) AddOrGetUser(chatID int64) (User, error)

func (*Storage) GetAPIKey added in v0.0.5

func (s *Storage) GetAPIKey(chatID int64) (string, error)

func (*Storage) GetAllSubscriptions added in v0.0.5

func (s *Storage) GetAllSubscriptions(chatID int64) ([]Subscription, error)

func (*Storage) GetAllUsers added in v0.0.5

func (s *Storage) GetAllUsers() ([]User, error)

func (*Storage) GetLastUpdateCheck added in v0.1.1

func (s *Storage) GetLastUpdateCheck(chatID int64) (int64, error)

func (*Storage) GetSubscription added in v0.0.7

func (s *Storage) GetSubscription(
	chatID, titleID int64,
) (*Subscription, error)

func (*Storage) GetUTCOffset added in v0.1.2

func (s *Storage) GetUTCOffset(chatID int64) (int, error)

func (*Storage) SetAPIKey added in v0.0.5

func (s *Storage) SetAPIKey(chatID int64, apiKey string) error

func (*Storage) SetLastUpdateCheck added in v0.1.1

func (s *Storage) SetLastUpdateCheck(chatID int64, timestamp int64) error

func (*Storage) SetLatestSubtitleTimestamp added in v0.0.5

func (s *Storage) SetLatestSubtitleTimestamp(
	chatID,
	titleID,
	latestSubtitleTime int64,
) error

func (*Storage) SetName added in v0.1.3

func (s *Storage) SetName(
	chatID, titleID int64,
	name string,
) error

func (*Storage) SetNotificationInterval added in v0.0.5

func (s *Storage) SetNotificationInterval(chatID int64, interval int) error

func (*Storage) SetUTCOffset added in v0.1.2

func (s *Storage) SetUTCOffset(chatID int64, offsetMinutes int) error

func (*Storage) Subscribe added in v0.0.5

func (s *Storage) Subscribe(
	chatID, titleID, latestSubtitleTime int64,
	name string,
) error

func (*Storage) SubscriptionExists added in v0.0.5

func (s *Storage) SubscriptionExists(chatID, titleID int64) (bool, error)

func (*Storage) Unsubscribe added in v0.0.5

func (s *Storage) Unsubscribe(chatID, titleID int64) error

type Subscription

type Subscription struct {
	TitleID      int64 `gorm:"primaryKey"`
	ChatID       int64
	LastModified int64
	Name         string
}

type User

type User struct {
	ChatID                   int64 `gorm:"primaryKey"`
	NotificationInterval     int
	APIKey                   string
	UTCOffsetMinutes         int
	LastUpdateCheckTimestamp int64
}

Jump to

Keyboard shortcuts

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