messaging

package
v0.0.0-...-2b7f6e1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToRemote

func AddToRemote(gid GoogleID, teamID TeamID)

AddToRemote is called to add an agent to various services

func AgentDeleteOperation

func AgentDeleteOperation(gid GoogleID, opID OperationID)

AgentDeleteOperation instructs a single agent to delete an operation (e.g. at removal from team)

func DeleteOperation

func DeleteOperation(opID OperationID)

DeleteOperation is called to broadcst a delete operation command to all agents (e.g. Firebase)

func RegisterMessageBus

func RegisterMessageBus(busname string, b Bus)

RegisterMessageBus is called by a service to register with the messaging system

func RemoveFromRemote

func RemoveFromRemote(gid GoogleID, teamID TeamID)

RemoveFromRemote is called to remove an agent from various services

func RemoveMessageBus

func RemoveMessageBus(busname string)

RemoveMessageBus is called to remove a service from the messaging system

func SendAnnounce

func SendAnnounce(teamID TeamID, a Announce)

SendAnnounce sends a generic message to a team if opID is nil, it is not used

func SendAssignment

func SendAssignment(gid GoogleID, taskID TaskID, opID OperationID, status string)

SendAssignment sends a task to an agent

func SendMessage

func SendMessage(toGID GoogleID, message string) (bool, error)

SendMessage is used to send a generic message to a single agent

func SendTarget

func SendTarget(toGID GoogleID, target Target) error

SendTarget is called to send target information to agents

Types

type Announce

type Announce struct {
	Text   string
	Sender GoogleID
	OpID   OperationID
	TeamID TeamID
}

Announce is the type used for the SendAnnounce call

type Bus

type Bus struct {
	SendMessage          func(GoogleID, string) (bool, error)              // send a message to an individual agent
	SendTarget           func(GoogleID, Target) error                      // send a formatted target to an individual agent
	CanSendTo            func(fromGID GoogleID, toGID GoogleID) bool       // determine if one agent can send to another
	SendAnnounce         func(TeamID, Announce) error                      // send a messaage to a team
	AddToRemote          func(GoogleID, TeamID) error                      // add an agent to a services chat/community/team/channel/whatever
	RemoveFromRemote     func(GoogleID, TeamID) error                      // remove an agent from a service's X
	SendAssignment       func(GoogleID, TaskID, OperationID, string) error // Send a formatted assignment to an individual agent
	AgentDeleteOperation func(GoogleID, OperationID) error                 // instruct a single agent to delete an operation
	DeleteOperation      func(OperationID) error                           // instruct EVERYONE to delete an operation
}

Bus is the type that services use to register with the messaging framework

type GoogleID

type GoogleID string

GoogleID is a wrapper for model.GoogleID

type OperationID

type OperationID string

OperationID is a wrapper for model.OperationID

type Target

type Target struct {
	Name   string
	ID     string
	Lat    string
	Lng    string
	Type   string
	Sender string
}

Target is the type used for the SendTarget call

type TaskID

type TaskID string

TaskID is a wrapper for model.TaskID

type TeamID

type TeamID string

TeamID is a wrapper for model.TeamID

Jump to

Keyboard shortcuts

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