go-micro: github.com/micro/go-micro/api/router Index | Files | Directories

package router

import "github.com/micro/go-micro/api/router"

Package router provides api service routing

Index

Package Files

options.go router.go

type Option Uses

type Option func(o *Options)

func WithHandler Uses

func WithHandler(h string) Option

func WithNamespace Uses

func WithNamespace(ns string) Option

func WithRegistry Uses

func WithRegistry(r registry.Registry) Option

func WithResolver Uses

func WithResolver(r resolver.Resolver) Option

type Options Uses

type Options struct {
    Namespace string
    Handler   string
    Registry  registry.Registry
    Resolver  resolver.Resolver
}

func NewOptions Uses

func NewOptions(opts ...Option) Options

type Router Uses

type Router interface {
    // Returns options
    Options() Options
    // Stop the router
    Close() error
    // Endpoint returns an api.Service endpoint or an error if it does not exist
    Endpoint(r *http.Request) (*api.Service, error)
    // Route returns an api.Service route
    Route(r *http.Request) (*api.Service, error)
}

Router is used to determine an endpoint for a request

Directories

PathSynopsis
registryPackage registry provides a dynamic api service router

Package router imports 5 packages (graph) and is imported by 16 packages. Updated 2020-01-30. Refresh now. Tools for package owners.