http

package
v0.0.0-...-bc1f52c Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithConfig

func WithConfig(cfg config.API) func(*EndPoint)

WithConfig offer the possibility to set a config to the endpoint adapter.

func WithEvents

func WithEvents(evt *event.Event) func(*EndPoint)

WithEvents offer the possibility to set an event adapter to the endpoint adapter.

func WithLogs

func WithLogs(logs *zap.Logger) func(*EndPoint)

WithLogs offer the possibility to set a logger to the endpoint adapter.

func WithMetrics

func WithMetrics(m *metrics.Metrics) func(*EndPoint)

WithMetrics offer the possibility to set a metric adapter to the endpoint adapter.

func WithPersistence

func WithPersistence(p persistenceadapter.Adapter) func(*EndPoint)

WithPersistence offer the possibility to set a persistence adapter to the endpoint adapter.

func WithTransactions

func WithTransactions(t transaction.Adapter) func(*EndPoint)

WithTransactions offer the possibility to set a transactions adapter to the endpoint adapter.

func WithUserAddress

func WithUserAddress(a string) func(*EndPoint)

WithUserAddress offer the possibility to set an user address adapter to the endpoint adapter.

func WithWallets

func WithWallets(w wallet.IWallets) func(*EndPoint)

WithWallets offer the possibility to set a wallet adapter to the endpoint adapter.

Types

type BodyReceived

type BodyReceived interface{}

type EndPoint

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

EndPoint represent a HTTP endpoint adapter.

func New

func New(options ...func(*EndPoint)) *EndPoint

New define a new HTTP endpoint adapter.

func (*EndPoint) Handle

func (e *EndPoint) Handle(err error)

func (*EndPoint) IsEnabled

func (e *EndPoint) IsEnabled() bool

IsEnabled define if we enable HTTP endpoint adapter.

func (*EndPoint) JSON

func (e *EndPoint) JSON(w http.ResponseWriter, code int, payload interface{})

func (*EndPoint) Listen

func (e *EndPoint) Listen() error

Listen

func (*EndPoint) MetricsMiddleware

func (e *EndPoint) MetricsMiddleware(next http.Handler) http.Handler

MetricsMiddleware set a metrics middleware for HTTP endpoints.

func (*EndPoint) Shutdown

func (e *EndPoint) Shutdown(ctx context.Context)

Shutdown the HTTP server.

Jump to

Keyboard shortcuts

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