agent

package module
v0.0.0-...-456ab37 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2022 License: MIT Imports: 3 Imported by: 0

README

agent - multi-agent system for go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent interface {
	Start() error
	GetAddress() string
	MessageHandler(Event) error
}

type Event

type Event = light.Event

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager() Manager

func (*Manager) RegisterAgent

func (m *Manager) RegisterAgent(agent Agent)

func (*Manager) SendMessage

func (m *Manager) SendMessage(message Message) error

func (*Manager) Start

func (m *Manager) Start()

type Message

type Message struct {
	FromAddr string
	ToAddr   string
	Message  string
	Type     MessageType
	Data     map[string]interface{}
}

func GetMessage

func GetMessage(event Event) Message

type MessageHandler

type MessageHandler light.EventHandler

type MessageType

type MessageType int
const (
	Request MessageType = iota
	Response
	CTF
	Propose
	AcceptProposal
)

Jump to

Keyboard shortcuts

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