http

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 Imports: 22 Imported by: 8

Documentation

Overview

Package http provides an http service entry point.

The http package's constructor is expected to be passed to a bootstrapper instance in order to be autoconfigured. A fully configured instance is ready to be used as a go-micro service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewService

func NewService(
	engine ServerEngine,
	client client.Client,
	registry registry.Registry,
	broker messaging.BrokerWithOptions,
	cache cache.Cache,
	tracer *oteltrace.TracerProvider,
	logger plog.Logger,
	serverConfig *config.ServerConfig,
	resilienceConfig *config.ResilienceConfig,
	corsConfig *config.CORSConfig,
	tracerConfig *config.TracerConfig,
) micro.Service

A micro.Service constructor. Called automatically by fx if provided to a bootstrapper instance.

Returns a fully configured and ready to use http based micro.Service. Panics on any error.

Types

type ServerEngine

type ServerEngine interface {
	ApplyMiddleware(middlewares ...func(http.Handler) http.Handler)
	NewHandler() interface {
		ServeHTTP(w http.ResponseWriter, req *http.Request)
	}
}

ServerEngine provides main ways of interactions with any http server implementation (gorilla, chi, gin and so on).

Jump to

Keyboard shortcuts

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