message

package module
v0.0.0-...-038b669 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: MIT Imports: 6 Imported by: 0

README

mpi-ipfs/messagestore

standard-readme compliant

Info

Stores incoming messages and handle message request.

WARNING : Development in progress, might contain bug

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Install

func Install(path string) error

func ListFromString

func ListFromString(str string) (string, []string)

func ListToString

func ListToString(host string, peers []string) string

Types

type Handler

type Handler struct {
	Send *func(Message) error
	List *func(string) (string, []string, error)
}

func (*Handler) MessageStore

func (h *Handler) MessageStore(Sender func(string) error) *MessageStore

type Message

type Message struct {
	Pid    int
	File   string
	Origin string
	From   string
	To     string
	Data   []byte
}

func FromString

func FromString(msg string) (*Message, error)

func (*Message) String

func (m *Message) String() string

type MessageStore

type MessageStore struct {
	Store   *map[string]chan []byte
	Handler *Handler
	Sender  func(string) error
}

func (*MessageStore) Add

func (m *MessageStore) Add(msg Message)

func (*MessageStore) Manage

func (m *MessageStore) Manage(msg string) error

func (*MessageStore) Read

func (m *MessageStore) Read(From string) []byte

Jump to

Keyboard shortcuts

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