discoveryhandler

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Authorization authhandler.Config

	// BasePath is the base context path of the REST endpoint
	BasePath string
}

Config defines the configuration for a blockchain handler

type Discover

type Discover struct {
	Config
	// contains filtered or unexported fields
}

Discover is a handler that returns available service endpoints

func New

func New(channelID string, cfg Config, servicesProvider servicesProvider) *Discover

New returns a new discovery handler

func (*Discover) Handler

func (h *Discover) Handler() common.HTTPRequestHandler

Handler returns the request handler

func (*Discover) Method

func (h *Discover) Method() string

Method returns the HTTP method

func (*Discover) Path

func (h *Discover) Path() string

Path returns the context path

type Filter

type Filter func(s discovery.Service) bool

Filter is a discovery service filter

func ByAPIVersion

func ByAPIVersion(values ...string) Filter

ByAPIVersion is a service filter that returns true only if the service has the given API version

func ByDomain

func ByDomain(values ...string) Filter

ByDomain is a service filter that returns true only if the service has the given domain

func ByMethod

func ByMethod(values ...string) Filter

ByMethod is a service filter that returns true only if the service has the given HTTP method

func ByPath

func ByPath(values ...string) Filter

ByPath is a service filter that returns true only if the service has the given path

func ByService

func ByService(values ...string) Filter

ByService is a service filter that returns true only if the service has the given name

type Filters

type Filters []Filter

Filters is a slice of filters

func (Filters) Accept

func (fltrs Filters) Accept(s discovery.Service) bool

Accept returns true if the given service should be included

type Services

type Services []discovery.Service

Services is a slice of discovery services

func (Services) FilterByParams

func (s Services) FilterByParams(params map[string][]string) Services

FilterByParams removes services from the slice according to the given set of filter params

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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