github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-core-master/protos/events.proto (about)

     1  // Copyright 2017 Intel Corporation
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  // -----------------------------------------------------------------------------
    15  
    16  syntax = "proto3";
    17  
    18  option java_multiple_files = true;
    19  option java_package = "sawtooth.sdk.protobuf";
    20  option go_package = "events_pb2";
    21  
    22  
    23  message Event {
    24    // Used to subscribe to events and servers as a hint for how to deserialize
    25    // event_data and what pairs to expect in attributes.
    26    string event_type = 1;
    27  
    28    // Transparent data defined by the event_type.
    29    message Attribute {
    30      string key = 1;
    31      string value = 2;
    32    }
    33    repeated Attribute attributes = 2;
    34  
    35    // Opaque data defined by the event_type.
    36    bytes  data = 3;
    37  }
    38  
    39  message EventList {
    40      repeated Event events = 1;
    41  }
    42  
    43  message EventFilter {
    44      // EventFilter is used when subscribing to events to limit the events
    45      // received within a given event type. See
    46      // validator/server/events/subscription.py for further explanation.
    47      string key = 1;
    48      string match_string = 2;
    49  
    50      enum FilterType {
    51        FILTER_TYPE_UNSET = 0;
    52        SIMPLE_ANY = 1;
    53        SIMPLE_ALL = 2;
    54        REGEX_ANY  = 3;
    55        REGEX_ALL  = 4;
    56      }
    57      FilterType filter_type = 3;
    58  }
    59  
    60  message EventSubscription {
    61      // EventSubscription is used when subscribing to events to specify the type
    62      // of events being subscribed to, along with any additional filters. See
    63      // validator/server/events/subscription.py for further explanation.
    64      string event_type = 1;
    65      repeated EventFilter filters = 2;
    66  }