syntax = "proto3";

package twitch.video.usher;
option go_package = "code.justin.tv/video/usherapi/rpc/usher";

import "google/protobuf/struct.proto";

// The DBOption service provides persistent runtime configuration storage for
// video system configuration options. Frequently a DBOption will be used when
// the implementation of a configuration option spans multiple services.
//
// Notably the usher apis this file depends on are newly created APIs which
// were specifically designed for use with this repo. the previously existing
// apis used an inconsistent model for referring to the dboption key/value pairs
//
// all of these apis return a list of DBOption elements

message DBOptionGetRequest {
  string name = 1;
}

message DBOptionGetResponse {
  google.protobuf.Value value = 1 [json_name = "value"];
}

message DBOptionSetRequest {
  google.protobuf.Struct options = 1;
}

message DBOptionSetResponse {
  bool success = 1 [json_name = "success"];
  string error = 2 [json_name = "error"];
}

message DBOptionGetAllRequest {
  // The syntax of pattern is a SQL LIKE matcher, it is used to filter keys in
  // the list of dboptions returned, with one caveat. All instances of the '*'
  // character will be converted to '%'
  //
  //   Examples:
  //     "lowlatency*"
  //     "lowlatency%"
  //     "*manifest*"
  //     "%manifest%"
  string pattern = 1;
}
