1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2024-12-14 12:37:31 +00:00

removed label from subject

This commit is contained in:
postmannen 2021-04-07 06:16:08 +02:00
parent ef8fcee368
commit 3368448cd7
4 changed files with 4 additions and 5 deletions

View file

@ -1,6 +1,6 @@
[
{
"label":"metrics/vg.no/annet/minside/",
"label":"metrics/network/sniffer",
"toNode": "ship1",
"data": ["http://vg.no"],
"method":"REQHttpGet",

View file

@ -82,9 +82,6 @@ type Subject struct {
// from routeMessagesToPublish in *server.
// This channel is only used for publishing processes.
messageCh chan Message
// Label, single word used to describe the data content. For example
// syslog, metrics, etc.
Label string
}
// newSubject will return a new variable of the type subject, and insert

View file

@ -104,7 +104,6 @@ func newSAM(m Message) (subjectAndMessage, error) {
ToNode: string(m.ToNode),
CommandOrEvent: tmpH.getKind(),
Method: m.Method,
Label: m.Label,
}
sm := subjectAndMessage{

View file

@ -359,12 +359,15 @@ func (m methodREQTextToFile) handler(proc process, message Message, node string)
// information from, so we use the one that are in the current mesage.
fileName = fmt.Sprintf("%v.%v.log", message.ToNode, message.Method)
folderTree = filepath.Join(proc.configuration.SubscribersDataFolder, message.Label, string(message.FromNode))
fmt.Printf(" ** DEBUG1: foldertree: %v\n", folderTree)
case message.PreviousMessage.ToNode != "":
fileName = fmt.Sprintf("%v.%v.log", message.PreviousMessage.ToNode, message.PreviousMessage.Method)
folderTree = filepath.Join(proc.configuration.SubscribersDataFolder, message.PreviousMessage.Label, string(message.PreviousMessage.ToNode))
fmt.Printf(" ** DEBUG2: foldertree: %v\n", folderTree)
case message.PreviousMessage.ToNode == "":
fileName = fmt.Sprintf("%v.%v.log", message.FromNode, message.Method)
folderTree = filepath.Join(proc.configuration.SubscribersDataFolder, message.PreviousMessage.Label, string(message.PreviousMessage.ToNode))
fmt.Printf(" ** DEBUG3: foldertree: %v\n", folderTree)
}
// Check if folder structure exist, if not create it.