add IrcCloud log importer.

This commit is contained in:
2020-08-20 20:58:16 +02:00
parent 6fa2dc9800
commit df982fac17
8 changed files with 379 additions and 7 deletions
+6 -1
View File
@@ -55,7 +55,12 @@ func (r *mutationResolver) ImportLog(ctx context.Context, input graphcore.LogImp
tz = parsedTZ
}
return r.s.Logs.Import(ctx, input.Importer, date, tz, input.ChannelName, input.Data)
sessionThreshold := time.Hour * 12
if input.SessionThresholdMs != nil {
sessionThreshold = time.Duration(*input.SessionThresholdMs) * time.Millisecond
}
return r.s.Logs.Import(ctx, input.Importer, date, tz, input.ChannelName, sessionThreshold, input.Data)
}
func (r *mutationResolver) SplitLog(ctx context.Context, input graphcore.LogSplitInput) (*models.Log, error) {
+8
View File
@@ -132,6 +132,9 @@ input LogImportInput {
"The date of the log, if not provided in the log body."
date: Time
"Session threwhold"
sessionThresholdMs: Int
"The log body itself."
data: String!
}
@@ -171,4 +174,9 @@ enum LogImporter {
Forum log: This importer parses the format on the forum. The displayed log, not the post source.
"""
ForumLog
"""
IRCCloud: This importer parses irccloud exports.
"""
IrcCloud
}