eventsink

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package eventsink implements the eventsink.example microservice.

The event sink microservice handles events that are fired by the event source microservice.

Index

Constants

View Source
const Hostname = "eventsink.example"

Hostname is the default hostname of the microservice: eventsink.example.

View Source
const SourceCodeSHA256 = "95754f45a31b9b46334a328a0948c1de1e6bcf3fa50651cc4684613d7bd06983"
View Source
const Timestamp = "2024-08-01T15:49:26.992238Z"
View Source
const Version = 199

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

type Mock = intermediate.Mock

Mock is a mockable version of the eventsink.example microservice, allowing functions, event sinks and web handlers to be mocked.

func NewMock

func NewMock() *Mock

New creates a new mockable version of the microservice.

type Service

type Service struct {
	*intermediate.Intermediate // DO NOT REMOVE
}

Service implements the eventsink.example microservice.

The event sink microservice handles events that are fired by the event source microservice.

func NewService

func NewService() *Service

NewService creates a new eventsink.example microservice.

func (*Service) Init

func (svc *Service) Init(initializer func(svc *Service)) *Service

Init enables a single-statement pattern for initializing the microservice.

svc.Init(func(svc Service) {
	svc.SetGreeting("Hello")
})

func (*Service) OnAllowRegister

func (svc *Service) OnAllowRegister(ctx context.Context, email string) (allow bool, err error)

OnAllowRegister blocks registrations from certain email providers as well as duplicate registrations.

func (*Service) OnRegistered

func (svc *Service) OnRegistered(ctx context.Context, email string) (err error)

OnRegistered keeps track of registrations.

func (*Service) OnShutdown

func (svc *Service) OnShutdown(ctx context.Context) (err error)

OnShutdown is called when the microservice is shut down.

func (*Service) OnStartup

func (svc *Service) OnStartup(ctx context.Context) (err error)

OnStartup is called when the microservice is started up.

func (*Service) Registered

func (svc *Service) Registered(ctx context.Context) (emails []string, err error)

Registered returns the list of registered users.

Directories

Path Synopsis
app
Package eventsinkapi implements the public API of the eventsink.example microservice, including clients and data structures.
Package eventsinkapi implements the public API of the eventsink.example microservice, including clients and data structures.
Package intermediate serves as the foundation of the eventsink.example microservice.
Package intermediate serves as the foundation of the eventsink.example microservice.

Jump to

Keyboard shortcuts

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