distributed

package
v0.0.0-...-fa9e147 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NEED_CONTENT_BROADCAST_TOPIC             = "need-content-broadcast-topic"
	IMAGE_TRANSFER_PROTOCOL      protocol.ID = "/permit-image-transfer/0.0.1"
	KEY_TRANSFER_PROTOCOL        protocol.ID = "/veracy-key-transfer/0.0.1"
	NETWORK_TIMEOUT                          = 5 * time.Second
)
View Source
const INBOX_PROTOCOL = "/inbox/1.0.0"
View Source
const INBOX_TOPIC = "inbox-messages"
View Source
const MESSAGE_TIMEOUT = 10 * time.Second

Variables

View Source
var (
	Node *ContentNode

	// Dynamic Topics
	GroupBroadcastTopic string
)

Functions

func GroupUserByAddress

func GroupUserByAddress(address string) ([]byte, error)

func NeedById

func NeedById(id string) ([]byte, error)

func PublishInboxMessage

func PublishInboxMessage(user, sender, message string) (bool, error)

Types

type ChannelMap

type ChannelMap map[string][]chan []byte

type ContentNode

type ContentNode struct {
	Topics map[string]*pubsub.Topic
	// contains filtered or unexported fields
}

func Connect

func Connect(conf *config.AppConfig) *ContentNode

func NewNode

func NewNode(ctx context.Context, addr []string, bootstrap string) *ContentNode

func (*ContentNode) ID

func (node *ContentNode) ID() string

func (*ContentNode) Join

func (node *ContentNode) Join(s string) (*pubsub.Topic, error)

func (*ContentNode) PeerID

func (node *ContentNode) PeerID() peer.ID

Jump to

Keyboard shortcuts

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