Documentation ¶
Overview ¶
Copyright 2020 Multi-Tier-Cloud 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 ¶
- func AddService(bootstraps []multiaddr.Multiaddr, psk pnet.PSK, serviceName string, ...) (addResponse string, err error)
- func AddServiceWithHostRouting(ctx context.Context, host host.Host, ...) (addResponse string, err error)
- func DeleteService(bootstraps []multiaddr.Multiaddr, psk pnet.PSK, serviceName string) (deleteResponse string, err error)
- func DeleteServiceWithHostRouting(ctx context.Context, host host.Host, ...) (deleteResponse string, err error)
- func ListServices(bootstraps []multiaddr.Multiaddr, psk pnet.PSK) (nameToInfo map[string]ServiceInfo, err error)
- func ListServicesWithHostRouting(ctx context.Context, host host.Host, ...) (nameToInfo map[string]ServiceInfo, err error)
- type ServiceInfo
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 DeleteService ¶
func DeleteService(bootstraps []multiaddr.Multiaddr, psk pnet.PSK, serviceName string) ( deleteResponse string, err error)
Delete service with given serviceName from registry-service
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
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