syntax = "proto3";

import "google/protobuf/timestamp.proto";
import "google/protobuf/any.proto";

package de.verteiltearchitekturen.syslog.model;

service Syslog {
    rpc CheckUrgency(Message) returns (Result) {};
    rpc Log(Message) returns (Result) {};
}

enum Severity {
  Emergency     = 0;
  Alert         = 1;
  Critical      = 2;
  Error         = 3;  
  Warning       = 4;
  Notice        = 5;
  Informational = 6;
  Debug         = 7;
}

message StructuredData {
  string key = 1;
  string value = 2;
}

message ComplexData {
  string key = 1;
  oneof value {
    string text = 2;
    google.protobuf.Any data = 3;
  }
}


message Message {
  Severity priority = 1;
  uint32 version = 2;
  google.protobuf.Timestamp timestamp = 3;
  string hostname = 4;
  string appname = 5;
  uint32 procid = 6;
  uint32 msgid = 7;
  repeated StructuredData structureddata = 9; 
  repeated ComplexData data = 8;
}

message Result {
  bool val = 1;
}
