Documentation ¶
Index ¶
- Constants
- type CacheClient
- func (c *CacheClient) Clear() error
- func (c *CacheClient) Exists(key string) bool
- func (c *CacheClient) Get(key string) (string, error)
- func (c *CacheClient) GetBytes(key string) ([]byte, error)
- func (c *CacheClient) GetEx(key string, expiration time.Duration) (string, error)
- func (c *CacheClient) GetKeys(keyPattern string, count ...int64) ([]string, error)
- func (c *CacheClient) Set(key string, value interface{}, expiration time.Duration) error
- type Feed
- type FeedsMonitor
- func (fm *FeedsMonitor) FeedIndex(name string) int
- func (fm *FeedsMonitor) LastCheck() int64
- func (fm *FeedsMonitor) LastCheckStr() string
- func (fm *FeedsMonitor) LastMonit() int64
- func (fm *FeedsMonitor) Location() *time.Location
- func (fm *FeedsMonitor) SaveFeedsData() error
- func (fm *FeedsMonitor) Start()
- func (fm *FeedsMonitor) UpdateFollowers()
Constants ¶
View Source
const DefaultCharacterLimit = 500 // default mastodon max character limit
View Source
const DefaultCheckInterval = 10 // default check feed interval in minutes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheClient ¶ added in v1.0.6
type CacheClient struct {
// contains filtered or unexported fields
}
func Cache ¶ added in v1.0.6
func Cache() *CacheClient
Cache returns a singleton instance of CacheClient
func (*CacheClient) Clear ¶ added in v1.0.6
func (c *CacheClient) Clear() error
Clear clears all keys in redis
func (*CacheClient) Exists ¶ added in v1.0.6
func (c *CacheClient) Exists(key string) bool
Exists checks if a key exists in redis
func (*CacheClient) Get ¶ added in v1.0.6
func (c *CacheClient) Get(key string) (string, error)
Get gets a value from redis
func (*CacheClient) GetBytes ¶ added in v1.0.6
func (c *CacheClient) GetBytes(key string) ([]byte, error)
GetBytes gets a value from redis as bytes
type Feed ¶
type Feed struct { Name string `yaml:"name"` FeedUrl string `yaml:"url"` Token string `yaml:"token"` Prefix string `yaml:"prefix,omitempty"` Visibility string `yaml:"visibility,omitempty"` HashLink string `yaml:"hashlink,omitempty"` ReplaceFrom string `yaml:"replace_from,omitempty"` ReplaceTo string `yaml:"replace_to,omitempty"` Interval int64 `yaml:"interval,omitempty"` LastRun int64 `yaml:"last_run,omitempty"` Count int64 `yaml:"-"` Id int64 `yaml:"-"` Followers atomic.Int64 `yaml:"-"` Progress atomic.Int64 `yaml:"-"` SendTime time.Time `yaml:"-"` }
type FeedsMonitor ¶
type FeedsMonitor struct { Instance struct { URL string `yaml:"url"` Lang string `yaml:"lang"` Limit int `yaml:"limit"` TimeZone string `yaml:"timezone"` Save bool `yaml:"save,omitempty"` Monit int64 `yaml:"last_monit,omitempty"` Feeds []*Feed `yaml:"feed"` } `yaml:"instance"` // contains filtered or unexported fields }
func NewFeedsMonitor ¶
func NewFeedsMonitor() (*FeedsMonitor, error)
func (*FeedsMonitor) FeedIndex ¶ added in v1.0.6
func (fm *FeedsMonitor) FeedIndex(name string) int
func (*FeedsMonitor) LastCheck ¶ added in v1.0.7
func (fm *FeedsMonitor) LastCheck() int64
func (*FeedsMonitor) LastCheckStr ¶ added in v1.0.7
func (fm *FeedsMonitor) LastCheckStr() string
func (*FeedsMonitor) LastMonit ¶ added in v1.0.6
func (fm *FeedsMonitor) LastMonit() int64
func (*FeedsMonitor) Location ¶ added in v1.0.6
func (fm *FeedsMonitor) Location() *time.Location
func (*FeedsMonitor) SaveFeedsData ¶
func (fm *FeedsMonitor) SaveFeedsData() error
func (*FeedsMonitor) Start ¶
func (fm *FeedsMonitor) Start()
func (*FeedsMonitor) UpdateFollowers ¶ added in v1.0.6
func (fm *FeedsMonitor) UpdateFollowers()
Click to show internal directories.
Click to hide internal directories.