example

package
v0.0.0-...-f2a9e3e Latest Latest
Warning

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

Go to latest
Published: May 3, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NatsPublish

func NatsPublish(subj string, msg string, reply *string) bool

func NatsSubscribe

func NatsSubscribe(subj string, cb func(ctx context.Context, msg *nats.Msg) bool)

func SendHttpNoop

func SendHttpNoop(s1, s2, s3, s4 *Service, triggerAll bool)

SendHttpNoop sends http to individually trigger each service in order

func SetNoop

func SetNoop(as bool)

func Setup

func Setup() (*Service, *Service, *Service, *Service)

func TriggerAsync

func TriggerAsync(s1, s2, s3, s4 *Service)

Types

type Service

type Service struct {
	Name  string `json:"name"`
	Stage int    `json:"subj"`
	Port  string
}

func New

func New(name string, port string, stage int) *Service

func (*Service) GenericMethod

func (s *Service) GenericMethod(ctx context.Context, msg *nats.Msg) bool

GenericMethod is any generic async method in a request pipeline It would normally be triggered by nats/kafka. After processing this method would ideally publish to nats/kafka to trigger the next service/stage of the request pipeline

Noop-Testing: Before the final publish operation ->

- add publish `msg` to the context - return if ctx is noop, otherwise publish `msg` to queue

func (*Service) TriggerAsyncFromHttp

func (s *Service) TriggerAsyncFromHttp(c *gin.Context)

type SubCb

type SubCb func()

Jump to

Keyboard shortcuts

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