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

package resolver

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

Package resolver resolves a http request to an endpoint

Index

Package Files

options.go resolver.go

type Endpoint Uses

type Endpoint struct {
    // e.g greeter
    Name string
    // HTTP Host e.g example.com
    Host string
    // HTTP Methods e.g GET, POST
    Method string
    // HTTP Path e.g /greeter.
    Path string
}

Endpoint is the endpoint for a http request

type Option Uses

type Option func(o *Options)

func WithHandler Uses

func WithHandler(h string) Option

WithHandler sets the handler being used

func WithNamespace Uses

func WithNamespace(n string) Option

WithNamespace sets the namespace being used

type Options Uses

type Options struct {
    Handler   string
    Namespace string
}

func NewOptions Uses

func NewOptions(opts ...Option) Options

NewOptions returns new initialised options

type Resolver Uses

type Resolver interface {
    Resolve(r *http.Request) (*Endpoint, error)
    String() string
}

Resolver resolves requests to endpoints

Directories

PathSynopsis
grpcPackage grpc resolves a grpc service like /greeter.Say/Hello to greeter service
hostPackage host resolves using http host
microPackage micro provides a micro rpc resolver which prefixes a namespace
pathPackage path resolves using http path
vpathPackage vpath resolves using http path and recognised versioned urls

Package resolver imports 1 packages (graph) and is imported by 38 packages. Updated 2020-01-30. Refresh now. Tools for package owners.