common

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

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

Constants

View Source
const (
	RegistryServiceRendezvousString string = "registry-service"

	AddProtocolID    protocol.ID = "/add/0.1"
	GetProtocolID    protocol.ID = "/get/0.1"
	ListProtocolID   protocol.ID = "/list/0.1"
	DeleteProtocolID protocol.ID = "/delete/0.1"
)

Variables

This section is empty.

Functions

func SendRequest

func SendRequest(
	bootstraps []multiaddr.Multiaddr, psk pnet.PSK, protocolID protocol.ID, request []byte) (
	response []byte, err error)

Send request to registry-service, creating temporary libp2p node

func SendRequestWithHostRouting

func SendRequestWithHostRouting(
	ctx context.Context, host host.Host, routingDiscovery *discovery.RoutingDiscovery,
	protocolID protocol.ID, request []byte) (response []byte, err error)

Send request to registry-service, without creating temporary libp2p node

Types

type AddRequest

type AddRequest struct {
	Name    string
	InfoStr string
}

type GetResponse

type GetResponse struct {
	InfoStr  string
	LookupOk bool
}

type ListResponse

type ListResponse struct {
	NameToInfoStr map[string]string
	LookupOk      bool
}

Jump to

Keyboard shortcuts

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