discovery

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Discovery

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

Discovery is a service that discovers all service endpoints in a consortium of peers

func New

func New(handlerRegistry appDataHandlerRegistry, gossipProvider gossipProvider, peerCfg peerConfig, discoveryCfg discoveryConfig) *Discovery

New returns a discovery service

func (*Discovery) ServicesForChannel

func (d *Discovery) ServicesForChannel(channelID string) []Service

ServicesForChannel returns all services available on the given channel

func (*Discovery) UpdateLocalServicesForChannel

func (d *Discovery) UpdateLocalServicesForChannel(channelID string, services []Service)

UpdateLocalServicesForChannel updates the cache of services for the local peer

type Endpoint

type Endpoint struct {
	Path   string `json:"path,omitempty"`
	Method string `json:"method"`
}

Endpoint contains the path and HTTP method of the REST endpoint

func NewEndpoint

func NewEndpoint(path, method string) Endpoint

NewEndpoint returns a new Endpoint

type Service

type Service struct {
	Service      string     `json:"service"`
	APIVersion   string     `json:"apiVersion,omitempty"`
	Domain       string     `json:"domain"`
	RootEndpoint string     `json:"rootEndpoint"`
	Endpoints    []Endpoint `json:"endpoints"`
}

Service contains information about one or more endpoints for a service

func NewService

func NewService(name, apiVersion, domain, rootEndpoint string, endpoints ...Endpoint) Service

NewService returns a new Service

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