func findEventType()

in accumulator/batch.go [366:387]


func findEventType(body []byte) eventType {
	var quote byte
	var key []byte
	for i, r := range body {
		if r == '"' || r == '\'' {
			quote = r
			key = body[i+1:]
			break
		}
	}
	end := bytes.IndexByte(key, quote)
	if end == -1 {
		return otherEvent
	}
	switch string(key[:end]) {
	case transactionKey:
		return transactionEvent
	case metadataKey:
		return metadataEvent
	}
	return otherEvent
}