web

package
v3.10.12 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: Apache-2.0 Imports: 38 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.

Documentation

Overview

Package web is a web dashboard

Index

Constants

This section is empty.

Variables

View Source
var (
	Name                  = "web"
	Address               = ":8082"
	Namespace             = "micro"
	Resolver              = "path"
	LoginURL              = "/login"
	ACMEProvider          = "autocert"
	ACMEChallengeProvider = "cloudflare"
	ACMECA                = acme.LetsEncryptProductionCA

	// Host name the web dashboard is served on
	Host, _ = os.Hostname()
	// Token cookie name
	TokenCookieName = "micro-token"
)

Meta Fields of micro web

View Source
var (
	Flags = []cli.Flag{
		&cli.StringFlag{
			Name:    "web_address",
			Usage:   "Set the web UI address e.g 0.0.0.0:8082",
			EnvVars: []string{"MICRO_WEB_ADDRESS"},
		},
		&cli.StringFlag{
			Name:    "namespace",
			Usage:   "Set the namespace used by the Web proxy e.g. com.example.web",
			EnvVars: []string{"MICRO_WEB_NAMESPACE"},
		},
		&cli.StringFlag{
			Name:    "resolver",
			Usage:   "Set the resolver to route to services e.g path, domain",
			EnvVars: []string{"MICRO_WEB_RESOLVER"},
		},
		&cli.StringFlag{
			Name:    "login_url",
			EnvVars: []string{"MICRO_WEB_LOGIN_URL"},
			Usage:   "The relative URL where a user can login",
		},
	}
)

Functions

func NewRPCHandler

func NewRPCHandler(r resolver.Resolver, c client.Client) handler.Handler

NewRPCHandler returns an initialized RPC handler

func Run

func Run(ctx *cli.Context) error

Types

type WebResolver

type WebResolver struct {
	// Options
	Options resolver.Options
	// selector to choose from a pool of nodes
	// Selector selector.Selector
	// router to lookup routes
	Router router.Router
}

func (*WebResolver) Resolve

func (r *WebResolver) Resolve(req *http.Request, opts ...res.ResolveOption) (*res.Endpoint, error)

Resolve replaces the values of Host, Path, Scheme to calla backend service It accounts for subdomains for service names based on namespace

func (*WebResolver) String

func (r *WebResolver) String() string

Jump to

Keyboard shortcuts

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