mux

package
v0.0.0-...-53b8cb7 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 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 Config

type Config struct {
	Build          string
	Shutdown       chan os.Signal
	Log            *logger.Logger
	Auth           *auth.Auth
	Converter      *currency.Converter
	Bank           *bank.Bank
	DB             *sqlx.DB
	AnteUSD        float64
	ActiveKID      string
	BankTimeout    time.Duration
	ConnectTimeout time.Duration
}

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