mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
In pure-runner and LB agent, service providers might want to set specific driver options. For example, to add cpu-shares to functions, LB can add the information as extensions to the Call and pass this via gRPC to runners. Runners then pick these extensions from gRPC call and pass it to driver. Using a custom driver implementation, pure-runners can process these extensions to modify docker.CreateContainerOptions. To achieve this, LB agents can now be configured using a call overrider. Pure-runners can be configured using a custom docker driver. RunnerCall and Call interfaces both expose call extensions. An example to demonstrate this is implemented in test/fn-system-tests/system_test.go which registers a call overrider for LB agent as well as a simple custom docker driver. In this example, LB agent adds a key-value to extensions and runners add this key-value as an environment variable to the container.
762 lines
24 KiB
Go
762 lines
24 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// source: runner.proto
|
|
|
|
/*
|
|
Package runner is a generated protocol buffer package.
|
|
|
|
It is generated from these files:
|
|
runner.proto
|
|
|
|
It has these top-level messages:
|
|
TryCall
|
|
DataFrame
|
|
HttpHeader
|
|
HttpRespMeta
|
|
CallResultStart
|
|
CallFinished
|
|
ClientMsg
|
|
RunnerMsg
|
|
RunnerStatus
|
|
*/
|
|
package runner
|
|
|
|
import proto "github.com/golang/protobuf/proto"
|
|
import fmt "fmt"
|
|
import math "math"
|
|
import google_protobuf "github.com/golang/protobuf/ptypes/empty"
|
|
|
|
import (
|
|
context "golang.org/x/net/context"
|
|
grpc "google.golang.org/grpc"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the proto package it is being compiled against.
|
|
// A compilation error at this line likely means your copy of the
|
|
// proto package needs to be updated.
|
|
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
|
|
|
// Request to allocate a slot for a call
|
|
type TryCall struct {
|
|
ModelsCallJson string `protobuf:"bytes,1,opt,name=models_call_json,json=modelsCallJson" json:"models_call_json,omitempty"`
|
|
SlotHashId string `protobuf:"bytes,2,opt,name=slot_hash_id,json=slotHashId" json:"slot_hash_id,omitempty"`
|
|
Extensions map[string]string `protobuf:"bytes,3,rep,name=extensions" json:"extensions,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
|
|
}
|
|
|
|
func (m *TryCall) Reset() { *m = TryCall{} }
|
|
func (m *TryCall) String() string { return proto.CompactTextString(m) }
|
|
func (*TryCall) ProtoMessage() {}
|
|
func (*TryCall) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
|
|
|
func (m *TryCall) GetModelsCallJson() string {
|
|
if m != nil {
|
|
return m.ModelsCallJson
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *TryCall) GetSlotHashId() string {
|
|
if m != nil {
|
|
return m.SlotHashId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *TryCall) GetExtensions() map[string]string {
|
|
if m != nil {
|
|
return m.Extensions
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Data sent C2S and S2C - as soon as the runner sees the first of these it
|
|
// will start running. If empty content, there must be one of these with eof.
|
|
// The runner will send these for the body of the response, AFTER it has sent
|
|
// a CallEnding message.
|
|
type DataFrame struct {
|
|
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
|
|
Eof bool `protobuf:"varint,2,opt,name=eof" json:"eof,omitempty"`
|
|
}
|
|
|
|
func (m *DataFrame) Reset() { *m = DataFrame{} }
|
|
func (m *DataFrame) String() string { return proto.CompactTextString(m) }
|
|
func (*DataFrame) ProtoMessage() {}
|
|
func (*DataFrame) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
|
|
|
func (m *DataFrame) GetData() []byte {
|
|
if m != nil {
|
|
return m.Data
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *DataFrame) GetEof() bool {
|
|
if m != nil {
|
|
return m.Eof
|
|
}
|
|
return false
|
|
}
|
|
|
|
type HttpHeader struct {
|
|
Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
|
|
Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
|
|
}
|
|
|
|
func (m *HttpHeader) Reset() { *m = HttpHeader{} }
|
|
func (m *HttpHeader) String() string { return proto.CompactTextString(m) }
|
|
func (*HttpHeader) ProtoMessage() {}
|
|
func (*HttpHeader) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
|
|
|
|
func (m *HttpHeader) GetKey() string {
|
|
if m != nil {
|
|
return m.Key
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *HttpHeader) GetValue() string {
|
|
if m != nil {
|
|
return m.Value
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type HttpRespMeta struct {
|
|
StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode" json:"status_code,omitempty"`
|
|
Headers []*HttpHeader `protobuf:"bytes,2,rep,name=headers" json:"headers,omitempty"`
|
|
}
|
|
|
|
func (m *HttpRespMeta) Reset() { *m = HttpRespMeta{} }
|
|
func (m *HttpRespMeta) String() string { return proto.CompactTextString(m) }
|
|
func (*HttpRespMeta) ProtoMessage() {}
|
|
func (*HttpRespMeta) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
|
|
|
|
func (m *HttpRespMeta) GetStatusCode() int32 {
|
|
if m != nil {
|
|
return m.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *HttpRespMeta) GetHeaders() []*HttpHeader {
|
|
if m != nil {
|
|
return m.Headers
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Call has started to finish - data might not be here yet and it will be sent
|
|
// as DataFrames.
|
|
type CallResultStart struct {
|
|
// Types that are valid to be assigned to Meta:
|
|
// *CallResultStart_Http
|
|
Meta isCallResultStart_Meta `protobuf_oneof:"meta"`
|
|
}
|
|
|
|
func (m *CallResultStart) Reset() { *m = CallResultStart{} }
|
|
func (m *CallResultStart) String() string { return proto.CompactTextString(m) }
|
|
func (*CallResultStart) ProtoMessage() {}
|
|
func (*CallResultStart) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
|
|
|
|
type isCallResultStart_Meta interface{ isCallResultStart_Meta() }
|
|
|
|
type CallResultStart_Http struct {
|
|
Http *HttpRespMeta `protobuf:"bytes,100,opt,name=http,oneof"`
|
|
}
|
|
|
|
func (*CallResultStart_Http) isCallResultStart_Meta() {}
|
|
|
|
func (m *CallResultStart) GetMeta() isCallResultStart_Meta {
|
|
if m != nil {
|
|
return m.Meta
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *CallResultStart) GetHttp() *HttpRespMeta {
|
|
if x, ok := m.GetMeta().(*CallResultStart_Http); ok {
|
|
return x.Http
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// XXX_OneofFuncs is for the internal use of the proto package.
|
|
func (*CallResultStart) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
|
|
return _CallResultStart_OneofMarshaler, _CallResultStart_OneofUnmarshaler, _CallResultStart_OneofSizer, []interface{}{
|
|
(*CallResultStart_Http)(nil),
|
|
}
|
|
}
|
|
|
|
func _CallResultStart_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
|
|
m := msg.(*CallResultStart)
|
|
// meta
|
|
switch x := m.Meta.(type) {
|
|
case *CallResultStart_Http:
|
|
b.EncodeVarint(100<<3 | proto.WireBytes)
|
|
if err := b.EncodeMessage(x.Http); err != nil {
|
|
return err
|
|
}
|
|
case nil:
|
|
default:
|
|
return fmt.Errorf("CallResultStart.Meta has unexpected type %T", x)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func _CallResultStart_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
|
|
m := msg.(*CallResultStart)
|
|
switch tag {
|
|
case 100: // meta.http
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
msg := new(HttpRespMeta)
|
|
err := b.DecodeMessage(msg)
|
|
m.Meta = &CallResultStart_Http{msg}
|
|
return true, err
|
|
default:
|
|
return false, nil
|
|
}
|
|
}
|
|
|
|
func _CallResultStart_OneofSizer(msg proto.Message) (n int) {
|
|
m := msg.(*CallResultStart)
|
|
// meta
|
|
switch x := m.Meta.(type) {
|
|
case *CallResultStart_Http:
|
|
s := proto.Size(x.Http)
|
|
n += proto.SizeVarint(100<<3 | proto.WireBytes)
|
|
n += proto.SizeVarint(uint64(s))
|
|
n += s
|
|
case nil:
|
|
default:
|
|
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
|
|
}
|
|
return n
|
|
}
|
|
|
|
// Call has really finished, it might have completed or crashed
|
|
type CallFinished struct {
|
|
Success bool `protobuf:"varint,1,opt,name=success" json:"success,omitempty"`
|
|
Details string `protobuf:"bytes,2,opt,name=details" json:"details,omitempty"`
|
|
ErrorCode int32 `protobuf:"varint,3,opt,name=errorCode" json:"errorCode,omitempty"`
|
|
ErrorStr string `protobuf:"bytes,4,opt,name=errorStr" json:"errorStr,omitempty"`
|
|
}
|
|
|
|
func (m *CallFinished) Reset() { *m = CallFinished{} }
|
|
func (m *CallFinished) String() string { return proto.CompactTextString(m) }
|
|
func (*CallFinished) ProtoMessage() {}
|
|
func (*CallFinished) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
|
|
|
|
func (m *CallFinished) GetSuccess() bool {
|
|
if m != nil {
|
|
return m.Success
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (m *CallFinished) GetDetails() string {
|
|
if m != nil {
|
|
return m.Details
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *CallFinished) GetErrorCode() int32 {
|
|
if m != nil {
|
|
return m.ErrorCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *CallFinished) GetErrorStr() string {
|
|
if m != nil {
|
|
return m.ErrorStr
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type ClientMsg struct {
|
|
// Types that are valid to be assigned to Body:
|
|
// *ClientMsg_Try
|
|
// *ClientMsg_Data
|
|
Body isClientMsg_Body `protobuf_oneof:"body"`
|
|
}
|
|
|
|
func (m *ClientMsg) Reset() { *m = ClientMsg{} }
|
|
func (m *ClientMsg) String() string { return proto.CompactTextString(m) }
|
|
func (*ClientMsg) ProtoMessage() {}
|
|
func (*ClientMsg) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
|
|
|
|
type isClientMsg_Body interface{ isClientMsg_Body() }
|
|
|
|
type ClientMsg_Try struct {
|
|
Try *TryCall `protobuf:"bytes,1,opt,name=try,oneof"`
|
|
}
|
|
type ClientMsg_Data struct {
|
|
Data *DataFrame `protobuf:"bytes,2,opt,name=data,oneof"`
|
|
}
|
|
|
|
func (*ClientMsg_Try) isClientMsg_Body() {}
|
|
func (*ClientMsg_Data) isClientMsg_Body() {}
|
|
|
|
func (m *ClientMsg) GetBody() isClientMsg_Body {
|
|
if m != nil {
|
|
return m.Body
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *ClientMsg) GetTry() *TryCall {
|
|
if x, ok := m.GetBody().(*ClientMsg_Try); ok {
|
|
return x.Try
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *ClientMsg) GetData() *DataFrame {
|
|
if x, ok := m.GetBody().(*ClientMsg_Data); ok {
|
|
return x.Data
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// XXX_OneofFuncs is for the internal use of the proto package.
|
|
func (*ClientMsg) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
|
|
return _ClientMsg_OneofMarshaler, _ClientMsg_OneofUnmarshaler, _ClientMsg_OneofSizer, []interface{}{
|
|
(*ClientMsg_Try)(nil),
|
|
(*ClientMsg_Data)(nil),
|
|
}
|
|
}
|
|
|
|
func _ClientMsg_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
|
|
m := msg.(*ClientMsg)
|
|
// body
|
|
switch x := m.Body.(type) {
|
|
case *ClientMsg_Try:
|
|
b.EncodeVarint(1<<3 | proto.WireBytes)
|
|
if err := b.EncodeMessage(x.Try); err != nil {
|
|
return err
|
|
}
|
|
case *ClientMsg_Data:
|
|
b.EncodeVarint(2<<3 | proto.WireBytes)
|
|
if err := b.EncodeMessage(x.Data); err != nil {
|
|
return err
|
|
}
|
|
case nil:
|
|
default:
|
|
return fmt.Errorf("ClientMsg.Body has unexpected type %T", x)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func _ClientMsg_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
|
|
m := msg.(*ClientMsg)
|
|
switch tag {
|
|
case 1: // body.try
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
msg := new(TryCall)
|
|
err := b.DecodeMessage(msg)
|
|
m.Body = &ClientMsg_Try{msg}
|
|
return true, err
|
|
case 2: // body.data
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
msg := new(DataFrame)
|
|
err := b.DecodeMessage(msg)
|
|
m.Body = &ClientMsg_Data{msg}
|
|
return true, err
|
|
default:
|
|
return false, nil
|
|
}
|
|
}
|
|
|
|
func _ClientMsg_OneofSizer(msg proto.Message) (n int) {
|
|
m := msg.(*ClientMsg)
|
|
// body
|
|
switch x := m.Body.(type) {
|
|
case *ClientMsg_Try:
|
|
s := proto.Size(x.Try)
|
|
n += proto.SizeVarint(1<<3 | proto.WireBytes)
|
|
n += proto.SizeVarint(uint64(s))
|
|
n += s
|
|
case *ClientMsg_Data:
|
|
s := proto.Size(x.Data)
|
|
n += proto.SizeVarint(2<<3 | proto.WireBytes)
|
|
n += proto.SizeVarint(uint64(s))
|
|
n += s
|
|
case nil:
|
|
default:
|
|
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
|
|
}
|
|
return n
|
|
}
|
|
|
|
type RunnerMsg struct {
|
|
// Types that are valid to be assigned to Body:
|
|
// *RunnerMsg_ResultStart
|
|
// *RunnerMsg_Data
|
|
// *RunnerMsg_Finished
|
|
Body isRunnerMsg_Body `protobuf_oneof:"body"`
|
|
}
|
|
|
|
func (m *RunnerMsg) Reset() { *m = RunnerMsg{} }
|
|
func (m *RunnerMsg) String() string { return proto.CompactTextString(m) }
|
|
func (*RunnerMsg) ProtoMessage() {}
|
|
func (*RunnerMsg) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
|
|
|
|
type isRunnerMsg_Body interface{ isRunnerMsg_Body() }
|
|
|
|
type RunnerMsg_ResultStart struct {
|
|
ResultStart *CallResultStart `protobuf:"bytes,1,opt,name=result_start,json=resultStart,oneof"`
|
|
}
|
|
type RunnerMsg_Data struct {
|
|
Data *DataFrame `protobuf:"bytes,2,opt,name=data,oneof"`
|
|
}
|
|
type RunnerMsg_Finished struct {
|
|
Finished *CallFinished `protobuf:"bytes,3,opt,name=finished,oneof"`
|
|
}
|
|
|
|
func (*RunnerMsg_ResultStart) isRunnerMsg_Body() {}
|
|
func (*RunnerMsg_Data) isRunnerMsg_Body() {}
|
|
func (*RunnerMsg_Finished) isRunnerMsg_Body() {}
|
|
|
|
func (m *RunnerMsg) GetBody() isRunnerMsg_Body {
|
|
if m != nil {
|
|
return m.Body
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *RunnerMsg) GetResultStart() *CallResultStart {
|
|
if x, ok := m.GetBody().(*RunnerMsg_ResultStart); ok {
|
|
return x.ResultStart
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *RunnerMsg) GetData() *DataFrame {
|
|
if x, ok := m.GetBody().(*RunnerMsg_Data); ok {
|
|
return x.Data
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *RunnerMsg) GetFinished() *CallFinished {
|
|
if x, ok := m.GetBody().(*RunnerMsg_Finished); ok {
|
|
return x.Finished
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// XXX_OneofFuncs is for the internal use of the proto package.
|
|
func (*RunnerMsg) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
|
|
return _RunnerMsg_OneofMarshaler, _RunnerMsg_OneofUnmarshaler, _RunnerMsg_OneofSizer, []interface{}{
|
|
(*RunnerMsg_ResultStart)(nil),
|
|
(*RunnerMsg_Data)(nil),
|
|
(*RunnerMsg_Finished)(nil),
|
|
}
|
|
}
|
|
|
|
func _RunnerMsg_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
|
|
m := msg.(*RunnerMsg)
|
|
// body
|
|
switch x := m.Body.(type) {
|
|
case *RunnerMsg_ResultStart:
|
|
b.EncodeVarint(1<<3 | proto.WireBytes)
|
|
if err := b.EncodeMessage(x.ResultStart); err != nil {
|
|
return err
|
|
}
|
|
case *RunnerMsg_Data:
|
|
b.EncodeVarint(2<<3 | proto.WireBytes)
|
|
if err := b.EncodeMessage(x.Data); err != nil {
|
|
return err
|
|
}
|
|
case *RunnerMsg_Finished:
|
|
b.EncodeVarint(3<<3 | proto.WireBytes)
|
|
if err := b.EncodeMessage(x.Finished); err != nil {
|
|
return err
|
|
}
|
|
case nil:
|
|
default:
|
|
return fmt.Errorf("RunnerMsg.Body has unexpected type %T", x)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func _RunnerMsg_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
|
|
m := msg.(*RunnerMsg)
|
|
switch tag {
|
|
case 1: // body.result_start
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
msg := new(CallResultStart)
|
|
err := b.DecodeMessage(msg)
|
|
m.Body = &RunnerMsg_ResultStart{msg}
|
|
return true, err
|
|
case 2: // body.data
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
msg := new(DataFrame)
|
|
err := b.DecodeMessage(msg)
|
|
m.Body = &RunnerMsg_Data{msg}
|
|
return true, err
|
|
case 3: // body.finished
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
msg := new(CallFinished)
|
|
err := b.DecodeMessage(msg)
|
|
m.Body = &RunnerMsg_Finished{msg}
|
|
return true, err
|
|
default:
|
|
return false, nil
|
|
}
|
|
}
|
|
|
|
func _RunnerMsg_OneofSizer(msg proto.Message) (n int) {
|
|
m := msg.(*RunnerMsg)
|
|
// body
|
|
switch x := m.Body.(type) {
|
|
case *RunnerMsg_ResultStart:
|
|
s := proto.Size(x.ResultStart)
|
|
n += proto.SizeVarint(1<<3 | proto.WireBytes)
|
|
n += proto.SizeVarint(uint64(s))
|
|
n += s
|
|
case *RunnerMsg_Data:
|
|
s := proto.Size(x.Data)
|
|
n += proto.SizeVarint(2<<3 | proto.WireBytes)
|
|
n += proto.SizeVarint(uint64(s))
|
|
n += s
|
|
case *RunnerMsg_Finished:
|
|
s := proto.Size(x.Finished)
|
|
n += proto.SizeVarint(3<<3 | proto.WireBytes)
|
|
n += proto.SizeVarint(uint64(s))
|
|
n += s
|
|
case nil:
|
|
default:
|
|
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
|
|
}
|
|
return n
|
|
}
|
|
|
|
type RunnerStatus struct {
|
|
Active int32 `protobuf:"varint,2,opt,name=active" json:"active,omitempty"`
|
|
}
|
|
|
|
func (m *RunnerStatus) Reset() { *m = RunnerStatus{} }
|
|
func (m *RunnerStatus) String() string { return proto.CompactTextString(m) }
|
|
func (*RunnerStatus) ProtoMessage() {}
|
|
func (*RunnerStatus) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} }
|
|
|
|
func (m *RunnerStatus) GetActive() int32 {
|
|
if m != nil {
|
|
return m.Active
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*TryCall)(nil), "TryCall")
|
|
proto.RegisterType((*DataFrame)(nil), "DataFrame")
|
|
proto.RegisterType((*HttpHeader)(nil), "HttpHeader")
|
|
proto.RegisterType((*HttpRespMeta)(nil), "HttpRespMeta")
|
|
proto.RegisterType((*CallResultStart)(nil), "CallResultStart")
|
|
proto.RegisterType((*CallFinished)(nil), "CallFinished")
|
|
proto.RegisterType((*ClientMsg)(nil), "ClientMsg")
|
|
proto.RegisterType((*RunnerMsg)(nil), "RunnerMsg")
|
|
proto.RegisterType((*RunnerStatus)(nil), "RunnerStatus")
|
|
}
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ context.Context
|
|
var _ grpc.ClientConn
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
const _ = grpc.SupportPackageIsVersion4
|
|
|
|
// Client API for RunnerProtocol service
|
|
|
|
type RunnerProtocolClient interface {
|
|
Engage(ctx context.Context, opts ...grpc.CallOption) (RunnerProtocol_EngageClient, error)
|
|
// Rather than rely on Prometheus for this, expose status that's specific to the runner lifecycle through this.
|
|
Status(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*RunnerStatus, error)
|
|
}
|
|
|
|
type runnerProtocolClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewRunnerProtocolClient(cc *grpc.ClientConn) RunnerProtocolClient {
|
|
return &runnerProtocolClient{cc}
|
|
}
|
|
|
|
func (c *runnerProtocolClient) Engage(ctx context.Context, opts ...grpc.CallOption) (RunnerProtocol_EngageClient, error) {
|
|
stream, err := grpc.NewClientStream(ctx, &_RunnerProtocol_serviceDesc.Streams[0], c.cc, "/RunnerProtocol/Engage", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &runnerProtocolEngageClient{stream}
|
|
return x, nil
|
|
}
|
|
|
|
type RunnerProtocol_EngageClient interface {
|
|
Send(*ClientMsg) error
|
|
Recv() (*RunnerMsg, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type runnerProtocolEngageClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *runnerProtocolEngageClient) Send(m *ClientMsg) error {
|
|
return x.ClientStream.SendMsg(m)
|
|
}
|
|
|
|
func (x *runnerProtocolEngageClient) Recv() (*RunnerMsg, error) {
|
|
m := new(RunnerMsg)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func (c *runnerProtocolClient) Status(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*RunnerStatus, error) {
|
|
out := new(RunnerStatus)
|
|
err := grpc.Invoke(ctx, "/RunnerProtocol/Status", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// Server API for RunnerProtocol service
|
|
|
|
type RunnerProtocolServer interface {
|
|
Engage(RunnerProtocol_EngageServer) error
|
|
// Rather than rely on Prometheus for this, expose status that's specific to the runner lifecycle through this.
|
|
Status(context.Context, *google_protobuf.Empty) (*RunnerStatus, error)
|
|
}
|
|
|
|
func RegisterRunnerProtocolServer(s *grpc.Server, srv RunnerProtocolServer) {
|
|
s.RegisterService(&_RunnerProtocol_serviceDesc, srv)
|
|
}
|
|
|
|
func _RunnerProtocol_Engage_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(RunnerProtocolServer).Engage(&runnerProtocolEngageServer{stream})
|
|
}
|
|
|
|
type RunnerProtocol_EngageServer interface {
|
|
Send(*RunnerMsg) error
|
|
Recv() (*ClientMsg, error)
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type runnerProtocolEngageServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *runnerProtocolEngageServer) Send(m *RunnerMsg) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
func (x *runnerProtocolEngageServer) Recv() (*ClientMsg, error) {
|
|
m := new(ClientMsg)
|
|
if err := x.ServerStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func _RunnerProtocol_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(google_protobuf.Empty)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(RunnerProtocolServer).Status(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/RunnerProtocol/Status",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(RunnerProtocolServer).Status(ctx, req.(*google_protobuf.Empty))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _RunnerProtocol_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "RunnerProtocol",
|
|
HandlerType: (*RunnerProtocolServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Status",
|
|
Handler: _RunnerProtocol_Status_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "Engage",
|
|
Handler: _RunnerProtocol_Engage_Handler,
|
|
ServerStreams: true,
|
|
ClientStreams: true,
|
|
},
|
|
},
|
|
Metadata: "runner.proto",
|
|
}
|
|
|
|
func init() { proto.RegisterFile("runner.proto", fileDescriptor0) }
|
|
|
|
var fileDescriptor0 = []byte{
|
|
// 576 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xdb, 0x8a, 0x13, 0x4d,
|
|
0x10, 0xce, 0x24, 0xd9, 0x6c, 0x52, 0x99, 0x3d, 0xd0, 0xfc, 0xfc, 0x0c, 0x71, 0xc1, 0x30, 0x1e,
|
|
0x08, 0x08, 0xbd, 0x1a, 0x15, 0x16, 0x41, 0x2f, 0x5c, 0xb3, 0x8c, 0xc2, 0x82, 0x74, 0xc4, 0xd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