storages

package
v1.127.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func (*DB) ByDate

func (s *DB) ByDate(from, to time.Time) ([]models.Incident, error)

func (*DB) Create

func (s *DB) Create(incident models.Incident) (models.Incident, error)

func (*DB) Creator

func (s *DB) Creator() func(u *url.URL) (Store, error)

func (*DB) Delete

func (s *DB) Delete(guid string) error

func (*DB) Detect

func (s *DB) Detect(u *url.URL) bool

func (*DB) GetDb

func (s *DB) GetDb() *gorm.DB

func (*DB) Persistents added in v1.6.1

func (s *DB) Persistents() ([]models.Incident, error)

func (*DB) Ping

func (s *DB) Ping() error

func (*DB) Read

func (s *DB) Read(guid string) (models.Incident, error)

func (*DB) Subscribe

func (s *DB) Subscribe(email string) error

func (*DB) Subscribers

func (s *DB) Subscribers() ([]string, error)

func (*DB) Unsubscribe

func (s *DB) Unsubscribe(email string) error

func (*DB) Update

func (s *DB) Update(guid string, incident models.Incident) (models.Incident, error)

type Local

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

func (*Local) ByDate

func (l *Local) ByDate(from, to time.Time) ([]models.Incident, error)

func (*Local) Create

func (l *Local) Create(incident models.Incident) (models.Incident, error)

func (*Local) Creator

func (l *Local) Creator() func(u *url.URL) (Store, error)

func (*Local) Delete

func (l *Local) Delete(guid string) error

func (*Local) Detect

func (l *Local) Detect(u *url.URL) bool

func (*Local) Persistents added in v1.6.1

func (l *Local) Persistents() ([]models.Incident, error)

func (*Local) Ping

func (l *Local) Ping() error

func (*Local) Read

func (l *Local) Read(guid string) (models.Incident, error)

func (*Local) Subscribe

func (l *Local) Subscribe(email string) error

func (*Local) Subscribers

func (l *Local) Subscribers() ([]string, error)

func (*Local) Unsubscribe

func (l *Local) Unsubscribe(email string) error

func (*Local) Update

func (l *Local) Update(guid string, incident models.Incident) (models.Incident, error)

type Replicate

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

func NewReplicate

func NewReplicate(storesInit []Store) *Replicate

func NewReplicateWithWaits

func NewReplicateWithWaits(storesInit []Store, waitReplay, waitClean time.Duration) *Replicate

func (*Replicate) ByDate

func (m *Replicate) ByDate(from, to time.Time) ([]models.Incident, error)

func (*Replicate) Create

func (m *Replicate) Create(incident models.Incident) (models.Incident, error)

func (*Replicate) Creator

func (m *Replicate) Creator() func(u *url.URL) (Store, error)

func (*Replicate) Delete

func (m *Replicate) Delete(guid string) error

func (*Replicate) Detect

func (m *Replicate) Detect(u *url.URL) bool

func (*Replicate) Persistents added in v1.6.1

func (m *Replicate) Persistents() ([]models.Incident, error)

func (*Replicate) Ping

func (m *Replicate) Ping() error

func (*Replicate) Read

func (m *Replicate) Read(guid string) (models.Incident, error)

func (*Replicate) Subscribe

func (m *Replicate) Subscribe(email string) error

func (*Replicate) Subscribers

func (m *Replicate) Subscribers() ([]string, error)

func (*Replicate) Unsubscribe

func (m *Replicate) Unsubscribe(email string) error

func (*Replicate) Update

func (m *Replicate) Update(guid string, incident models.Incident) (models.Incident, error)

type Retry

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

func NewRetry

func NewRetry(next Store, nbRetry int) *Retry

func NewRetryWithSleepTime

func NewRetryWithSleepTime(next Store, nbRetry int, sleepTime time.Duration) *Retry

func (*Retry) ByDate

func (m *Retry) ByDate(from, to time.Time) ([]models.Incident, error)

func (*Retry) Create

func (m *Retry) Create(incident models.Incident) (models.Incident, error)

func (*Retry) Creator

func (m *Retry) Creator() func(u *url.URL) (Store, error)

func (*Retry) Delete

func (m *Retry) Delete(guid string) error

func (*Retry) Detect

func (m *Retry) Detect(u *url.URL) bool

func (*Retry) Persistents added in v1.6.1

func (m *Retry) Persistents() ([]models.Incident, error)

func (*Retry) Ping

func (m *Retry) Ping() error

func (*Retry) Read

func (m *Retry) Read(guid string) (models.Incident, error)

func (*Retry) Subscribe

func (m *Retry) Subscribe(email string) error

func (*Retry) Subscribers

func (m *Retry) Subscribers() ([]string, error)

func (*Retry) Unsubscribe

func (m *Retry) Unsubscribe(email string) error

func (*Retry) Update

func (m *Retry) Update(guid string, incident models.Incident) (models.Incident, error)

type S3

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

func (*S3) ByDate

func (s *S3) ByDate(from, to time.Time) ([]models.Incident, error)

func (*S3) Create

func (s *S3) Create(incident models.Incident) (models.Incident, error)

func (*S3) Creator

func (s *S3) Creator() func(u *url.URL) (Store, error)

func (*S3) Delete

func (s *S3) Delete(guid string) error

func (*S3) Detect

func (s *S3) Detect(u *url.URL) bool

func (*S3) Persistents added in v1.6.1

func (s *S3) Persistents() ([]models.Incident, error)

func (*S3) Ping

func (s *S3) Ping() error

func (*S3) Read

func (s *S3) Read(guid string) (models.Incident, error)

func (*S3) Subscribe

func (s *S3) Subscribe(email string) error

func (*S3) Subscribers

func (s *S3) Subscribers() ([]string, error)

func (*S3) Unsubscribe

func (s *S3) Unsubscribe(email string) error

func (*S3) Update

func (s *S3) Update(guid string, incident models.Incident) (models.Incident, error)

type Store

type Store interface {
	Creator() func(u *url.URL) (Store, error)
	Detect(u *url.URL) bool

	Create(incident models.Incident) (models.Incident, error)
	Update(guid string, incident models.Incident) (models.Incident, error)
	Delete(guid string) error
	Read(guid string) (models.Incident, error)
	ByDate(from, to time.Time) ([]models.Incident, error)
	Persistents() ([]models.Incident, error)

	Subscribe(email string) error
	Unsubscribe(email string) error
	Subscribers() ([]string, error)

	Ping() error
}

func Factory

func Factory(urls []*url.URL) (Store, error)

type Subscriber

type Subscriber struct {
	Email string `gorm:"primary_key"`
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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