status

package
v0.0.0-...-a078def Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisStatus

type RedisStatus struct {
	Redis   redis.Conn
	Counter int
}

func NewRedisStatus

func NewRedisStatus(r redis.Conn) RedisStatus

nolint: gofumpt

func (*RedisStatus) Flush

func (s *RedisStatus) Flush() []model.Status

func (*RedisStatus) Insert

func (s *RedisStatus) Insert(status model.Status)

type SQLStatus

type SQLStatus struct {
	DB *gorm.DB
}

func NewSQLStatus

func NewSQLStatus(d *gorm.DB) SQLStatus

func (SQLStatus) Create

func (m SQLStatus) Create()

Creates a table in the database that matches the status table and puts a trigger on it which deletes the rows that have expired after each insert.

func (SQLStatus) Insert

func (m SQLStatus) Insert(status model.Status) error

type Status

type Status interface {
	Insert(status model.Status) error
}

Jump to

Keyboard shortcuts

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