extdeps

package
v0.0.0-...-9008a76 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtServices

type ExtServices struct {
	MailSender mailer.Mailer
	SQL        db.SQLDB
	Composer   notifications.Composer
	Ins        *obs.Insighter
}

ExtServices holds thread-safe instances to make use of external services.

func (*ExtServices) Clone

func (ed *ExtServices) Clone() *ExtServices

Clone creates a shallow copy of the external services, except for the insighter one, that will execute a clone.

type ExternalServices

type ExternalServices struct {
	MailSender mailer.Mailer
	SQL        db.SQLDB
	Composer   notifications.Composer
	// contains filtered or unexported fields
}

ExternalServices holds references to services that could be needed to perform any operation and that must be configured at startup time, like and email sender, a sql db ...

func GetNopExternalServices

func GetNopExternalServices() ExternalServices

GetNopExternalServices creates No Op services: a mailer that does not sends emails, a notifier that does not send notifications, and an insighter that does not log, send metrics or traces. Useful for testing.

func NewExternalServices

func NewExternalServices(
	insighterBuilderFn obs.InsighterBuilderFn,
	insighterFlushFn func(),
	mailSender mailer.Mailer,
	sql db.SQLDB,
	composer notifications.Composer) *ExternalServices

NewExternalServices creates a new ExternalServices instance

func (*ExternalServices) ExtServices

func (es *ExternalServices) ExtServices() *ExtServices

ExtServices returns a new ExtServices to be used

func (*ExternalServices) Insighter

func (es *ExternalServices) Insighter() *obs.Insighter

Insighter returns an Insighter instance

func (*ExternalServices) Shutdown

func (es *ExternalServices) Shutdown()

Shutdown all the service references inside the ExternalServices

type ExternalServicesBuilderFn

type ExternalServicesBuilderFn func() *ExternalServices

ExternalServicesBuilderFn defines the signature for building a ExternalServices. Usually used to create new instances for each served request

Jump to

Keyboard shortcuts

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