provider

package
v0.0.0-...-6e5bb36 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IProvider

type IProvider interface {
	// Log is used for printing the Log.
	// It returns any errors written.
	Log(job *work.Job, next work.NextMiddlewareFunc) error

	// Export is used for Checkins the queue.
	// It returns any errors written.
	Export(job *work.Job) error

	// DoSendNotification is used for sending notifications with Onesignal.
	// It returns any errors written.
	DoSendNotification(job *work.Job) (err error)

	// Hcheck is used for checking health of redis connection.
	// It returns any errors written.
	Hcheck(job *work.Job) (err error)
}

IProvider is an interface that stores the methods that Provider struct will use.

func New

func New(opts ...Option) IProvider

New it returns instance of Provider that implements IProvider methods.

type Option

type Option func(provider *Provider)

Option ...

func WithConfig

func WithConfig(config config.IConfig) Option

WithConfig ...

func WithJob

func WithJob(job job.IJob) Option

WithJob ...

func WithPkg

func WithPkg(pkg pkg.IPkg) Option

WithPkg ...

func WithRedis

func WithRedis(redis *redis.Pool) Option

WithRedis ...

func WithRepo

func WithRepo(repo repo.IRepo) Option

WithRepo ...

func WithUseCase

func WithUseCase(usecase usecase.IUseCase) Option

WithUseCase ...

type Provider

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

Provider is an struct that implements IProvider methods.

func (*Provider) DoSendNotification

func (provider *Provider) DoSendNotification(job *work.Job) (err error)

DoSendNotification is used for sending notifications with Onesignal. It returns any errors written.

func (*Provider) Export

func (provider *Provider) Export(job *work.Job) error

Export is used for Checkins the queue. It returns any errors written.

func (*Provider) Hcheck

func (provider *Provider) Hcheck(job *work.Job) (err error)

Hcheck is used for checking health of redis connection. It returns any errors written.

func (*Provider) Log

func (provider *Provider) Log(job *work.Job, next work.NextMiddlewareFunc) error

Log is used for printing the Log. It returns any errors written.

Jump to

Keyboard shortcuts

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