mux

package
v0.0.0-...-4887a92 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package mux provides support to bind domain level routes to the application mux.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WebAPI

func WebAPI(cfg Config, routeAdder RouteAdder, options ...func(opts *Options)) http.Handler

WebAPI constructs a http.Handler with all application routes bound.

func WithCORS

func WithCORS(origins []string) func(opts *Options)

WithCORS provides configuration options for CORS.

Types

type BusDomain

type BusDomain struct {
	Delegate *delegate.Delegate
	User     *userbus.Core
}

BusDomain represents the set of core business packages.

type Config

type Config struct {
	Build     string
	Log       *logger.Logger
	Auth      *auth.Auth
	DB        *sqlx.DB
	Tracer    trace.Tracer
	BusDomain BusDomain
}

Config contains all the mandatory systems required by handlers.

type Options

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

Options represent optional parameters.

type RouteAdder

type RouteAdder interface {
	Add(app *web.App, cfg Config)
}

RouteAdder defines behavior that sets the routes to bind for an instance of the service.

Jump to

Keyboard shortcuts

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