notifier

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const TimeFormat = "2006-01-02T15:04:05Z"

TimeFormat is the format used to read time values from request parameters

Variables

View Source
var LastChangeLimit = time.Hour * 168

LastChangeLimit represents the upper limit to how far in the past we can reingest smartlogic updates

Functions

func WithTicker added in v1.6.0

func WithTicker(t Ticker) func(*Handler)

Types

type Handler

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

func NewNotifierHandler

func NewNotifierHandler(notifier Servicer, smartlogicModel string, log *logger.UPPLogger, opts ...func(*Handler)) *Handler

func (*Handler) HandleForceNotify

func (h *Handler) HandleForceNotify(resp http.ResponseWriter, req *http.Request)

func (*Handler) HandleGetConcept

func (h *Handler) HandleGetConcept(resp http.ResponseWriter, req *http.Request)

func (*Handler) HandleGetConcepts added in v1.8.0

func (h *Handler) HandleGetConcepts(resp http.ResponseWriter, req *http.Request)

func (*Handler) HandleNotify

func (h *Handler) HandleNotify(resp http.ResponseWriter, req *http.Request)

func (*Handler) RegisterEndpoints

func (h *Handler) RegisterEndpoints(router *mux.Router)

type HealthService

type HealthService struct {
	sync.RWMutex

	Checks []fthealth.Check
	// contains filtered or unexported fields
}

HealthService is responsible for gtg and health checks.

func NewHealthService

func NewHealthService(notifier Servicer, config *HealthServiceConfig, log *logger.UPPLogger) (*HealthService, error)

NewHealthService initialises the HealthCheck service but doesn't start the updating of the health check result.

func (*HealthService) GtgCheck

func (hs *HealthService) GtgCheck() gtg.StatusChecker

GtgCheck is responsible for __gtg endpoint.

func (*HealthService) HealthcheckHandler

func (hs *HealthService) HealthcheckHandler() fthealth.TimedHealthCheck

HealthcheckHandler is resposible for __health endpoint.

func (*HealthService) RegisterAdminEndpoints

func (hs *HealthService) RegisterAdminEndpoints(router *mux.Router) http.Handler

RegisterAdminEndpoints adds the admin endpoints to the given router

func (*HealthService) Start

func (hs *HealthService) Start()

Start starts separate go routine responsible for updating the cached result of the gtg/health check.

type HealthServiceConfig added in v1.9.1

type HealthServiceConfig struct {
	AppSystemCode          string
	AppName                string
	Description            string
	SmartlogicModel        string
	SmartlogicModelConcept string
	SuccessCacheTime       time.Duration
}

func (*HealthServiceConfig) Validate added in v1.9.1

func (c *HealthServiceConfig) Validate() error

type Service

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

func NewNotifierService

func NewNotifierService(producer messageProducer, slClient smartlogic.Clienter, log *logger.UPPLogger) *Service

func (*Service) CheckKafkaConnectivity

func (s *Service) CheckKafkaConnectivity() error

func (*Service) ForceNotify

func (s *Service) ForceNotify(UUIDs []string, transactionID string) error

func (*Service) GetChangedConceptList added in v1.8.0

func (s *Service) GetChangedConceptList(lastChange time.Time) (uuids []string, err error)

func (*Service) GetConcept

func (s *Service) GetConcept(uuid string) ([]byte, error)

func (*Service) Notify

func (s *Service) Notify(lastChange time.Time, transactionID string) error

type Servicer

type Servicer interface {
	GetConcept(uuid string) ([]byte, error)
	GetChangedConceptList(lastChange time.Time) ([]string, error)
	Notify(lastChange time.Time, transactionID string) error
	ForceNotify(UUIDs []string, transactionID string) error
	CheckKafkaConnectivity() error
}

type Ticker added in v1.6.0

type Ticker interface {
	Tick()
	Stop()
}

Jump to

Keyboard shortcuts

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