mux

package
v0.0.0-...-7774a9f Latest Latest
Warning

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

Go to latest
Published: Dec 14, 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.

func WithFileServer

func WithFileServer(react bool, static embed.FS, dir string, path string) func(opts *Options)

WithFileServer provides configuration options for file server.

Types

type AuthConfig

type AuthConfig struct {
	Auth *auth.Auth
}

AuthConfig contains auth service specific config.

type Config

type Config struct {
	Build  string
	Log    *logger.Logger
	DB     *sqlx.DB
	Tracer trace.Tracer
	SalesConfig
	AuthConfig
}

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.

type SalesConfig

type SalesConfig struct {
	AuthClient *authclient.Client
}

SalesConfig contains sales service specific config.

type StaticSite

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

StaticSite represents a static site to run.

Jump to

Keyboard shortcuts

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