app

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPMetrics

func HTTPMetrics(appName string) echo.MiddlewareFunc

HTTPMetrics is the middleware function that logs duration of responses.

Types

type App

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

func New

func New(appName string, cfg Config, nc *nats.Conn) *App

func (*App) Run

func (a *App) Run() error

Run is a function that runs application.

func (*App) Shutdown

func (a *App) Shutdown(timeout time.Duration)

Shutdown is a function that gracefully stops HTTP server.

type Config

type Config struct {
	Server struct {
		Host string
		Port int
	}
	NATS struct {
		URL string
	}
	Settings struct {
		RpcServices []string
	}
}

type Message

type Message struct {
	Request zenrpc.Request `json:"request"`
	Header  http.Header    `json:"header"`
}

type QueueManager

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

func NewQueueManager

func NewQueueManager(js nats.JetStreamContext) *QueueManager

NewQueueManager returns new QueueManager.

func (*QueueManager) Publish

func (m *QueueManager) Publish(service string, zenrpcRequest zenrpc.Request, headers http.Header) error

Publish prepare and publish message to NATs.

Jump to

Keyboard shortcuts

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