registry

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2020 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Overview

Copyright 2020 PhysarumSM Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddService

func AddService(bootstraps []multiaddr.Multiaddr, psk pnet.PSK, serviceName string, info ServiceInfo) (
	addResponse string, err error)

Add service info {serviceName, info} to registry-service

func AddServiceWithHostRouting

func AddServiceWithHostRouting(
	ctx context.Context, host host.Host, routingDiscovery *discovery.RoutingDiscovery,
	serviceName string, info ServiceInfo) (addResponse string, err error)

func DeleteService

func DeleteService(bootstraps []multiaddr.Multiaddr, psk pnet.PSK, serviceName string) (
	deleteResponse string, err error)

Delete service with given serviceName from registry-service

func DeleteServiceWithHostRouting

func DeleteServiceWithHostRouting(
	ctx context.Context, host host.Host, routingDiscovery *discovery.RoutingDiscovery, serviceName string) (
	deleteResponse string, err error)

func ListServices

func ListServices(bootstraps []multiaddr.Multiaddr, psk pnet.PSK) (
	nameToInfo map[string]ServiceInfo, err error)

List all services added to registry-service Returns mapping from service name to service info

func ListServicesWithHostRouting

func ListServicesWithHostRouting(
	ctx context.Context, host host.Host, routingDiscovery *discovery.RoutingDiscovery) (
	nameToInfo map[string]ServiceInfo, err error)

Types

type ServiceInfo

type ServiceInfo struct {
	ContentHash    string
	DockerHash     string
	NetworkSoftReq p2putil.PerfInd
	NetworkHardReq p2putil.PerfInd
	CpuReq         int
	MemoryReq      int
}

Microservice info stored by registry-service Encoding/decoding of this struct is done client-side Registry-service simply stores the string it is given

func GetService

func GetService(bootstraps []multiaddr.Multiaddr, psk pnet.PSK, query string) (
	info ServiceInfo, err error)

Get service info from registry-service by searching for service with a name matching the given query

func GetServiceWithHostRouting

func GetServiceWithHostRouting(
	ctx context.Context, host host.Host, routingDiscovery *discovery.RoutingDiscovery, query string) (
	info ServiceInfo, err error)

Jump to

Keyboard shortcuts

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