utils

package
v0.0.0-...-d9814f8 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const OrderExpiredNSQTitle = "order-expired"

OrderExpiredNSQTitle NSQ consumer title

Variables

This section is empty.

Functions

func AllEnvVarsExists

func AllEnvVarsExists(vars []string) error

AllEnvVarsExists retrieve nill if all specified variables exists in environment otherwise fulfill error

func CloseNATSConnectionOnForceStop

func CloseNATSConnectionOnForceStop(sc stan.Conn)

CloseNATSConnectionOnForceStop Invoke NATS connection.close on Force stop signals

func GetAckWaitDuration

func GetAckWaitDuration() time.Duration

GetAckWaitDuration Retrive duration from NATS_ACK_WAIT_DURATION environment variable or default '5s' value

func NewOrderExpiredNSQConsumer

func NewOrderExpiredNSQConsumer() (*nsq.Consumer, error)

NewOrderExpiredNSQConsumer Retrive the NSQ consumer

func OnOrderCreatedStanEvent

func OnOrderCreatedStanEvent(sc stan.Conn, cb func(data OrderCreatedStanEventData, m *stan.Msg))

OnOrderCreatedStanEvent Invoke the callback function on associated stan event

Types

type OrderCreatedStanEventData

type OrderCreatedStanEventData struct {
	ID        string `json:"id"`
	ExpiresAt string `json:"expiresAt"`
}

OrderCreatedStanEventData Associated stan event data

type OrderExpiredStanEventData

type OrderExpiredStanEventData struct {
	ID string `json:"id"`
}

OrderExpiredStanEventData Associated stan event data

type OrderExpiredStanEventPublisher

type OrderExpiredStanEventPublisher interface {
	Publish(data OrderExpiredStanEventData)
}

OrderExpiredStanEventPublisher NATS publisher

func NewOrderExpiredStanEventPublisher

func NewOrderExpiredStanEventPublisher(sc stan.Conn) OrderExpiredStanEventPublisher

NewOrderExpiredStanEventPublisher Retrive NATS publisher

Jump to

Keyboard shortcuts

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