utils

package
v0.0.0-...-3dee01c Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Overview

Package utils implements some common functionalities for channel

Index

Constants

View Source
const (
	DefaultFileChannelPath = "channels"
)

Variables

View Source
var (
	TestAddress string = message.DefaultIPCPrefix + message.DefaultCoreAgentChannel + "testPipe"

	ErrorListenDial = "invoke listen or dial before this call"
)

Functions

func GetDefaultChannelPath

func GetDefaultChannelPath(identity identity.IAgentIdentity, fileAddress string) (string, error)

GetDefaultChannelPath returns channel path

func IsDefaultChannelPresent

func IsDefaultChannelPresent(identity identity.IAgentIdentity) bool

IsDefaultChannelPresent verifies whether the channel directory is present or not

Types

type IFileChannelCommProtocol

type IFileChannelCommProtocol interface {
	Initialize()
	Send(message *message.Message) error
	Close() error
	Recv() ([]byte, error)
	SetOption(name string, value interface{}) error
	Listen(addr string) error
	Dial(addr string) error
	GetCommProtocolInfo() SocketType
}

IFileChannelCommProtocol interface is for implementing communication protocols

type SocketType

type SocketType string
const (
	Surveyor   SocketType = "surveyor"
	Respondent SocketType = "respondent"
)

Jump to

Keyboard shortcuts

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