Documentation ¶
Index ¶
- Constants
- func GetLogger() *logrus.Logger
- func IvyBindDirectMsg(cb IvyBindDirectCallback) error
- func IvyBindMsg(cb IvyBindCallback, re string) (int, error)
- func IvyInit(agentName, readyMsg string, mainLoop int, onCnxFunc, onDieFunc IvyAppCallback) error
- func IvyMainLoop() error
- func IvySendDirectMsg(agentId int, numId int, msg string) error
- func IvySendMsg(msg string) error
- func IvyStart(busId string) error
- func IvyStop() error
- func IvyUnbindMsg(subId int) (string, error)
- func SetLogger(w io.Writer, level logrus.Level)
- type AgentState
- type AgentT
- type BusState
- type BusT
- func (b *BusT) BindMsg(re string, cb IvyBindCallback) (int, error)
- func (b *BusT) ConnectToClient(addr string, port int, appName, appId string) error
- func (b *BusT) GetAgent(agentId int) *AgentT
- func (b *BusT) GetBusPort() int
- func (b *BusT) SendMessage(msg string)
- func (b *BusT) Start(busId string) error
- func (b *BusT) Stop() error
- func (b *BusT) UnbindMsg(subId int) (string, error)
- type IvyAppCallback
- type IvyApplication
- type IvyBindCallback
- type IvyBindDirectCallback
- type IvySubscription
- type MessageT
- type MsgType
- type SubscriptionT
Constants ¶
View Source
const ( ARG_START = "\002" ARG_END = "\003" )
View Source
const (
PROTOCOL_VERSION = 3
)
Variables ¶
This section is empty.
Functions ¶
func IvyBindDirectMsg ¶
func IvyBindDirectMsg(cb IvyBindDirectCallback) error
func IvyBindMsg ¶
func IvyBindMsg(cb IvyBindCallback, re string) (int, error)
func IvyInit ¶
func IvyInit(agentName, readyMsg string, mainLoop int, onCnxFunc, onDieFunc IvyAppCallback) error
func IvyMainLoop ¶
func IvyMainLoop() error
func IvySendMsg ¶
func IvyUnbindMsg ¶
Types ¶
type AgentState ¶
type AgentState int
const ( AGENT_NOT_INIT AgentState = iota AGENT_INIT_PROGRESS AGENT_INIT )
type AgentT ¶
type AgentT struct { ID int AgentID string Name string SubcriptionLock *sync.Mutex Subscriptions []SubscriptionT MsgCh chan MessageT Conn net.Conn State AgentState Bus *BusT Logger *logrus.Entry }
func (*AgentT) SendDelSubscription ¶
func (*AgentT) SendDirectMsg ¶
func (*AgentT) SendSubscription ¶
type BusT ¶
type BusT struct { ID string Name string ReadyMsg string OnCnxFunc IvyAppCallback OnDieFunc IvyAppCallback DirectMsgCb IvyBindDirectCallback Conn net.Listener WaitCh chan error UDPConn *net.UDPConn UDPWaitCh chan error Agents []*AgentT SubcriptionLock *sync.Mutex Subscriptions []SubscriptionT Logger *logrus.Entry }
func (*BusT) ConnectToClient ¶
func (*BusT) GetBusPort ¶
func (*BusT) SendMessage ¶
type IvyAppCallback ¶
type IvyAppCallback func(agent IvyApplication)
type IvyApplication ¶
func IvyGetApplicationByName ¶
func IvyGetApplicationByName(appName string) (IvyApplication, error)
func IvyGetApplicationList ¶
func IvyGetApplicationList() ([]IvyApplication, error)
type IvyBindCallback ¶
type IvyBindCallback func(agent IvyApplication, params []string)
type IvyBindDirectCallback ¶
type IvyBindDirectCallback func(agent IvyApplication, numId int, msg string)
type IvySubscription ¶
func IvyGetApplicationMessages ¶
func IvyGetApplicationMessages(agentId int) ([]IvySubscription, error)
type SubscriptionT ¶
type SubscriptionT struct { Id int Text string Re *regexp.Regexp Cb IvyBindCallback }
Click to show internal directories.
Click to hide internal directories.