echo

package module
v4.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

GoZix Echo

License Documentation

Release Build Status Go Report Card Code Coverage

The bundle provide a Echo integration to GoZix application.

Installation

go get github.com/gozix/echo/v4

Dependencies

Configuration 3 or more servers

{
  "echo": {
    "admin": {
      "host": "0.0.0.0",
      "port": 8080,
      "level": "debug",
      "debug": false,
      "hide_banner": true,
      "hide_port": false 
    }, 
    "public": {
      "host": "0.0.0.0",
      "port": 8081,
      "static": {
        "prefix": "/",
        "root": ""
      },
      "level": "info",
      "debug": false,
      "hide_banner": true,
      "hide_port": false 
    },
    "private": {
      "port": 8082,
      "...": "..."
    },
    "...": {}
  }
}

Without server names the http-server command runs all servers from the echo config section:

gzEcho.NewBundle()

With server names the command runs only these servers and fails if any of them is not configured:

gzEcho.NewBundle("admin", "public", "private")

To get a server echo instance outside the http-server command, use the factory:

func NewRoutesCommand(f *gzEcho.Factory) *cobra.Command {
	// ...
	var e, err = f.Echo("admin")
	// ...
}

Documentation

You can find documentation on pkg.go.dev and read source code if needed.

Questions

If you have any questions, feel free to create an issue.

Documentation

Index

Constants

View Source
const BundleName = "echo"

BundleName is default definition name.

Variables

This section is empty.

Functions

func AsConfigurator

func AsConfigurator(srvName string) di.ProvideOption

AsConfigurator is syntax sugar for the di container.

func AsController

func AsController(srvName string) di.ProvideOption

AsController is syntax sugar for the di container.

func AsMiddleware

func AsMiddleware(srvName string, priority int64) di.ProvideOption

AsMiddleware is syntax sugar for the di container.

Types

type Bundle

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

Bundle implements the glue.Bundle interface.

func NewBundle

func NewBundle(svrNames ...string) *Bundle

NewBundle create bundle instance.

func (*Bundle) Build

func (b *Bundle) Build(builder di.Builder) error

Build implements the glue.Bundle interface.

func (*Bundle) DependsOn

func (b *Bundle) DependsOn() []string

DependsOn implements the glue.DependsOn interface.

func (*Bundle) Name

func (b *Bundle) Name() string

Name implements the glue.Bundle interface.

type Configurator

type Configurator = configurator.Configurator

Configurator is type alias of configurator.Configurator.

type Controller

type Controller = configurator.Controller

Controller is type alias of controller.Controller.

type Factory added in v4.1.0

type Factory = factory.Factory

Factory is type alias of factory.Factory.

Directories

Path Synopsis
internal
tag
Package mock provide dependency injection definitions.
Package mock provide dependency injection definitions.

Jump to

Keyboard shortcuts

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