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", "toNode": "ship1",
"data": ["http://vg.no"], "data": ["http://vg.no"],
"method":"REQHttpGet", "method":"REQHttpGet",

View file

@ -82,9 +82,6 @@ type Subject struct {
// from routeMessagesToPublish in *server. // from routeMessagesToPublish in *server.
// This channel is only used for publishing processes. // This channel is only used for publishing processes.
messageCh chan Message 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 // 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), ToNode: string(m.ToNode),
CommandOrEvent: tmpH.getKind(), CommandOrEvent: tmpH.getKind(),
Method: m.Method, Method: m.Method,
Label: m.Label,
} }
sm := subjectAndMessage{ 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. // information from, so we use the one that are in the current mesage.
fileName = fmt.Sprintf("%v.%v.log", message.ToNode, message.Method) fileName = fmt.Sprintf("%v.%v.log", message.ToNode, message.Method)
folderTree = filepath.Join(proc.configuration.SubscribersDataFolder, message.Label, string(message.FromNode)) folderTree = filepath.Join(proc.configuration.SubscribersDataFolder, message.Label, string(message.FromNode))
fmt.Printf(" ** DEBUG1: foldertree: %v\n", folderTree)
case message.PreviousMessage.ToNode != "": case message.PreviousMessage.ToNode != "":
fileName = fmt.Sprintf("%v.%v.log", message.PreviousMessage.ToNode, message.PreviousMessage.Method) 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)) folderTree = filepath.Join(proc.configuration.SubscribersDataFolder, message.PreviousMessage.Label, string(message.PreviousMessage.ToNode))
fmt.Printf(" ** DEBUG2: foldertree: %v\n", folderTree)
case message.PreviousMessage.ToNode == "": case message.PreviousMessage.ToNode == "":
fileName = fmt.Sprintf("%v.%v.log", message.FromNode, message.Method) fileName = fmt.Sprintf("%v.%v.log", message.FromNode, message.Method)
folderTree = filepath.Join(proc.configuration.SubscribersDataFolder, message.PreviousMessage.Label, string(message.PreviousMessage.ToNode)) 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. // Check if folder structure exist, if not create it.