Documentation ¶
Index ¶
Constants ¶
View Source
const (
// GreyListTTL defined the TTL of a repository in seconds: 30 days (~30 days)
GreyListTTL = 60 * 60 * 24 * 30
)
View Source
const (
// OK is the standard response of a Redis server if everything went fine
RedisOK = "OK"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection interface { // Close closes the connection. Close() error // MarkRepositoryAsTweeted marks a single projects as "already tweeted". // This information will be stored in Redis as a simple set with a TTL. // The timestamp of the tweet will be used as value. MarkRepositoryAsTweeted(projectName, score string) (bool, error) // IsRepositoryAlreadyTweeted checks if a project was already tweeted. // If it is not available // a) the project was not tweeted yet // b) the project ttl expired and is ready to tweet again IsRepositoryAlreadyTweeted(projectName string) (bool, error) }
type MemoryConnection ¶
type MemoryConnection struct {
// contains filtered or unexported fields
}
func (*MemoryConnection) Close ¶
func (mc *MemoryConnection) Close() error
func (*MemoryConnection) IsRepositoryAlreadyTweeted ¶
func (mc *MemoryConnection) IsRepositoryAlreadyTweeted(projectName string) (bool, error)
func (*MemoryConnection) MarkRepositoryAsTweeted ¶
func (mc *MemoryConnection) MarkRepositoryAsTweeted(projectName, score string) (bool, error)
type MemoryPool ¶
type MemoryPool struct {
// contains filtered or unexported fields
}
func (MemoryPool) Close ¶
func (mp MemoryPool) Close() error
func (MemoryPool) Get ¶
func (mp MemoryPool) Get() Connection
type MemoryStorage ¶
type MemoryStorage struct{}
func (*MemoryStorage) NewPool ¶
func (ms *MemoryStorage) NewPool(url, auth string) Pool
type MemoryStorageContainer ¶
type Pool ¶
type Pool interface { Close() error Get() Connection }
type RedisConnection ¶
type RedisConnection struct {
// contains filtered or unexported fields
}
func (*RedisConnection) Close ¶
func (rc *RedisConnection) Close() error
func (*RedisConnection) IsRepositoryAlreadyTweeted ¶
func (rc *RedisConnection) IsRepositoryAlreadyTweeted(projectName string) (bool, error)
IsRepositoryAlreadyTweeted checks if a project was already tweeted. If it is not available
a) the project was not tweeted yet b) the project ttl expired and is ready to tweet again
func (*RedisConnection) MarkRepositoryAsTweeted ¶
func (rc *RedisConnection) MarkRepositoryAsTweeted(projectName, score string) (bool, error)
MarkRepositoryAsTweeted marks a single projects as "already tweeted". This information will be stored in Redis as a simple set with a TTL. The timestamp of the tweet will be used as value.
type RedisPool ¶
type RedisPool struct {
// contains filtered or unexported fields
}
func (RedisPool) Get ¶
func (rp RedisPool) Get() Connection
type RedisStorage ¶
type RedisStorage struct{}
func (*RedisStorage) NewPool ¶
func (rs *RedisStorage) NewPool(url, auth string) Pool
Click to show internal directories.
Click to hide internal directories.