messaging

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package messaging implements the messaging.example microservice.

The Messaging microservice demonstrates service-to-service communication patterns.

Index

Constants

View Source
const Hostname = "messaging.example"

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

View Source
const SourceCodeSHA256 = "0e029965199e2005713eda5d993b096425d194889f0d346c30ee1657281486cd"
View Source
const Timestamp = "2025-07-12T16:29:56.141064Z"
View Source
const Version = 204

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

type Mock = intermediate.Mock

Mock is a mockable version of the messaging.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 messaging.example microservice.

The Messaging microservice demonstrates service-to-service communication patterns.

func NewService

func NewService() *Service

NewService creates a new messaging.example microservice.

func (*Service) CacheLoad

func (svc *Service) CacheLoad(w http.ResponseWriter, r *http.Request) (err error)

CacheLoad looks up an element in the distributed cache of the microservice.

func (*Service) CacheStore

func (svc *Service) CacheStore(w http.ResponseWriter, r *http.Request) (err error)

CacheStore stores an element in the distributed cache of the microservice.

func (*Service) DefaultQueue

func (svc *Service) DefaultQueue(w http.ResponseWriter, r *http.Request) (err error)

DefaultQueue demonstrates how the DefaultQueue subscription option is used to create a unicast request/response communication pattern. Only one of the instances of this microservice will respond to each request.

func (*Service) Home

func (svc *Service) Home(w http.ResponseWriter, r *http.Request) (err error)

Home demonstrates making requests using multicast and unicast request/response patterns.

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) NoQueue

func (svc *Service) NoQueue(w http.ResponseWriter, r *http.Request) (err error)

NoQueue demonstrates how the NoQueue subscription option is used to create a multicast request/response communication pattern. All instances of this microservice will respond to each request.

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.

Directories

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

Jump to

Keyboard shortcuts

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