syntax = "proto3"; package transmit; import "google/protobuf/timestamp.proto"; import "google/protobuf/duration.proto"; service Transmit { rpc ScheduleTransmission (ScheduleTransmissionRequest) returns (ScheduleTransmissionResponse); } message ScheduleTransmissionRequest { oneof Schedule { Delayed delayed = 1; Interval interval = 2; Cron cron = 3; } oneof Message { NatsEvent nats_event = 4; } } message ScheduleTransmissionResponse { string transmission_id = 1 ; } message NatsEvent { string subject = 1; bytes payload = 2; } message Delayed { google.protobuf.Timestamp transmit_at = 1; } message Interval { google.protobuf.Timestamp first_transmission = 1; google.protobuf.Duration interval = 2; oneof Iterate { uint32 times = 3; bool infinitely = 4; } } message Cron { google.protobuf.Timestamp first_transmission_after = 1; string expression = 2; oneof Iterate { uint32 times = 3; bool infinitely = 4; } } // Implement gRPC Health Checking Protocol. // https://github.com/grpc/grpc/blob/master/doc/health-checking.md service Health { rpc Check(HealthCheckRequest) returns (HealthCheckResponse); rpc Watch(HealthCheckRequest) returns (stream HealthCheckResponse); } message HealthCheckRequest { string service = 1; } message HealthCheckResponse { enum ServingStatus { UNKNOWN = 0; SERVING = 1; NOT_SERVING = 2; SERVICE_UNKNOWN = 3; // Used only by the Watch method. } ServingStatus status = 1; }