Documentation ¶
Index ¶
- func ConnectAndSubAnonymous(ctx context.Context, sender *Agent, receiverAuthenticated *Agent, url string, ...)
- func ConnectAnonymousWithHandling(ctx context.Context, a *Agent, url string) error
- func ConnectWithHandling(ctx context.Context, a *Agent, url string) error
- func DecodeFileName(data []byte) (string, []byte)
- func DisconnectWithHandling(ctx context.Context, a *Agent)
- func EncodeFileName(fileName string, data []byte) []byte
- func PublishDataWithHandling(ctx context.Context, a *Agent, subject string, data []byte)
- func ReadFile(ctx context.Context, dataFileName string) ([]byte, error)
- func ReceiveWithHandling(ctx context.Context, a *Agent) [][]byte
- func SendDataOverDirectMessage(ctx context.Context, sender *Agent, receiver *Agent, dataFileName string)
- func SendDataWithHandling(ctx context.Context, a *Agent, receivingMrn string, data []byte)
- func SendTextWithHandling(ctx context.Context, a *Agent, receivingMrn string, msg string)
- func SubAndUnsubscribeTopic(ctx context.Context, sender *Agent, receiver *Agent, subject string)
- func SubAndUnsubscribeWithData(ctx context.Context, sender *Agent, receiver *Agent, subject string, ...)
- func SubUnsubReconnection(ctx context.Context, sender *Agent, receiver *Agent, subject string, ...)
- func SubscribeTopic(ctx context.Context, sender *Agent, receiver *Agent, subject string)
- type Agent
- func (a *Agent) Authenticate(ctx context.Context, certificate *x509.Certificate) (mmtp.ResponseEnum, error)
- func (a *Agent) ConnectAnonymous(ctx context.Context, url string) (mmtp.ResponseEnum, error)
- func (a *Agent) ConnectAuthenticated(ctx context.Context, url string) (mmtp.ResponseEnum, error)
- func (a *Agent) Disconnect(ctx context.Context) (mmtp.ResponseEnum, error)
- func (a *Agent) Discover()
- func (a *Agent) Publish(ctx context.Context, timeToLive time.Duration, subject string, bytes []byte) (mmtp.ResponseEnum, error)
- func (a *Agent) Receive(ctx context.Context, filter *mmtp.Filter) (mmtp.ResponseEnum, [][]byte, error)
- func (a *Agent) ReconnectAnonymous()
- func (a *Agent) Send(ctx context.Context, timeToLive time.Duration, receivingMrn string, ...) (mmtp.ResponseEnum, error)
- func (a *Agent) Status() AgentState
- func (a *Agent) Subscribe(ctx context.Context, subject string) (mmtp.ResponseEnum, error)
- func (a *Agent) SubscribeMessages(ctx context.Context)
- func (a *Agent) Unsubscribe(ctx context.Context, subject string) (mmtp.ResponseEnum, error)
- func (a *Agent) UnsubscribeMessages(ctx context.Context)
- type AgentState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectAndSubAnonymous ¶ added in v0.1.1
func ConnectAnonymousWithHandling ¶ added in v0.1.1
func ConnectWithHandling ¶ added in v0.1.1
func DecodeFileName ¶ added in v0.1.1
func DisconnectWithHandling ¶ added in v0.1.1
func EncodeFileName ¶ added in v0.1.1
func PublishDataWithHandling ¶ added in v0.1.1
func ReceiveWithHandling ¶ added in v0.1.1
func SendDataOverDirectMessage ¶ added in v0.1.1
func SendDataWithHandling ¶ added in v0.1.1
func SendTextWithHandling ¶ added in v0.1.1
func SubAndUnsubscribeTopic ¶ added in v0.1.1
func SubAndUnsubscribeWithData ¶ added in v0.1.1
func SubUnsubReconnection ¶ added in v0.1.1
Types ¶
type Agent ¶
type Agent struct { Mrn string // the MRN of the Agent Interests []string // the Interests that the Agent wants to subscribe to Messages map[string]*mmtp.MmtpMessage // the incoming messages for this Agent // contains filtered or unexported fields }
Agent type representing an agent for a connection to an Edge Router
func (*Agent) Authenticate ¶
func (a *Agent) Authenticate(ctx context.Context, certificate *x509.Certificate) (mmtp.ResponseEnum, error)
TODO: implement this function Authenticate imports an MCP cert and does authentication. MRN attribute in the cert will be stored to the MRN of Agent
func (*Agent) ConnectAnonymous ¶
ConnectAnonymous make connect anonymously to an MMS Edge Router
func (*Agent) ConnectAuthenticated ¶
ConnectAuthenticated make connect to an MMS Edge Router
func (*Agent) Disconnect ¶
Disconnect disconnects from the MMS Edge Router
func (*Agent) Publish ¶
func (a *Agent) Publish(ctx context.Context, timeToLive time.Duration, subject string, bytes []byte) (mmtp.ResponseEnum, error)
Publish transfers a message with regard to a subject
func (*Agent) Receive ¶
func (a *Agent) Receive(ctx context.Context, filter *mmtp.Filter) (mmtp.ResponseEnum, [][]byte, error)
Receive fetches a list of messages sent to its own MRN
func (*Agent) ReconnectAnonymous ¶
func (a *Agent) ReconnectAnonymous()
ReconnectAnonymous reconnects anonymously to an MMS Edge Router
func (*Agent) Send ¶
func (a *Agent) Send(ctx context.Context, timeToLive time.Duration, receivingMrn string, bytes []byte) (mmtp.ResponseEnum, error)
Send transfers a message to another Agent with receivingMrn
func (*Agent) Status ¶
func (a *Agent) Status() AgentState
Status returns current status of the MMS Agent
func (*Agent) SubscribeMessages ¶
func (*Agent) Unsubscribe ¶
func (*Agent) UnsubscribeMessages ¶
type AgentState ¶
type AgentState int16
AgentState type representing a state of Agent
const ( AgentState_NOTCONNECTED AgentState = 0 AgentState_CONNECTED AgentState = 1 AgentState_AUTHENTICATED AgentState = 2 )