// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

syntax="proto2";

package brpc;
option java_package="com.brpc";
option java_outer_classname="StreamingRpcProto";

message StreamSettings {
    required int64 stream_id = 1;
    optional bool need_feedback = 2 [default = false];
    optional bool writable = 3 [default = false];
    repeated int64 extra_stream_ids = 4;
}

enum FrameType {
    FRAME_TYPE_UNKNOWN = 0;
    FRAME_TYPE_RST = 1;
    FRAME_TYPE_CLOSE = 2;
    FRAME_TYPE_DATA = 3;
    FRAME_TYPE_FEEDBACK= 4;
}

message StreamFrameMeta {
    required int64 stream_id = 1;
    optional int64 source_stream_id = 2;
    optional FrameType frame_type = 3;
    optional bool has_continuation = 4;
    optional Feedback feedback = 5;
}

message Feedback {
    optional int64 consumed_size = 1;
}
