legacy

package
v0.0.0-...-c2e572c Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	UUID        string
	Extension   string
	ContentType string
}

type Information

type Information struct {
	Author   string
	URL      string
	Email    string
	Twitter  string
	Facebook string
	Telegram string
}

type LegacyStorage

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

func NewLegacyStorage

func NewLegacyStorage(db *storm.DB) *LegacyStorage

func (*LegacyStorage) FindMessageByTickerID

func (s *LegacyStorage) FindMessageByTickerID(id int) ([]Message, error)

func (*LegacyStorage) FindSetting

func (s *LegacyStorage) FindSetting(name string) (Setting, error)

func (*LegacyStorage) FindTickers

func (s *LegacyStorage) FindTickers() ([]Ticker, error)

func (*LegacyStorage) FindUploads

func (s *LegacyStorage) FindUploads() ([]Upload, error)

func (*LegacyStorage) FindUsers

func (s *LegacyStorage) FindUsers() ([]User, error)

type Location

type Location struct {
	Lat float64
	Lon float64
}

type Mastodon

type Mastodon struct {
	Active      bool   `json:"active"`
	Server      string `json:"server"`
	Token       string `json:"token"`
	Secret      string `json:"secret"`
	AccessToken string `json:"access_token"`
	User        mastodon.Account
}

type Message

type Message struct {
	ID             int       `storm:"id,increment"`
	CreationDate   time.Time `storm:"index"`
	Ticker         int       `storm:"index"`
	Text           string
	Attachments    []Attachment
	GeoInformation geojson.FeatureCollection
	Tweet          Tweet
	Telegram       TelegramMeta
	Mastodon       mastodon.Status
}

type Migration

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

func NewMigration

func NewMigration(oldStorage *LegacyStorage, newStorage *storage.SqlStorage) *Migration

func (*Migration) Do

func (m *Migration) Do() error

type Setting

type Setting struct {
	ID    int    `storm:"id,increment"`
	Name  string `storm:"unique"`
	Value interface{}
}

type Telegram

type Telegram struct {
	Active      bool   `json:"active"`
	ChannelName string `json:"channel_name"`
}

type TelegramMeta

type TelegramMeta struct {
	Messages []tgbotapi.Message
}

type Ticker

type Ticker struct {
	ID           int       `storm:"id,increment"`
	CreationDate time.Time `storm:"index"`
	Domain       string    `storm:"unique"`
	Title        string
	Description  string
	Active       bool
	Information  Information
	Telegram     Telegram
	Mastodon     Mastodon
	Location     Location
}

type Tweet

type Tweet struct {
	ID       string
	UserName string
}

type Upload

type Upload struct {
	ID           int       `storm:"id,increment"`
	UUID         string    `storm:"index,unique"`
	CreationDate time.Time `storm:"index"`
	TickerID     int       `storm:"index"`
	Path         string
	Extension    string
	ContentType  string
}

type User

type User struct {
	ID                int       `storm:"id,increment"`
	CreationDate      time.Time `storm:"index"`
	Email             string    `storm:"unique"`
	Role              string
	EncryptedPassword string
	IsSuperAdmin      bool
	Tickers           []int
}

Jump to

Keyboard shortcuts

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