mirror of https://github.com/docker/cli.git
4358 lines
111 KiB
Go
4358 lines
111 KiB
Go
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
|
// source: github.com/docker/swarmkit/api/dispatcher.proto
|
|
|
|
package api
|
|
|
|
import (
|
|
context "context"
|
|
fmt "fmt"
|
|
github_com_docker_swarmkit_api_deepcopy "github.com/docker/swarmkit/api/deepcopy"
|
|
raftselector "github.com/docker/swarmkit/manager/raftselector"
|
|
_ "github.com/docker/swarmkit/protobuf/plugin"
|
|
_ "github.com/gogo/protobuf/gogoproto"
|
|
proto "github.com/gogo/protobuf/proto"
|
|
_ "github.com/gogo/protobuf/types"
|
|
github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
metadata "google.golang.org/grpc/metadata"
|
|
peer "google.golang.org/grpc/peer"
|
|
status "google.golang.org/grpc/status"
|
|
io "io"
|
|
math "math"
|
|
reflect "reflect"
|
|
strings "strings"
|
|
rafttime "time"
|
|
time "time"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
var _ = time.Kitchen
|
|
|
|
// 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.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
|
|
|
type AssignmentChange_AssignmentAction int32
|
|
|
|
const (
|
|
AssignmentChange_AssignmentActionUpdate AssignmentChange_AssignmentAction = 0
|
|
AssignmentChange_AssignmentActionRemove AssignmentChange_AssignmentAction = 1
|
|
)
|
|
|
|
var AssignmentChange_AssignmentAction_name = map[int32]string{
|
|
0: "UPDATE",
|
|
1: "REMOVE",
|
|
}
|
|
|
|
var AssignmentChange_AssignmentAction_value = map[string]int32{
|
|
"UPDATE": 0,
|
|
"REMOVE": 1,
|
|
}
|
|
|
|
func (x AssignmentChange_AssignmentAction) String() string {
|
|
return proto.EnumName(AssignmentChange_AssignmentAction_name, int32(x))
|
|
}
|
|
|
|
func (AssignmentChange_AssignmentAction) EnumDescriptor() ([]byte, []int) {
|
|
return fileDescriptor_71002346457e55a8, []int{10, 0}
|
|
}
|
|
|
|
// AssignmentType specifies whether this assignment message carries
|
|
// the full state, or is an update to an existing state.
|
|
type AssignmentsMessage_Type int32
|
|
|
|
const (
|
|
AssignmentsMessage_COMPLETE AssignmentsMessage_Type = 0
|
|
AssignmentsMessage_INCREMENTAL AssignmentsMessage_Type = 1
|
|
)
|
|
|
|
var AssignmentsMessage_Type_name = map[int32]string{
|
|
0: "COMPLETE",
|
|
1: "INCREMENTAL",
|
|
}
|
|
|
|
var AssignmentsMessage_Type_value = map[string]int32{
|
|
"COMPLETE": 0,
|
|
"INCREMENTAL": 1,
|
|
}
|
|
|
|
func (x AssignmentsMessage_Type) String() string {
|
|
return proto.EnumName(AssignmentsMessage_Type_name, int32(x))
|
|
}
|
|
|
|
func (AssignmentsMessage_Type) EnumDescriptor() ([]byte, []int) {
|
|
return fileDescriptor_71002346457e55a8, []int{11, 0}
|
|
}
|
|
|
|
// SessionRequest starts a session.
|
|
type SessionRequest struct {
|
|
Description *NodeDescription `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
|
|
// SessionID can be provided to attempt resuming an existing session. If the
|
|
// SessionID is empty or invalid, a new SessionID will be assigned.
|
|
//
|
|
// See SessionMessage.SessionID for details.
|
|
SessionID string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
|
|
}
|
|
|
|
func (m *SessionRequest) Reset() { *m = SessionRequest{} }
|
|
func (*SessionRequest) ProtoMessage() {}
|
|
func (*SessionRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_71002346457e55a8, []int{0}
|
|
}
|
|
func (m *SessionRequest) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *SessionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_SessionRequest.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalTo(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *SessionRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_SessionRequest.Merge(m, src)
|
|
}
|
|
func (m *SessionRequest) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *SessionRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_SessionRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_SessionRequest proto.InternalMessageInfo
|
|
|
|
// SessionMessage instructs an agent on various actions as part of the current
|
|
// session. An agent should act immediately on the contents.
|
|
type SessionMessage struct {
|
|
// SessionID is allocated after a successful registration. It should be
|
|
// used on all RPC calls after registration. A dispatcher may choose to
|
|
// change the SessionID, at which time an agent must re-register and obtain
|
|
// a new one.
|
|
//
|
|
// All Dispatcher calls after register should include the SessionID. If the
|
|
// Dispatcher so chooses, it may reject the call with an InvalidArgument
|
|
// error code, at which time the agent should call Register to start a new
|
|
// session.
|
|
//
|
|
// As a rule, once an agent has a SessionID, it should never save it to
|
|
// disk or try to otherwise reuse. If the agent loses its SessionID, it
|
|
// must start a new session through a call to Register. A Dispatcher may
|
|
// choose to reuse the SessionID, if it sees fit, but it is not advised.
|
|
//
|
|
// The actual implementation of the SessionID is Dispatcher specific and
|
|
// should be treated as opaque by agents.
|
|
//
|
|
// From a Dispatcher perspective, there are many ways to use the SessionID
|
|
// to ensure uniqueness of a set of client RPC calls. One method is to keep
|
|
// the SessionID unique to every call to Register in a single Dispatcher
|
|
// instance. This ensures that the SessionID represents the unique
|
|
// session from a single Agent to Manager. If the Agent restarts, we
|
|
// allocate a new session, since the restarted Agent is not aware of the
|
|
// new SessionID.
|
|
//
|
|
// The most compelling use case is to support duplicate node detection. If
|
|
// one clones a virtual machine, including certificate material, two nodes
|
|
// may end up with the same identity. This can also happen if two identical
|
|
// agent processes are coming from the same node. If the SessionID is
|
|
// replicated through the cluster, we can immediately detect the condition
|
|
// and address it.
|
|
//
|
|
// Extending from the case above, we can actually detect a compromised
|
|
// identity. Coupled with provisions to rebuild node identity, we can ban
|
|
// the compromised node identity and have the nodes re-authenticate and
|
|
// build a new identity. At this time, an administrator can then
|
|
// re-authorize the compromised nodes, if it was a mistake or ensure that a
|
|
// misbehaved node can no longer connect to the cluster.
|
|
//
|
|
// We considered placing this field in a GRPC header. Because this is a
|
|
// critical feature of the protocol, we thought it should be represented
|
|
// directly in the RPC message set.
|
|
SessionID string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
|
|
// Node identifies the registering node.
|
|
Node *Node `protobuf:"bytes,2,opt,name=node,proto3" json:"node,omitempty"`
|
|
// Managers provides a weight list of alternative dispatchers
|
|
Managers []*WeightedPeer `protobuf:"bytes,3,rep,name=managers,proto3" json:"managers,omitempty"`
|
|
// Symmetric encryption key distributed by the lead manager. Used by agents
|
|
// for securing network bootstrapping and communication.
|
|
NetworkBootstrapKeys []*EncryptionKey `protobuf:"bytes,4,rep,name=network_bootstrap_keys,json=networkBootstrapKeys,proto3" json:"network_bootstrap_keys,omitempty"`
|
|
// Which root certificates to trust
|
|
RootCA []byte `protobuf:"bytes,5,opt,name=RootCA,proto3" json:"RootCA,omitempty"`
|
|
}
|
|
|
|
func (m *SessionMessage) Reset() { *m = SessionMessage{} }
|
|
func (*SessionMessage) ProtoMessage() {}
|
|
func (*SessionMessage) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_71002346457e55a8, []int{1}
|
|
}
|
|
func (m *SessionMessage) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *SessionMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_SessionMessage.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalTo(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *SessionMessage) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_SessionMessage.Merge(m, src)
|
|
}
|
|
func (m *SessionMessage) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *SessionMessage) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_SessionMessage.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_SessionMessage proto.InternalMessageInfo
|
|
|
|
// HeartbeatRequest provides identifying properties for a single heartbeat.
|
|
type HeartbeatRequest struct {
|
|
SessionID string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
|
|
}
|
|
|
|
func (m *HeartbeatRequest) Reset() { *m = HeartbeatRequest{} }
|
|
func (*HeartbeatRequest) ProtoMessage() {}
|
|
func (*HeartbeatRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_71002346457e55a8, []int{2}
|
|
}
|
|
func (m *HeartbeatRequest) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *HeartbeatRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_HeartbeatRequest.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalTo(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *HeartbeatRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_HeartbeatRequest.Merge(m, src)
|
|
}
|
|
func (m *HeartbeatRequest) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *HeartbeatRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_HeartbeatRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_HeartbeatRequest proto.InternalMessageInfo
|
|
|
|
type HeartbeatResponse struct {
|
|
// Period is the duration to wait before sending the next heartbeat.
|
|
// Well-behaved agents should update this on every heartbeat round trip.
|
|
Period time.Duration `protobuf:"bytes,1,opt,name=period,proto3,stdduration" json:"period"`
|
|
}
|
|
|
|
func (m *HeartbeatResponse) Reset() { *m = HeartbeatResponse{} }
|
|
func (*HeartbeatResponse) ProtoMessage() {}
|
|
func (*HeartbeatResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_71002346457e55a8, []int{3}
|
|
}
|
|
func (m *HeartbeatResponse) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *HeartbeatResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_HeartbeatResponse.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalTo(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *HeartbeatResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_HeartbeatResponse.Merge(m, src)
|
|
}
|
|
func (m *HeartbeatResponse) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *HeartbeatResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_HeartbeatResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_HeartbeatResponse proto.InternalMessageInfo
|
|
|
|
type UpdateTaskStatusRequest struct {
|
|
// Tasks should contain all statuses for running tasks. Only the status
|
|
// field must be set. The spec is not required.
|
|
SessionID string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
|
|
Updates []*UpdateTaskStatusRequest_TaskStatusUpdate `protobuf:"bytes,3,rep,name=updates,proto3" json:"updates,omitempty"`
|
|
}
|
|
|
|
func (m *UpdateTaskStatusRequest) Reset() { *m = UpdateTaskStatusRequest{} }
|
|
func (*UpdateTaskStatusRequest) ProtoMessage() {}
|
|
func (*UpdateTaskStatusRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_71002346457e55a8, []int{4}
|
|
}
|
|
func (m *UpdateTaskStatusRequest) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *UpdateTaskStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_UpdateTaskStatusRequest.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalTo(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *UpdateTaskStatusRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_UpdateTaskStatusRequest.Merge(m, src)
|
|
}
|
|
func (m *UpdateTaskStatusRequest) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *UpdateTaskStatusRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_UpdateTaskStatusRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_UpdateTaskStatusRequest proto.InternalMessageInfo
|
|
|
|
type UpdateTaskStatusRequest_TaskStatusUpdate struct {
|
|
TaskID string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
|
Status *TaskStatus `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
|
|
}
|
|
|
|
func (m *UpdateTaskStatusRequest_TaskStatusUpdate) Reset() {
|
|
*m = UpdateTaskStatusRequest_TaskStatusUpdate{}
|
|
}
|
|
func (*UpdateTaskStatusRequest_TaskStatusUpdate) ProtoMessage() {}
|
|
func (*UpdateTaskStatusRequest_TaskStatusUpdate) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_71002346457e55a8, []int{4, 0}
|
|
}
|
|
func (m *UpdateTaskStatusRequest_TaskStatusUpdate) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *UpdateTaskStatusRequest_TaskStatusUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_UpdateTaskStatusRequest_TaskStatusUpdate.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalTo(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *UpdateTaskStatusRequest_TaskStatusUpdate) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_UpdateTaskStatusRequest_TaskStatusUpdate.Merge(m, src)
|
|
}
|
|
func (m *UpdateTaskStatusRequest_TaskStatusUpdate) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *UpdateTaskStatusRequest_TaskStatusUpdate) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_UpdateTaskStatusRequest_TaskStatusUpdate.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_UpdateTaskStatusRequest_TaskStatusUpdate proto.InternalMessageInfo
|
|
|
|
type UpdateTaskStatusResponse struct {
|
|
}
|
|
|
|
func (m *UpdateTaskStatusResponse) Reset() { *m = UpdateTaskStatusResponse{} }
|
|
func (*UpdateTaskStatusResponse) ProtoMessage() {}
|
|
func (*UpdateTaskStatusResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_71002346457e55a8, []int{5}
|
|
}
|
|
func (m *UpdateTaskStatusResponse) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *UpdateTaskStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_UpdateTaskStatusResponse.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalTo(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *UpdateTaskStatusResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_UpdateTaskStatusResponse.Merge(m, src)
|
|
}
|
|
func (m *UpdateTaskStatusResponse) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *UpdateTaskStatusResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_UpdateTaskStatusResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_UpdateTaskStatusResponse proto.InternalMessageInfo
|
|
|
|
type TasksRequest struct {
|
|
SessionID string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
|
|
}
|
|
|
|
func (m *TasksRequest) Reset() { *m = TasksRequest{} }
|
|
func (*TasksRequest) ProtoMessage() {}
|
|
func (*TasksRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_71002346457e55a8, []int{6}
|
|
}
|
|
func (m *TasksRequest) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *TasksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_TasksRequest.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalTo(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *TasksRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_TasksRequest.Merge(m, src)
|
|
}
|
|
func (m *TasksRequest) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *TasksRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_TasksRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_TasksRequest proto.InternalMessageInfo
|
|
|
|
type TasksMessage struct {
|
|
// Tasks is the set of tasks that should be running on the node.
|
|
// Tasks outside of this set running on the node should be terminated.
|
|
Tasks []*Task `protobuf:"bytes,1,rep,name=tasks,proto3" json:"tasks,omitempty"`
|
|
}
|
|
|
|
func (m *TasksMessage) Reset() { *m = TasksMessage{} }
|
|
func (*TasksMessage) ProtoMessage() {}
|
|
func (*TasksMessage) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_71002346457e55a8, []int{7}
|
|
}
|
|
func (m *TasksMessage) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *TasksMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_TasksMessage.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalTo(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *TasksMessage) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_TasksMessage.Merge(m, src)
|
|
}
|
|
func (m *TasksMessage) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *TasksMessage) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_TasksMessage.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_TasksMessage proto.InternalMessageInfo
|
|
|
|
type AssignmentsRequest struct {
|
|
SessionID string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
|
|
}
|
|
|
|
func (m *AssignmentsRequest) Reset() { *m = AssignmentsRequest{} }
|
|
func (*AssignmentsRequest) ProtoMessage() {}
|
|
func (*AssignmentsRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_71002346457e55a8, []int{8}
|
|
}
|
|
func (m *AssignmentsRequest) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *AssignmentsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_AssignmentsRequest.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalTo(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *AssignmentsRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_AssignmentsRequest.Merge(m, src)
|
|
}
|
|
func (m *AssignmentsRequest) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *AssignmentsRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_AssignmentsRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_AssignmentsRequest proto.InternalMessageInfo
|
|
|
|
type Assignment struct {
|
|
// Types that are valid to be assigned to Item:
|
|
// *Assignment_Task
|
|
// *Assignment_Secret
|
|
// *Assignment_Config
|
|
Item isAssignment_Item `protobuf_oneof:"item"`
|
|
}
|
|
|
|
func (m *Assignment) Reset() { *m = Assignment{} }
|
|
func (*Assignment) ProtoMessage() {}
|
|
func (*Assignment) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_71002346457e55a8, []int{9}
|
|
}
|
|
func (m *Assignment) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *Assignment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_Assignment.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalTo(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *Assignment) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Assignment.Merge(m, src)
|
|
}
|
|
func (m *Assignment) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *Assignment) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Assignment.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Assignment proto.InternalMessageInfo
|
|
|
|
type isAssignment_Item interface {
|
|
isAssignment_Item()
|
|
MarshalTo([]byte) (int, error)
|
|
Size() int
|
|
}
|
|
|
|
type Assignment_Task struct {
|
|
Task *Task `protobuf:"bytes,1,opt,name=task,proto3,oneof"`
|
|
}
|
|
type Assignment_Secret struct {
|
|
Secret *Secret `protobuf:"bytes,2,opt,name=secret,proto3,oneof"`
|
|
}
|
|
type Assignment_Config struct {
|
|
Config *Config `protobuf:"bytes,3,opt,name=config,proto3,oneof"`
|
|
}
|
|
|
|
func (*Assignment_Task) isAssignment_Item() {}
|
|
func (*Assignment_Secret) isAssignment_Item() {}
|
|
func (*Assignment_Config) isAssignment_Item() {}
|
|
|
|
func (m *Assignment) GetItem() isAssignment_Item {
|
|
if m != nil {
|
|
return m.Item
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Assignment) GetTask() *Task {
|
|
if x, ok := m.GetItem().(*Assignment_Task); ok {
|
|
return x.Task
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Assignment) GetSecret() *Secret {
|
|
if x, ok := m.GetItem().(*Assignment_Secret); ok {
|
|
return x.Secret
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Assignment) GetConfig() *Config {
|
|
if x, ok := m.GetItem().(*Assignment_Config); ok {
|
|
return x.Config
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// XXX_OneofFuncs is for the internal use of the proto package.
|
|
func (*Assignment) 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 _Assignment_OneofMarshaler, _Assignment_OneofUnmarshaler, _Assignment_OneofSizer, []interface{}{
|
|
(*Assignment_Task)(nil),
|
|
(*Assignment_Secret)(nil),
|
|
(*Assignment_Config)(nil),
|
|
}
|
|
}
|
|
|
|
func _Assignment_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
|
|
m := msg.(*Assignment)
|
|
// item
|
|
switch x := m.Item.(type) {
|
|
case *Assignment_Task:
|
|
_ = b.EncodeVarint(1<<3 | proto.WireBytes)
|
|
if err := b.EncodeMessage(x.Task); err != nil {
|
|
return err
|
|
}
|
|
case *Assignment_Secret:
|
|
_ = b.EncodeVarint(2<<3 | proto.WireBytes)
|
|
if err := b.EncodeMessage(x.Secret); err != nil {
|
|
return err
|
|
}
|
|
case *Assignment_Config:
|
|
_ = b.EncodeVarint(3<<3 | proto.WireBytes)
|
|
if err := b.EncodeMessage(x.Config); err != nil {
|
|
return err
|
|
}
|
|
case nil:
|
|
default:
|
|
return fmt.Errorf("Assignment.Item has unexpected type %T", x)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func _Assignment_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
|
|
m := msg.(*Assignment)
|
|
switch tag {
|
|
case 1: // item.task
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
msg := new(Task)
|
|
err := b.DecodeMessage(msg)
|
|
m.Item = &Assignment_Task{msg}
|
|
return true, err
|
|
case 2: // item.secret
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
msg := new(Secret)
|
|
err := b.DecodeMessage(msg)
|
|
m.Item = &Assignment_Secret{msg}
|
|
return true, err
|
|
case 3: // item.config
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
msg := new(Config)
|
|
err := b.DecodeMessage(msg)
|
|
m.Item = &Assignment_Config{msg}
|
|
return true, err
|
|
default:
|
|
return false, nil
|
|
}
|
|
}
|
|
|
|
func _Assignment_OneofSizer(msg proto.Message) (n int) {
|
|
m := msg.(*Assignment)
|
|
// item
|
|
switch x := m.Item.(type) {
|
|
case *Assignment_Task:
|
|
s := proto.Size(x.Task)
|
|
n += 1 // tag and wire
|
|
n += proto.SizeVarint(uint64(s))
|
|
n += s
|
|
case *Assignment_Secret:
|
|
s := proto.Size(x.Secret)
|
|
n += 1 // tag and wire
|
|
n += proto.SizeVarint(uint64(s))
|
|
n += s
|
|
case *Assignment_Config:
|
|
s := proto.Size(x.Config)
|
|
n += 1 // tag and wire
|
|
n += proto.SizeVarint(uint64(s))
|
|
n += s
|
|
case nil:
|
|
default:
|
|
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
|
|
}
|
|
return n
|
|
}
|
|
|
|
type AssignmentChange struct {
|
|
Assignment *Assignment `protobuf:"bytes,1,opt,name=assignment,proto3" json:"assignment,omitempty"`
|
|
Action AssignmentChange_AssignmentAction `protobuf:"varint,2,opt,name=action,proto3,enum=docker.swarmkit.v1.AssignmentChange_AssignmentAction" json:"action,omitempty"`
|
|
}
|
|
|
|
func (m *AssignmentChange) Reset() { *m = AssignmentChange{} }
|
|
func (*AssignmentChange) ProtoMessage() {}
|
|
func (*AssignmentChange) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_71002346457e55a8, []int{10}
|
|
}
|
|
func (m *AssignmentChange) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *AssignmentChange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_AssignmentChange.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalTo(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *AssignmentChange) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_AssignmentChange.Merge(m, src)
|
|
}
|
|
func (m *AssignmentChange) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *AssignmentChange) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_AssignmentChange.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_AssignmentChange proto.InternalMessageInfo
|
|
|
|
type AssignmentsMessage struct {
|
|
Type AssignmentsMessage_Type `protobuf:"varint,1,opt,name=type,proto3,enum=docker.swarmkit.v1.AssignmentsMessage_Type" json:"type,omitempty"`
|
|
// AppliesTo references the previous ResultsIn value, to chain
|
|
// incremental updates together. For the first update in a stream,
|
|
// AppliesTo is empty. If AppliesTo does not match the previously
|
|
// received ResultsIn, the consumer of the stream should start a new
|
|
// Assignments stream to re-sync.
|
|
AppliesTo string `protobuf:"bytes,2,opt,name=applies_to,json=appliesTo,proto3" json:"applies_to,omitempty"`
|
|
// ResultsIn identifies the result of this assignments message, to
|
|
// match against the next message's AppliesTo value and protect
|
|
// against missed messages.
|
|
ResultsIn string `protobuf:"bytes,3,opt,name=results_in,json=resultsIn,proto3" json:"results_in,omitempty"`
|
|
// AssignmentChange is a set of changes to apply on this node.
|
|
Changes []*AssignmentChange `protobuf:"bytes,4,rep,name=changes,proto3" json:"changes,omitempty"`
|
|
}
|
|
|
|
func (m *AssignmentsMessage) Reset() { *m = AssignmentsMessage{} }
|
|
func (*AssignmentsMessage) ProtoMessage() {}
|
|
func (*AssignmentsMessage) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_71002346457e55a8, []int{11}
|
|
}
|
|
func (m *AssignmentsMessage) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *AssignmentsMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_AssignmentsMessage.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalTo(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *AssignmentsMessage) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_AssignmentsMessage.Merge(m, src)
|
|
}
|
|
func (m *AssignmentsMessage) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *AssignmentsMessage) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_AssignmentsMessage.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_AssignmentsMessage proto.InternalMessageInfo
|
|
|
|
func init() {
|
|
proto.RegisterEnum("docker.swarmkit.v1.AssignmentChange_AssignmentAction", AssignmentChange_AssignmentAction_name, AssignmentChange_AssignmentAction_value)
|
|
proto.RegisterEnum("docker.swarmkit.v1.AssignmentsMessage_Type", AssignmentsMessage_Type_name, AssignmentsMessage_Type_value)
|
|
proto.RegisterType((*SessionRequest)(nil), "docker.swarmkit.v1.SessionRequest")
|
|
proto.RegisterType((*SessionMessage)(nil), "docker.swarmkit.v1.SessionMessage")
|
|
proto.RegisterType((*HeartbeatRequest)(nil), "docker.swarmkit.v1.HeartbeatRequest")
|
|
proto.RegisterType((*HeartbeatResponse)(nil), "docker.swarmkit.v1.HeartbeatResponse")
|
|
proto.RegisterType((*UpdateTaskStatusRequest)(nil), "docker.swarmkit.v1.UpdateTaskStatusRequest")
|
|
proto.RegisterType((*UpdateTaskStatusRequest_TaskStatusUpdate)(nil), "docker.swarmkit.v1.UpdateTaskStatusRequest.TaskStatusUpdate")
|
|
proto.RegisterType((*UpdateTaskStatusResponse)(nil), "docker.swarmkit.v1.UpdateTaskStatusResponse")
|
|
proto.RegisterType((*TasksRequest)(nil), "docker.swarmkit.v1.TasksRequest")
|
|
proto.RegisterType((*TasksMessage)(nil), "docker.swarmkit.v1.TasksMessage")
|
|
proto.RegisterType((*AssignmentsRequest)(nil), "docker.swarmkit.v1.AssignmentsRequest")
|
|
proto.RegisterType((*Assignment)(nil), "docker.swarmkit.v1.Assignment")
|
|
proto.RegisterType((*AssignmentChange)(nil), "docker.swarmkit.v1.AssignmentChange")
|
|
proto.RegisterType((*AssignmentsMessage)(nil), "docker.swarmkit.v1.AssignmentsMessage")
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterFile("github.com/docker/swarmkit/api/dispatcher.proto", fileDescriptor_71002346457e55a8)
|
|
}
|
|
|
|
var fileDescriptor_71002346457e55a8 = []byte{
|
|
// 1019 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcf, 0x4f, 0x1b, 0x47,
|
|
0x18, 0xf5, 0x18, 0xb3, 0xe0, 0xcf, 0x84, 0xba, 0xa3, 0x88, 0xba, 0x96, 0xb2, 0xb8, 0x4b, 0x82,
|
|
0x50, 0x43, 0xd7, 0xa9, 0xfb, 0xeb, 0x50, 0x44, 0x8b, 0xb1, 0x25, 0xac, 0x04, 0x82, 0x06, 0x92,
|
|
0x1c, 0xd1, 0x7a, 0x77, 0xb2, 0x6c, 0x8d, 0x77, 0xb6, 0x3b, 0xe3, 0xa4, 0x3e, 0x54, 0xea, 0xa1,
|
|
0x91, 0xaa, 0x9e, 0xa2, 0x9e, 0x90, 0xaa, 0xfe, 0x0b, 0x55, 0xff, 0x0c, 0xd4, 0x53, 0x8e, 0x39,
|
|
0xd1, 0xc6, 0xdc, 0xfb, 0x07, 0xf4, 0x54, 0xed, 0xec, 0xac, 0xed, 0x12, 0x1b, 0x0c, 0x27, 0x7b,
|
|
0x67, 0xde, 0x7b, 0xf3, 0xf6, 0x7d, 0xdf, 0x7e, 0x03, 0x65, 0xd7, 0x13, 0x87, 0x9d, 0xa6, 0x69,
|
|
0xb3, 0x76, 0xd9, 0x61, 0x76, 0x8b, 0x86, 0x65, 0xfe, 0xdc, 0x0a, 0xdb, 0x2d, 0x4f, 0x94, 0xad,
|
|
0xc0, 0x2b, 0x3b, 0x1e, 0x0f, 0x2c, 0x61, 0x1f, 0xd2, 0xd0, 0x0c, 0x42, 0x26, 0x18, 0xc6, 0x31,
|
|
0xca, 0x4c, 0x50, 0xe6, 0xb3, 0x8f, 0x8b, 0x1f, 0x5e, 0x22, 0x22, 0xba, 0x01, 0xe5, 0x31, 0xbf,
|
|
0xb8, 0x7a, 0x09, 0x96, 0x35, 0xbf, 0xa1, 0xb6, 0x48, 0xd0, 0x37, 0x5d, 0xe6, 0x32, 0xf9, 0xb7,
|
|
0x1c, 0xfd, 0x53, 0xab, 0x5f, 0x5c, 0xa0, 0x21, 0x11, 0xcd, 0xce, 0xd3, 0x72, 0x70, 0xd4, 0x71,
|
|
0x3d, 0x5f, 0xfd, 0x28, 0xa2, 0xee, 0x32, 0xe6, 0x1e, 0xd1, 0x01, 0xc8, 0xe9, 0x84, 0x96, 0xf0,
|
|
0x98, 0xda, 0x37, 0x5e, 0x20, 0x98, 0xdf, 0xa3, 0x9c, 0x7b, 0xcc, 0x27, 0xf4, 0xdb, 0x0e, 0xe5,
|
|
0x02, 0xd7, 0x21, 0xe7, 0x50, 0x6e, 0x87, 0x5e, 0x10, 0xe1, 0x0a, 0xa8, 0x84, 0x56, 0x72, 0x95,
|
|
0x25, 0xf3, 0xed, 0x14, 0xcc, 0x1d, 0xe6, 0xd0, 0xda, 0x00, 0x4a, 0x86, 0x79, 0x78, 0x15, 0x80,
|
|
0xc7, 0xc2, 0x07, 0x9e, 0x53, 0x48, 0x97, 0xd0, 0x4a, 0xb6, 0x7a, 0xa3, 0x77, 0xba, 0x98, 0x55,
|
|
0xc7, 0x35, 0x6a, 0x24, 0xab, 0x00, 0x0d, 0xc7, 0xf8, 0x35, 0xdd, 0xf7, 0xb1, 0x4d, 0x39, 0xb7,
|
|
0x5c, 0x7a, 0x4e, 0x00, 0x5d, 0x2c, 0x80, 0x57, 0x21, 0xe3, 0x33, 0x87, 0xca, 0x83, 0x72, 0x95,
|
|
0xc2, 0x38, 0xbb, 0x44, 0xa2, 0xf0, 0x1a, 0xcc, 0xb6, 0x2d, 0xdf, 0x72, 0x69, 0xc8, 0x0b, 0x53,
|
|
0xa5, 0xa9, 0x95, 0x5c, 0xa5, 0x34, 0x8a, 0xf1, 0x84, 0x7a, 0xee, 0xa1, 0xa0, 0xce, 0x2e, 0xa5,
|
|
0x21, 0xe9, 0x33, 0xf0, 0x13, 0x58, 0xf0, 0xa9, 0x78, 0xce, 0xc2, 0xd6, 0x41, 0x93, 0x31, 0xc1,
|
|
0x45, 0x68, 0x05, 0x07, 0x2d, 0xda, 0xe5, 0x85, 0x8c, 0xd4, 0xfa, 0x60, 0x94, 0x56, 0xdd, 0xb7,
|
|
0xc3, 0xae, 0x8c, 0xe6, 0x3e, 0xed, 0x92, 0x9b, 0x4a, 0xa0, 0x9a, 0xf0, 0xef, 0xd3, 0x2e, 0xc7,
|
|
0x0b, 0xa0, 0x11, 0xc6, 0xc4, 0xe6, 0x46, 0x61, 0xba, 0x84, 0x56, 0xe6, 0x88, 0x7a, 0x32, 0xbe,
|
|
0x86, 0xfc, 0x16, 0xb5, 0x42, 0xd1, 0xa4, 0x96, 0x48, 0xca, 0x74, 0xa5, 0x78, 0x8c, 0x5d, 0x78,
|
|
0x77, 0x48, 0x81, 0x07, 0xcc, 0xe7, 0x14, 0x7f, 0x09, 0x5a, 0x40, 0x43, 0x8f, 0x39, 0xaa, 0xc8,
|
|
0xef, 0x9b, 0x71, 0xb7, 0x98, 0x49, 0xb7, 0x98, 0x35, 0xd5, 0x2d, 0xd5, 0xd9, 0x93, 0xd3, 0xc5,
|
|
0xd4, 0xf1, 0x5f, 0x8b, 0x88, 0x28, 0x8a, 0xf1, 0x32, 0x0d, 0xef, 0x3d, 0x0a, 0x1c, 0x4b, 0xd0,
|
|
0x7d, 0x8b, 0xb7, 0xf6, 0x84, 0x25, 0x3a, 0xfc, 0x5a, 0xde, 0xf0, 0x63, 0x98, 0xe9, 0x48, 0xa1,
|
|
0xa4, 0x16, 0x6b, 0xa3, 0xf2, 0x1b, 0x73, 0x96, 0x39, 0x58, 0x89, 0x11, 0x24, 0x11, 0x2b, 0x32,
|
|
0xc8, 0x9f, 0xdf, 0xc4, 0x4b, 0x30, 0x23, 0x2c, 0xde, 0x1a, 0xd8, 0x82, 0xde, 0xe9, 0xa2, 0x16,
|
|
0xc1, 0x1a, 0x35, 0xa2, 0x45, 0x5b, 0x0d, 0x07, 0x7f, 0x0e, 0x1a, 0x97, 0x24, 0xd5, 0x4d, 0xfa,
|
|
0x28, 0x3f, 0x43, 0x4e, 0x14, 0xda, 0x28, 0x42, 0xe1, 0x6d, 0x97, 0x71, 0xd6, 0xc6, 0x1a, 0xcc,
|
|
0x45, 0xab, 0xd7, 0x8b, 0xc8, 0x58, 0x57, 0xec, 0xe4, 0xdb, 0x30, 0x61, 0x3a, 0xf2, 0xca, 0x0b,
|
|
0x48, 0x06, 0x56, 0x18, 0x67, 0x90, 0xc4, 0x30, 0xa3, 0x0a, 0x78, 0x83, 0x73, 0xcf, 0xf5, 0xdb,
|
|
0xd4, 0x17, 0xd7, 0xf4, 0xf0, 0x07, 0x02, 0x18, 0x88, 0x60, 0x13, 0x32, 0x91, 0xb6, 0x6a, 0x9d,
|
|
0xb1, 0x0e, 0xb6, 0x52, 0x44, 0xe2, 0xf0, 0xa7, 0xa0, 0x71, 0x6a, 0x87, 0x54, 0xa8, 0x50, 0x8b,
|
|
0xa3, 0x18, 0x7b, 0x12, 0xb1, 0x95, 0x22, 0x0a, 0x1b, 0xb1, 0x6c, 0xe6, 0x3f, 0xf5, 0xdc, 0xc2,
|
|
0xd4, 0x78, 0xd6, 0xa6, 0x44, 0x44, 0xac, 0x18, 0x5b, 0xd5, 0x20, 0xe3, 0x09, 0xda, 0x36, 0x5e,
|
|
0xa4, 0x21, 0x3f, 0xb0, 0xbc, 0x79, 0x68, 0xf9, 0x2e, 0xc5, 0xeb, 0x00, 0x56, 0x7f, 0x4d, 0xd9,
|
|
0x1f, 0x59, 0xe1, 0x01, 0x93, 0x0c, 0x31, 0xf0, 0x36, 0x68, 0x96, 0x2d, 0x47, 0x63, 0xf4, 0x22,
|
|
0xf3, 0x95, 0xcf, 0x2e, 0xe6, 0xc6, 0xa7, 0x0e, 0x2d, 0x6c, 0x48, 0x32, 0x51, 0x22, 0x46, 0x73,
|
|
0xd8, 0x62, 0xbc, 0x87, 0x97, 0x41, 0x7b, 0xb4, 0x5b, 0xdb, 0xd8, 0xaf, 0xe7, 0x53, 0xc5, 0xe2,
|
|
0xcf, 0xbf, 0x95, 0x16, 0xce, 0x23, 0x54, 0x37, 0x2f, 0x83, 0x46, 0xea, 0xdb, 0x0f, 0x1f, 0xd7,
|
|
0xf3, 0x68, 0x34, 0x8e, 0xd0, 0x36, 0x7b, 0x46, 0x8d, 0x7f, 0xd1, 0xff, 0xea, 0x9f, 0x74, 0xd1,
|
|
0x57, 0x90, 0x89, 0x2e, 0x2a, 0x99, 0xc1, 0x7c, 0xe5, 0xee, 0xc5, 0xef, 0x91, 0xb0, 0xcc, 0xfd,
|
|
0x6e, 0x40, 0x89, 0x24, 0xe2, 0x5b, 0x00, 0x56, 0x10, 0x1c, 0x79, 0x94, 0x1f, 0x08, 0x16, 0xcf,
|
|
0x78, 0x92, 0x55, 0x2b, 0xfb, 0x2c, 0xda, 0x0e, 0x29, 0xef, 0x1c, 0x09, 0x7e, 0xe0, 0xf9, 0xb2,
|
|
0x80, 0x59, 0x92, 0x55, 0x2b, 0x0d, 0x1f, 0xaf, 0xc3, 0x8c, 0x2d, 0xc3, 0x49, 0xe6, 0xe6, 0xed,
|
|
0x49, 0x92, 0x24, 0x09, 0xc9, 0xb8, 0x03, 0x99, 0xc8, 0x0b, 0x9e, 0x83, 0xd9, 0xcd, 0x87, 0xdb,
|
|
0xbb, 0x0f, 0xea, 0x51, 0x5e, 0xf8, 0x1d, 0xc8, 0x35, 0x76, 0x36, 0x49, 0x7d, 0xbb, 0xbe, 0xb3,
|
|
0xbf, 0xf1, 0x20, 0x8f, 0x2a, 0xc7, 0xd3, 0x00, 0xb5, 0xfe, 0xa5, 0x8e, 0xbf, 0x83, 0x19, 0xd5,
|
|
0xde, 0xd8, 0x18, 0xdd, 0x82, 0xc3, 0xb7, 0x61, 0xf1, 0x22, 0x8c, 0x4a, 0xc4, 0x58, 0xfa, 0xf3,
|
|
0xf7, 0x7f, 0x8e, 0xd3, 0xb7, 0x60, 0x4e, 0x62, 0x3e, 0x8a, 0xe6, 0x3a, 0x0d, 0xe1, 0x46, 0xfc,
|
|
0xa4, 0x6e, 0x8d, 0x7b, 0x08, 0x7f, 0x0f, 0xd9, 0xfe, 0x0c, 0xc6, 0x23, 0xdf, 0xf5, 0xfc, 0x90,
|
|
0x2f, 0xde, 0xb9, 0x04, 0xa5, 0x86, 0xcb, 0x24, 0x06, 0xf0, 0x2f, 0x08, 0xf2, 0xe7, 0xc7, 0x13,
|
|
0xbe, 0x7b, 0x85, 0x51, 0x5b, 0x5c, 0x9d, 0x0c, 0x7c, 0x15, 0x53, 0x1d, 0x98, 0x96, 0x83, 0x0d,
|
|
0x97, 0xc6, 0x0d, 0x90, 0xfe, 0xe9, 0xe3, 0x11, 0x49, 0x1d, 0x96, 0x27, 0x38, 0xf1, 0xa7, 0x34,
|
|
0xba, 0x87, 0xf0, 0x8f, 0x08, 0x72, 0x43, 0xad, 0x8d, 0x97, 0x2f, 0xe9, 0xfd, 0xc4, 0xc3, 0xf2,
|
|
0x64, 0xdf, 0xc8, 0x84, 0x1d, 0x51, 0xbd, 0x7d, 0xf2, 0x46, 0x4f, 0xbd, 0x7e, 0xa3, 0xa7, 0x7e,
|
|
0xe8, 0xe9, 0xe8, 0xa4, 0xa7, 0xa3, 0x57, 0x3d, 0x1d, 0xfd, 0xdd, 0xd3, 0xd1, 0xcb, 0x33, 0x3d,
|
|
0xf5, 0xea, 0x4c, 0x4f, 0xbd, 0x3e, 0xd3, 0x53, 0x4d, 0x4d, 0x5e, 0xc7, 0x9f, 0xfc, 0x17, 0x00,
|
|
0x00, 0xff, 0xff, 0xa9, 0xc4, 0x36, 0xaa, 0xba, 0x0a, 0x00, 0x00,
|
|
}
|
|
|
|
type authenticatedWrapperDispatcherServer struct {
|
|
local DispatcherServer
|
|
authorize func(context.Context, []string) error
|
|
}
|
|
|
|
func NewAuthenticatedWrapperDispatcherServer(local DispatcherServer, authorize func(context.Context, []string) error) DispatcherServer {
|
|
return &authenticatedWrapperDispatcherServer{
|
|
local: local,
|
|
authorize: authorize,
|
|
}
|
|
}
|
|
|
|
func (p *authenticatedWrapperDispatcherServer) Session(r *SessionRequest, stream Dispatcher_SessionServer) error {
|
|
|
|
if err := p.authorize(stream.Context(), []string{"swarm-worker", "swarm-manager"}); err != nil {
|
|
return err
|
|
}
|
|
return p.local.Session(r, stream)
|
|
}
|
|
|
|
func (p *authenticatedWrapperDispatcherServer) Heartbeat(ctx context.Context, r *HeartbeatRequest) (*HeartbeatResponse, error) {
|
|
|
|
if err := p.authorize(ctx, []string{"swarm-worker", "swarm-manager"}); err != nil {
|
|
return nil, err
|
|
}
|
|
return p.local.Heartbeat(ctx, r)
|
|
}
|
|
|
|
func (p *authenticatedWrapperDispatcherServer) UpdateTaskStatus(ctx context.Context, r *UpdateTaskStatusRequest) (*UpdateTaskStatusResponse, error) {
|
|
|
|
if err := p.authorize(ctx, []string{"swarm-worker", "swarm-manager"}); err != nil {
|
|
return nil, err
|
|
}
|
|
return p.local.UpdateTaskStatus(ctx, r)
|
|
}
|
|
|
|
func (p *authenticatedWrapperDispatcherServer) Tasks(r *TasksRequest, stream Dispatcher_TasksServer) error {
|
|
|
|
if err := p.authorize(stream.Context(), []string{"swarm-worker", "swarm-manager"}); err != nil {
|
|
return err
|
|
}
|
|
return p.local.Tasks(r, stream)
|
|
}
|
|
|
|
func (p *authenticatedWrapperDispatcherServer) Assignments(r *AssignmentsRequest, stream Dispatcher_AssignmentsServer) error {
|
|
|
|
if err := p.authorize(stream.Context(), []string{"swarm-worker", "swarm-manager"}); err != nil {
|
|
return err
|
|
}
|
|
return p.local.Assignments(r, stream)
|
|
}
|
|
|
|
func (m *SessionRequest) Copy() *SessionRequest {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
o := &SessionRequest{}
|
|
o.CopyFrom(m)
|
|
return o
|
|
}
|
|
|
|
func (m *SessionRequest) CopyFrom(src interface{}) {
|
|
|
|
o := src.(*SessionRequest)
|
|
*m = *o
|
|
if o.Description != nil {
|
|
m.Description = &NodeDescription{}
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(m.Description, o.Description)
|
|
}
|
|
}
|
|
|
|
func (m *SessionMessage) Copy() *SessionMessage {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
o := &SessionMessage{}
|
|
o.CopyFrom(m)
|
|
return o
|
|
}
|
|
|
|
func (m *SessionMessage) CopyFrom(src interface{}) {
|
|
|
|
o := src.(*SessionMessage)
|
|
*m = *o
|
|
if o.Node != nil {
|
|
m.Node = &Node{}
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(m.Node, o.Node)
|
|
}
|
|
if o.Managers != nil {
|
|
m.Managers = make([]*WeightedPeer, len(o.Managers))
|
|
for i := range m.Managers {
|
|
m.Managers[i] = &WeightedPeer{}
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(m.Managers[i], o.Managers[i])
|
|
}
|
|
}
|
|
|
|
if o.NetworkBootstrapKeys != nil {
|
|
m.NetworkBootstrapKeys = make([]*EncryptionKey, len(o.NetworkBootstrapKeys))
|
|
for i := range m.NetworkBootstrapKeys {
|
|
m.NetworkBootstrapKeys[i] = &EncryptionKey{}
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(m.NetworkBootstrapKeys[i], o.NetworkBootstrapKeys[i])
|
|
}
|
|
}
|
|
|
|
if o.RootCA != nil {
|
|
m.RootCA = make([]byte, len(o.RootCA))
|
|
copy(m.RootCA, o.RootCA)
|
|
}
|
|
}
|
|
|
|
func (m *HeartbeatRequest) Copy() *HeartbeatRequest {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
o := &HeartbeatRequest{}
|
|
o.CopyFrom(m)
|
|
return o
|
|
}
|
|
|
|
func (m *HeartbeatRequest) CopyFrom(src interface{}) {
|
|
|
|
o := src.(*HeartbeatRequest)
|
|
*m = *o
|
|
}
|
|
|
|
func (m *HeartbeatResponse) Copy() *HeartbeatResponse {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
o := &HeartbeatResponse{}
|
|
o.CopyFrom(m)
|
|
return o
|
|
}
|
|
|
|
func (m *HeartbeatResponse) CopyFrom(src interface{}) {
|
|
|
|
o := src.(*HeartbeatResponse)
|
|
*m = *o
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(&m.Period, &o.Period)
|
|
}
|
|
|
|
func (m *UpdateTaskStatusRequest) Copy() *UpdateTaskStatusRequest {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
o := &UpdateTaskStatusRequest{}
|
|
o.CopyFrom(m)
|
|
return o
|
|
}
|
|
|
|
func (m *UpdateTaskStatusRequest) CopyFrom(src interface{}) {
|
|
|
|
o := src.(*UpdateTaskStatusRequest)
|
|
*m = *o
|
|
if o.Updates != nil {
|
|
m.Updates = make([]*UpdateTaskStatusRequest_TaskStatusUpdate, len(o.Updates))
|
|
for i := range m.Updates {
|
|
m.Updates[i] = &UpdateTaskStatusRequest_TaskStatusUpdate{}
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(m.Updates[i], o.Updates[i])
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
func (m *UpdateTaskStatusRequest_TaskStatusUpdate) Copy() *UpdateTaskStatusRequest_TaskStatusUpdate {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
o := &UpdateTaskStatusRequest_TaskStatusUpdate{}
|
|
o.CopyFrom(m)
|
|
return o
|
|
}
|
|
|
|
func (m *UpdateTaskStatusRequest_TaskStatusUpdate) CopyFrom(src interface{}) {
|
|
|
|
o := src.(*UpdateTaskStatusRequest_TaskStatusUpdate)
|
|
*m = *o
|
|
if o.Status != nil {
|
|
m.Status = &TaskStatus{}
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(m.Status, o.Status)
|
|
}
|
|
}
|
|
|
|
func (m *UpdateTaskStatusResponse) Copy() *UpdateTaskStatusResponse {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
o := &UpdateTaskStatusResponse{}
|
|
o.CopyFrom(m)
|
|
return o
|
|
}
|
|
|
|
func (m *UpdateTaskStatusResponse) CopyFrom(src interface{}) {}
|
|
func (m *TasksRequest) Copy() *TasksRequest {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
o := &TasksRequest{}
|
|
o.CopyFrom(m)
|
|
return o
|
|
}
|
|
|
|
func (m *TasksRequest) CopyFrom(src interface{}) {
|
|
|
|
o := src.(*TasksRequest)
|
|
*m = *o
|
|
}
|
|
|
|
func (m *TasksMessage) Copy() *TasksMessage {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
o := &TasksMessage{}
|
|
o.CopyFrom(m)
|
|
return o
|
|
}
|
|
|
|
func (m *TasksMessage) CopyFrom(src interface{}) {
|
|
|
|
o := src.(*TasksMessage)
|
|
*m = *o
|
|
if o.Tasks != nil {
|
|
m.Tasks = make([]*Task, len(o.Tasks))
|
|
for i := range m.Tasks {
|
|
m.Tasks[i] = &Task{}
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(m.Tasks[i], o.Tasks[i])
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
func (m *AssignmentsRequest) Copy() *AssignmentsRequest {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
o := &AssignmentsRequest{}
|
|
o.CopyFrom(m)
|
|
return o
|
|
}
|
|
|
|
func (m *AssignmentsRequest) CopyFrom(src interface{}) {
|
|
|
|
o := src.(*AssignmentsRequest)
|
|
*m = *o
|
|
}
|
|
|
|
func (m *Assignment) Copy() *Assignment {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
o := &Assignment{}
|
|
o.CopyFrom(m)
|
|
return o
|
|
}
|
|
|
|
func (m *Assignment) CopyFrom(src interface{}) {
|
|
|
|
o := src.(*Assignment)
|
|
*m = *o
|
|
if o.Item != nil {
|
|
switch o.Item.(type) {
|
|
case *Assignment_Task:
|
|
v := Assignment_Task{
|
|
Task: &Task{},
|
|
}
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(v.Task, o.GetTask())
|
|
m.Item = &v
|
|
case *Assignment_Secret:
|
|
v := Assignment_Secret{
|
|
Secret: &Secret{},
|
|
}
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(v.Secret, o.GetSecret())
|
|
m.Item = &v
|
|
case *Assignment_Config:
|
|
v := Assignment_Config{
|
|
Config: &Config{},
|
|
}
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(v.Config, o.GetConfig())
|
|
m.Item = &v
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
func (m *AssignmentChange) Copy() *AssignmentChange {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
o := &AssignmentChange{}
|
|
o.CopyFrom(m)
|
|
return o
|
|
}
|
|
|
|
func (m *AssignmentChange) CopyFrom(src interface{}) {
|
|
|
|
o := src.(*AssignmentChange)
|
|
*m = *o
|
|
if o.Assignment != nil {
|
|
m.Assignment = &Assignment{}
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(m.Assignment, o.Assignment)
|
|
}
|
|
}
|
|
|
|
func (m *AssignmentsMessage) Copy() *AssignmentsMessage {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
o := &AssignmentsMessage{}
|
|
o.CopyFrom(m)
|
|
return o
|
|
}
|
|
|
|
func (m *AssignmentsMessage) CopyFrom(src interface{}) {
|
|
|
|
o := src.(*AssignmentsMessage)
|
|
*m = *o
|
|
if o.Changes != nil {
|
|
m.Changes = make([]*AssignmentChange, len(o.Changes))
|
|
for i := range m.Changes {
|
|
m.Changes[i] = &AssignmentChange{}
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(m.Changes[i], o.Changes[i])
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
// 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
|
|
|
|
// DispatcherClient is the client API for Dispatcher service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
type DispatcherClient interface {
|
|
// Session starts an agent session with the dispatcher. The session is
|
|
// started after the first SessionMessage is received.
|
|
//
|
|
// Once started, the agent is controlled with a stream of SessionMessage.
|
|
// Agents should list on the stream at all times for instructions.
|
|
Session(ctx context.Context, in *SessionRequest, opts ...grpc.CallOption) (Dispatcher_SessionClient, error)
|
|
// Heartbeat is heartbeat method for nodes. It returns new TTL in response.
|
|
// Node should send new heartbeat earlier than now + TTL, otherwise it will
|
|
// be deregistered from dispatcher and its status will be updated to NodeStatus_DOWN
|
|
Heartbeat(ctx context.Context, in *HeartbeatRequest, opts ...grpc.CallOption) (*HeartbeatResponse, error)
|
|
// UpdateTaskStatus updates status of task. Node should send such updates
|
|
// on every status change of its tasks.
|
|
//
|
|
// Whether receiving batch updates or single status updates, this method
|
|
// should be accepting. Errors should only be returned if the entire update
|
|
// should be retried, due to data loss or other problems.
|
|
//
|
|
// If a task is unknown the dispatcher, the status update should be
|
|
// accepted regardless.
|
|
UpdateTaskStatus(ctx context.Context, in *UpdateTaskStatusRequest, opts ...grpc.CallOption) (*UpdateTaskStatusResponse, error)
|
|
// Tasks is a stream of tasks state for node. Each message contains full list
|
|
// of tasks which should be run on node, if task is not present in that list,
|
|
// it should be terminated.
|
|
Tasks(ctx context.Context, in *TasksRequest, opts ...grpc.CallOption) (Dispatcher_TasksClient, error)
|
|
// Assignments is a stream of assignments such as tasks and secrets for node.
|
|
// The first message in the stream contains all of the tasks and secrets
|
|
// that are relevant to the node. Future messages in the stream are updates to
|
|
// the set of assignments.
|
|
Assignments(ctx context.Context, in *AssignmentsRequest, opts ...grpc.CallOption) (Dispatcher_AssignmentsClient, error)
|
|
}
|
|
|
|
type dispatcherClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewDispatcherClient(cc *grpc.ClientConn) DispatcherClient {
|
|
return &dispatcherClient{cc}
|
|
}
|
|
|
|
func (c *dispatcherClient) Session(ctx context.Context, in *SessionRequest, opts ...grpc.CallOption) (Dispatcher_SessionClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, &_Dispatcher_serviceDesc.Streams[0], "/docker.swarmkit.v1.Dispatcher/Session", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &dispatcherSessionClient{stream}
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
return x, nil
|
|
}
|
|
|
|
type Dispatcher_SessionClient interface {
|
|
Recv() (*SessionMessage, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type dispatcherSessionClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *dispatcherSessionClient) Recv() (*SessionMessage, error) {
|
|
m := new(SessionMessage)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func (c *dispatcherClient) Heartbeat(ctx context.Context, in *HeartbeatRequest, opts ...grpc.CallOption) (*HeartbeatResponse, error) {
|
|
out := new(HeartbeatResponse)
|
|
err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Dispatcher/Heartbeat", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *dispatcherClient) UpdateTaskStatus(ctx context.Context, in *UpdateTaskStatusRequest, opts ...grpc.CallOption) (*UpdateTaskStatusResponse, error) {
|
|
out := new(UpdateTaskStatusResponse)
|
|
err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Dispatcher/UpdateTaskStatus", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// Deprecated: Do not use.
|
|
func (c *dispatcherClient) Tasks(ctx context.Context, in *TasksRequest, opts ...grpc.CallOption) (Dispatcher_TasksClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, &_Dispatcher_serviceDesc.Streams[1], "/docker.swarmkit.v1.Dispatcher/Tasks", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &dispatcherTasksClient{stream}
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
return x, nil
|
|
}
|
|
|
|
type Dispatcher_TasksClient interface {
|
|
Recv() (*TasksMessage, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type dispatcherTasksClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *dispatcherTasksClient) Recv() (*TasksMessage, error) {
|
|
m := new(TasksMessage)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func (c *dispatcherClient) Assignments(ctx context.Context, in *AssignmentsRequest, opts ...grpc.CallOption) (Dispatcher_AssignmentsClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, &_Dispatcher_serviceDesc.Streams[2], "/docker.swarmkit.v1.Dispatcher/Assignments", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &dispatcherAssignmentsClient{stream}
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
return x, nil
|
|
}
|
|
|
|
type Dispatcher_AssignmentsClient interface {
|
|
Recv() (*AssignmentsMessage, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type dispatcherAssignmentsClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *dispatcherAssignmentsClient) Recv() (*AssignmentsMessage, error) {
|
|
m := new(AssignmentsMessage)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
// DispatcherServer is the server API for Dispatcher service.
|
|
type DispatcherServer interface {
|
|
// Session starts an agent session with the dispatcher. The session is
|
|
// started after the first SessionMessage is received.
|
|
//
|
|
// Once started, the agent is controlled with a stream of SessionMessage.
|
|
// Agents should list on the stream at all times for instructions.
|
|
Session(*SessionRequest, Dispatcher_SessionServer) error
|
|
// Heartbeat is heartbeat method for nodes. It returns new TTL in response.
|
|
// Node should send new heartbeat earlier than now + TTL, otherwise it will
|
|
// be deregistered from dispatcher and its status will be updated to NodeStatus_DOWN
|
|
Heartbeat(context.Context, *HeartbeatRequest) (*HeartbeatResponse, error)
|
|
// UpdateTaskStatus updates status of task. Node should send such updates
|
|
// on every status change of its tasks.
|
|
//
|
|
// Whether receiving batch updates or single status updates, this method
|
|
// should be accepting. Errors should only be returned if the entire update
|
|
// should be retried, due to data loss or other problems.
|
|
//
|
|
// If a task is unknown the dispatcher, the status update should be
|
|
// accepted regardless.
|
|
UpdateTaskStatus(context.Context, *UpdateTaskStatusRequest) (*UpdateTaskStatusResponse, error)
|
|
// Tasks is a stream of tasks state for node. Each message contains full list
|
|
// of tasks which should be run on node, if task is not present in that list,
|
|
// it should be terminated.
|
|
Tasks(*TasksRequest, Dispatcher_TasksServer) error
|
|
// Assignments is a stream of assignments such as tasks and secrets for node.
|
|
// The first message in the stream contains all of the tasks and secrets
|
|
// that are relevant to the node. Future messages in the stream are updates to
|
|
// the set of assignments.
|
|
Assignments(*AssignmentsRequest, Dispatcher_AssignmentsServer) error
|
|
}
|
|
|
|
func RegisterDispatcherServer(s *grpc.Server, srv DispatcherServer) {
|
|
s.RegisterService(&_Dispatcher_serviceDesc, srv)
|
|
}
|
|
|
|
func _Dispatcher_Session_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(SessionRequest)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(DispatcherServer).Session(m, &dispatcherSessionServer{stream})
|
|
}
|
|
|
|
type Dispatcher_SessionServer interface {
|
|
Send(*SessionMessage) error
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type dispatcherSessionServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *dispatcherSessionServer) Send(m *SessionMessage) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
func _Dispatcher_Heartbeat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(HeartbeatRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(DispatcherServer).Heartbeat(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/docker.swarmkit.v1.Dispatcher/Heartbeat",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(DispatcherServer).Heartbeat(ctx, req.(*HeartbeatRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Dispatcher_UpdateTaskStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UpdateTaskStatusRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(DispatcherServer).UpdateTaskStatus(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/docker.swarmkit.v1.Dispatcher/UpdateTaskStatus",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(DispatcherServer).UpdateTaskStatus(ctx, req.(*UpdateTaskStatusRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Dispatcher_Tasks_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(TasksRequest)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(DispatcherServer).Tasks(m, &dispatcherTasksServer{stream})
|
|
}
|
|
|
|
type Dispatcher_TasksServer interface {
|
|
Send(*TasksMessage) error
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type dispatcherTasksServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *dispatcherTasksServer) Send(m *TasksMessage) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
func _Dispatcher_Assignments_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(AssignmentsRequest)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(DispatcherServer).Assignments(m, &dispatcherAssignmentsServer{stream})
|
|
}
|
|
|
|
type Dispatcher_AssignmentsServer interface {
|
|
Send(*AssignmentsMessage) error
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type dispatcherAssignmentsServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *dispatcherAssignmentsServer) Send(m *AssignmentsMessage) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
var _Dispatcher_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "docker.swarmkit.v1.Dispatcher",
|
|
HandlerType: (*DispatcherServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Heartbeat",
|
|
Handler: _Dispatcher_Heartbeat_Handler,
|
|
},
|
|
{
|
|
MethodName: "UpdateTaskStatus",
|
|
Handler: _Dispatcher_UpdateTaskStatus_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "Session",
|
|
Handler: _Dispatcher_Session_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
{
|
|
StreamName: "Tasks",
|
|
Handler: _Dispatcher_Tasks_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
{
|
|
StreamName: "Assignments",
|
|
Handler: _Dispatcher_Assignments_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
Metadata: "github.com/docker/swarmkit/api/dispatcher.proto",
|
|
}
|
|
|
|
func (m *SessionRequest) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalTo(dAtA)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *SessionRequest) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.Description != nil {
|
|
dAtA[i] = 0xa
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(m.Description.Size()))
|
|
n1, err := m.Description.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n1
|
|
}
|
|
if len(m.SessionID) > 0 {
|
|
dAtA[i] = 0x12
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID)))
|
|
i += copy(dAtA[i:], m.SessionID)
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *SessionMessage) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalTo(dAtA)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *SessionMessage) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.SessionID) > 0 {
|
|
dAtA[i] = 0xa
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID)))
|
|
i += copy(dAtA[i:], m.SessionID)
|
|
}
|
|
if m.Node != nil {
|
|
dAtA[i] = 0x12
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(m.Node.Size()))
|
|
n2, err := m.Node.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n2
|
|
}
|
|
if len(m.Managers) > 0 {
|
|
for _, msg := range m.Managers {
|
|
dAtA[i] = 0x1a
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(msg.Size()))
|
|
n, err := msg.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n
|
|
}
|
|
}
|
|
if len(m.NetworkBootstrapKeys) > 0 {
|
|
for _, msg := range m.NetworkBootstrapKeys {
|
|
dAtA[i] = 0x22
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(msg.Size()))
|
|
n, err := msg.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n
|
|
}
|
|
}
|
|
if len(m.RootCA) > 0 {
|
|
dAtA[i] = 0x2a
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(len(m.RootCA)))
|
|
i += copy(dAtA[i:], m.RootCA)
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *HeartbeatRequest) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalTo(dAtA)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *HeartbeatRequest) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.SessionID) > 0 {
|
|
dAtA[i] = 0xa
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID)))
|
|
i += copy(dAtA[i:], m.SessionID)
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *HeartbeatResponse) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalTo(dAtA)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *HeartbeatResponse) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
dAtA[i] = 0xa
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.Period)))
|
|
n3, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Period, dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n3
|
|
return i, nil
|
|
}
|
|
|
|
func (m *UpdateTaskStatusRequest) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalTo(dAtA)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *UpdateTaskStatusRequest) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.SessionID) > 0 {
|
|
dAtA[i] = 0xa
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID)))
|
|
i += copy(dAtA[i:], m.SessionID)
|
|
}
|
|
if len(m.Updates) > 0 {
|
|
for _, msg := range m.Updates {
|
|
dAtA[i] = 0x1a
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(msg.Size()))
|
|
n, err := msg.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n
|
|
}
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *UpdateTaskStatusRequest_TaskStatusUpdate) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalTo(dAtA)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *UpdateTaskStatusRequest_TaskStatusUpdate) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.TaskID) > 0 {
|
|
dAtA[i] = 0xa
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(len(m.TaskID)))
|
|
i += copy(dAtA[i:], m.TaskID)
|
|
}
|
|
if m.Status != nil {
|
|
dAtA[i] = 0x12
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(m.Status.Size()))
|
|
n4, err := m.Status.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n4
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *UpdateTaskStatusResponse) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalTo(dAtA)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *UpdateTaskStatusResponse) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
return i, nil
|
|
}
|
|
|
|
func (m *TasksRequest) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalTo(dAtA)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *TasksRequest) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.SessionID) > 0 {
|
|
dAtA[i] = 0xa
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID)))
|
|
i += copy(dAtA[i:], m.SessionID)
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *TasksMessage) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalTo(dAtA)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *TasksMessage) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.Tasks) > 0 {
|
|
for _, msg := range m.Tasks {
|
|
dAtA[i] = 0xa
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(msg.Size()))
|
|
n, err := msg.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n
|
|
}
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *AssignmentsRequest) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalTo(dAtA)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *AssignmentsRequest) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.SessionID) > 0 {
|
|
dAtA[i] = 0xa
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID)))
|
|
i += copy(dAtA[i:], m.SessionID)
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *Assignment) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalTo(dAtA)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *Assignment) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.Item != nil {
|
|
nn5, err := m.Item.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += nn5
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *Assignment_Task) MarshalTo(dAtA []byte) (int, error) {
|
|
i := 0
|
|
if m.Task != nil {
|
|
dAtA[i] = 0xa
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(m.Task.Size()))
|
|
n6, err := m.Task.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n6
|
|
}
|
|
return i, nil
|
|
}
|
|
func (m *Assignment_Secret) MarshalTo(dAtA []byte) (int, error) {
|
|
i := 0
|
|
if m.Secret != nil {
|
|
dAtA[i] = 0x12
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(m.Secret.Size()))
|
|
n7, err := m.Secret.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n7
|
|
}
|
|
return i, nil
|
|
}
|
|
func (m *Assignment_Config) MarshalTo(dAtA []byte) (int, error) {
|
|
i := 0
|
|
if m.Config != nil {
|
|
dAtA[i] = 0x1a
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(m.Config.Size()))
|
|
n8, err := m.Config.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n8
|
|
}
|
|
return i, nil
|
|
}
|
|
func (m *AssignmentChange) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalTo(dAtA)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *AssignmentChange) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.Assignment != nil {
|
|
dAtA[i] = 0xa
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(m.Assignment.Size()))
|
|
n9, err := m.Assignment.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n9
|
|
}
|
|
if m.Action != 0 {
|
|
dAtA[i] = 0x10
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(m.Action))
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *AssignmentsMessage) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalTo(dAtA)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *AssignmentsMessage) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.Type != 0 {
|
|
dAtA[i] = 0x8
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(m.Type))
|
|
}
|
|
if len(m.AppliesTo) > 0 {
|
|
dAtA[i] = 0x12
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(len(m.AppliesTo)))
|
|
i += copy(dAtA[i:], m.AppliesTo)
|
|
}
|
|
if len(m.ResultsIn) > 0 {
|
|
dAtA[i] = 0x1a
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(len(m.ResultsIn)))
|
|
i += copy(dAtA[i:], m.ResultsIn)
|
|
}
|
|
if len(m.Changes) > 0 {
|
|
for _, msg := range m.Changes {
|
|
dAtA[i] = 0x22
|
|
i++
|
|
i = encodeVarintDispatcher(dAtA, i, uint64(msg.Size()))
|
|
n, err := msg.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n
|
|
}
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func encodeVarintDispatcher(dAtA []byte, offset int, v uint64) int {
|
|
for v >= 1<<7 {
|
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
v >>= 7
|
|
offset++
|
|
}
|
|
dAtA[offset] = uint8(v)
|
|
return offset + 1
|
|
}
|
|
|
|
type raftProxyDispatcherServer struct {
|
|
local DispatcherServer
|
|
connSelector raftselector.ConnProvider
|
|
localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error)
|
|
}
|
|
|
|
func NewRaftProxyDispatcherServer(local DispatcherServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) DispatcherServer {
|
|
redirectChecker := func(ctx context.Context) (context.Context, error) {
|
|
p, ok := peer.FromContext(ctx)
|
|
if !ok {
|
|
return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
|
|
}
|
|
addr := p.Addr.String()
|
|
md, ok := metadata.FromIncomingContext(ctx)
|
|
if ok && len(md["redirect"]) != 0 {
|
|
return ctx, status.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"])
|
|
}
|
|
if !ok {
|
|
md = metadata.New(map[string]string{})
|
|
}
|
|
md["redirect"] = append(md["redirect"], addr)
|
|
return metadata.NewOutgoingContext(ctx, md), nil
|
|
}
|
|
remoteMods := []func(context.Context) (context.Context, error){redirectChecker}
|
|
remoteMods = append(remoteMods, remoteCtxMod)
|
|
|
|
var localMods []func(context.Context) (context.Context, error)
|
|
if localCtxMod != nil {
|
|
localMods = []func(context.Context) (context.Context, error){localCtxMod}
|
|
}
|
|
|
|
return &raftProxyDispatcherServer{
|
|
local: local,
|
|
connSelector: connSelector,
|
|
localCtxMods: localMods,
|
|
remoteCtxMods: remoteMods,
|
|
}
|
|
}
|
|
func (p *raftProxyDispatcherServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) {
|
|
var err error
|
|
for _, mod := range ctxMods {
|
|
ctx, err = mod(ctx)
|
|
if err != nil {
|
|
return ctx, err
|
|
}
|
|
}
|
|
return ctx, nil
|
|
}
|
|
func (p *raftProxyDispatcherServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) {
|
|
ticker := rafttime.NewTicker(500 * rafttime.Millisecond)
|
|
defer ticker.Stop()
|
|
for {
|
|
select {
|
|
case <-ticker.C:
|
|
conn, err := p.connSelector.LeaderConn(ctx)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
client := NewHealthClient(conn)
|
|
|
|
resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"})
|
|
if err != nil || resp.Status != HealthCheckResponse_SERVING {
|
|
continue
|
|
}
|
|
return conn, nil
|
|
case <-ctx.Done():
|
|
return nil, ctx.Err()
|
|
}
|
|
}
|
|
}
|
|
|
|
type Dispatcher_SessionServerWrapper struct {
|
|
Dispatcher_SessionServer
|
|
ctx context.Context
|
|
}
|
|
|
|
func (s Dispatcher_SessionServerWrapper) Context() context.Context {
|
|
return s.ctx
|
|
}
|
|
|
|
func (p *raftProxyDispatcherServer) Session(r *SessionRequest, stream Dispatcher_SessionServer) error {
|
|
ctx := stream.Context()
|
|
conn, err := p.connSelector.LeaderConn(ctx)
|
|
if err != nil {
|
|
if err == raftselector.ErrIsLeader {
|
|
ctx, err = p.runCtxMods(ctx, p.localCtxMods)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
streamWrapper := Dispatcher_SessionServerWrapper{
|
|
Dispatcher_SessionServer: stream,
|
|
ctx: ctx,
|
|
}
|
|
return p.local.Session(r, streamWrapper)
|
|
}
|
|
return err
|
|
}
|
|
ctx, err = p.runCtxMods(ctx, p.remoteCtxMods)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
clientStream, err := NewDispatcherClient(conn).Session(ctx, r)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
for {
|
|
msg, err := clientStream.Recv()
|
|
if err == io.EOF {
|
|
break
|
|
}
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if err := stream.Send(msg); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (p *raftProxyDispatcherServer) Heartbeat(ctx context.Context, r *HeartbeatRequest) (*HeartbeatResponse, error) {
|
|
|
|
conn, err := p.connSelector.LeaderConn(ctx)
|
|
if err != nil {
|
|
if err == raftselector.ErrIsLeader {
|
|
ctx, err = p.runCtxMods(ctx, p.localCtxMods)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return p.local.Heartbeat(ctx, r)
|
|
}
|
|
return nil, err
|
|
}
|
|
modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
resp, err := NewDispatcherClient(conn).Heartbeat(modCtx, r)
|
|
if err != nil {
|
|
if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") {
|
|
return resp, err
|
|
}
|
|
conn, err := p.pollNewLeaderConn(ctx)
|
|
if err != nil {
|
|
if err == raftselector.ErrIsLeader {
|
|
return p.local.Heartbeat(ctx, r)
|
|
}
|
|
return nil, err
|
|
}
|
|
return NewDispatcherClient(conn).Heartbeat(modCtx, r)
|
|
}
|
|
return resp, err
|
|
}
|
|
|
|
func (p *raftProxyDispatcherServer) UpdateTaskStatus(ctx context.Context, r *UpdateTaskStatusRequest) (*UpdateTaskStatusResponse, error) {
|
|
|
|
conn, err := p.connSelector.LeaderConn(ctx)
|
|
if err != nil {
|
|
if err == raftselector.ErrIsLeader {
|
|
ctx, err = p.runCtxMods(ctx, p.localCtxMods)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return p.local.UpdateTaskStatus(ctx, r)
|
|
}
|
|
return nil, err
|
|
}
|
|
modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
resp, err := NewDispatcherClient(conn).UpdateTaskStatus(modCtx, r)
|
|
if err != nil {
|
|
if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") {
|
|
return resp, err
|
|
}
|
|
conn, err := p.pollNewLeaderConn(ctx)
|
|
if err != nil {
|
|
if err == raftselector.ErrIsLeader {
|
|
return p.local.UpdateTaskStatus(ctx, r)
|
|
}
|
|
return nil, err
|
|
}
|
|
return NewDispatcherClient(conn).UpdateTaskStatus(modCtx, r)
|
|
}
|
|
return resp, err
|
|
}
|
|
|
|
type Dispatcher_TasksServerWrapper struct {
|
|
Dispatcher_TasksServer
|
|
ctx context.Context
|
|
}
|
|
|
|
func (s Dispatcher_TasksServerWrapper) Context() context.Context {
|
|
return s.ctx
|
|
}
|
|
|
|
func (p *raftProxyDispatcherServer) Tasks(r *TasksRequest, stream Dispatcher_TasksServer) error {
|
|
ctx := stream.Context()
|
|
conn, err := p.connSelector.LeaderConn(ctx)
|
|
if err != nil {
|
|
if err == raftselector.ErrIsLeader {
|
|
ctx, err = p.runCtxMods(ctx, p.localCtxMods)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
streamWrapper := Dispatcher_TasksServerWrapper{
|
|
Dispatcher_TasksServer: stream,
|
|
ctx: ctx,
|
|
}
|
|
return p.local.Tasks(r, streamWrapper)
|
|
}
|
|
return err
|
|
}
|
|
ctx, err = p.runCtxMods(ctx, p.remoteCtxMods)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
clientStream, err := NewDispatcherClient(conn).Tasks(ctx, r)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
for {
|
|
msg, err := clientStream.Recv()
|
|
if err == io.EOF {
|
|
break
|
|
}
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if err := stream.Send(msg); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type Dispatcher_AssignmentsServerWrapper struct {
|
|
Dispatcher_AssignmentsServer
|
|
ctx context.Context
|
|
}
|
|
|
|
func (s Dispatcher_AssignmentsServerWrapper) Context() context.Context {
|
|
return s.ctx
|
|
}
|
|
|
|
func (p *raftProxyDispatcherServer) Assignments(r *AssignmentsRequest, stream Dispatcher_AssignmentsServer) error {
|
|
ctx := stream.Context()
|
|
conn, err := p.connSelector.LeaderConn(ctx)
|
|
if err != nil {
|
|
if err == raftselector.ErrIsLeader {
|
|
ctx, err = p.runCtxMods(ctx, p.localCtxMods)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
streamWrapper := Dispatcher_AssignmentsServerWrapper{
|
|
Dispatcher_AssignmentsServer: stream,
|
|
ctx: ctx,
|
|
}
|
|
return p.local.Assignments(r, streamWrapper)
|
|
}
|
|
return err
|
|
}
|
|
ctx, err = p.runCtxMods(ctx, p.remoteCtxMods)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
clientStream, err := NewDispatcherClient(conn).Assignments(ctx, r)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
for {
|
|
msg, err := clientStream.Recv()
|
|
if err == io.EOF {
|
|
break
|
|
}
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if err := stream.Send(msg); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *SessionRequest) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.Description != nil {
|
|
l = m.Description.Size()
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
l = len(m.SessionID)
|
|
if l > 0 {
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *SessionMessage) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.SessionID)
|
|
if l > 0 {
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
if m.Node != nil {
|
|
l = m.Node.Size()
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
if len(m.Managers) > 0 {
|
|
for _, e := range m.Managers {
|
|
l = e.Size()
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
}
|
|
if len(m.NetworkBootstrapKeys) > 0 {
|
|
for _, e := range m.NetworkBootstrapKeys {
|
|
l = e.Size()
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
}
|
|
l = len(m.RootCA)
|
|
if l > 0 {
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *HeartbeatRequest) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.SessionID)
|
|
if l > 0 {
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *HeartbeatResponse) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Period)
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
return n
|
|
}
|
|
|
|
func (m *UpdateTaskStatusRequest) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.SessionID)
|
|
if l > 0 {
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
if len(m.Updates) > 0 {
|
|
for _, e := range m.Updates {
|
|
l = e.Size()
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *UpdateTaskStatusRequest_TaskStatusUpdate) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.TaskID)
|
|
if l > 0 {
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
if m.Status != nil {
|
|
l = m.Status.Size()
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *UpdateTaskStatusResponse) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
return n
|
|
}
|
|
|
|
func (m *TasksRequest) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.SessionID)
|
|
if l > 0 {
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *TasksMessage) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if len(m.Tasks) > 0 {
|
|
for _, e := range m.Tasks {
|
|
l = e.Size()
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *AssignmentsRequest) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.SessionID)
|
|
if l > 0 {
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *Assignment) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.Item != nil {
|
|
n += m.Item.Size()
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *Assignment_Task) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.Task != nil {
|
|
l = m.Task.Size()
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
func (m *Assignment_Secret) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.Secret != nil {
|
|
l = m.Secret.Size()
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
func (m *Assignment_Config) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.Config != nil {
|
|
l = m.Config.Size()
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
func (m *AssignmentChange) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.Assignment != nil {
|
|
l = m.Assignment.Size()
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
if m.Action != 0 {
|
|
n += 1 + sovDispatcher(uint64(m.Action))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *AssignmentsMessage) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.Type != 0 {
|
|
n += 1 + sovDispatcher(uint64(m.Type))
|
|
}
|
|
l = len(m.AppliesTo)
|
|
if l > 0 {
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
l = len(m.ResultsIn)
|
|
if l > 0 {
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
if len(m.Changes) > 0 {
|
|
for _, e := range m.Changes {
|
|
l = e.Size()
|
|
n += 1 + l + sovDispatcher(uint64(l))
|
|
}
|
|
}
|
|
return n
|
|
}
|
|
|
|
func sovDispatcher(x uint64) (n int) {
|
|
for {
|
|
n++
|
|
x >>= 7
|
|
if x == 0 {
|
|
break
|
|
}
|
|
}
|
|
return n
|
|
}
|
|
func sozDispatcher(x uint64) (n int) {
|
|
return sovDispatcher(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
}
|
|
func (this *SessionRequest) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&SessionRequest{`,
|
|
`Description:` + strings.Replace(fmt.Sprintf("%v", this.Description), "NodeDescription", "NodeDescription", 1) + `,`,
|
|
`SessionID:` + fmt.Sprintf("%v", this.SessionID) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *SessionMessage) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&SessionMessage{`,
|
|
`SessionID:` + fmt.Sprintf("%v", this.SessionID) + `,`,
|
|
`Node:` + strings.Replace(fmt.Sprintf("%v", this.Node), "Node", "Node", 1) + `,`,
|
|
`Managers:` + strings.Replace(fmt.Sprintf("%v", this.Managers), "WeightedPeer", "WeightedPeer", 1) + `,`,
|
|
`NetworkBootstrapKeys:` + strings.Replace(fmt.Sprintf("%v", this.NetworkBootstrapKeys), "EncryptionKey", "EncryptionKey", 1) + `,`,
|
|
`RootCA:` + fmt.Sprintf("%v", this.RootCA) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *HeartbeatRequest) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&HeartbeatRequest{`,
|
|
`SessionID:` + fmt.Sprintf("%v", this.SessionID) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *HeartbeatResponse) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&HeartbeatResponse{`,
|
|
`Period:` + strings.Replace(strings.Replace(this.Period.String(), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *UpdateTaskStatusRequest) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&UpdateTaskStatusRequest{`,
|
|
`SessionID:` + fmt.Sprintf("%v", this.SessionID) + `,`,
|
|
`Updates:` + strings.Replace(fmt.Sprintf("%v", this.Updates), "UpdateTaskStatusRequest_TaskStatusUpdate", "UpdateTaskStatusRequest_TaskStatusUpdate", 1) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *UpdateTaskStatusRequest_TaskStatusUpdate) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&UpdateTaskStatusRequest_TaskStatusUpdate{`,
|
|
`TaskID:` + fmt.Sprintf("%v", this.TaskID) + `,`,
|
|
`Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "TaskStatus", "TaskStatus", 1) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *UpdateTaskStatusResponse) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&UpdateTaskStatusResponse{`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *TasksRequest) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&TasksRequest{`,
|
|
`SessionID:` + fmt.Sprintf("%v", this.SessionID) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *TasksMessage) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&TasksMessage{`,
|
|
`Tasks:` + strings.Replace(fmt.Sprintf("%v", this.Tasks), "Task", "Task", 1) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *AssignmentsRequest) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&AssignmentsRequest{`,
|
|
`SessionID:` + fmt.Sprintf("%v", this.SessionID) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *Assignment) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&Assignment{`,
|
|
`Item:` + fmt.Sprintf("%v", this.Item) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *Assignment_Task) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&Assignment_Task{`,
|
|
`Task:` + strings.Replace(fmt.Sprintf("%v", this.Task), "Task", "Task", 1) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *Assignment_Secret) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&Assignment_Secret{`,
|
|
`Secret:` + strings.Replace(fmt.Sprintf("%v", this.Secret), "Secret", "Secret", 1) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *Assignment_Config) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&Assignment_Config{`,
|
|
`Config:` + strings.Replace(fmt.Sprintf("%v", this.Config), "Config", "Config", 1) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *AssignmentChange) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&AssignmentChange{`,
|
|
`Assignment:` + strings.Replace(fmt.Sprintf("%v", this.Assignment), "Assignment", "Assignment", 1) + `,`,
|
|
`Action:` + fmt.Sprintf("%v", this.Action) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *AssignmentsMessage) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&AssignmentsMessage{`,
|
|
`Type:` + fmt.Sprintf("%v", this.Type) + `,`,
|
|
`AppliesTo:` + fmt.Sprintf("%v", this.AppliesTo) + `,`,
|
|
`ResultsIn:` + fmt.Sprintf("%v", this.ResultsIn) + `,`,
|
|
`Changes:` + strings.Replace(fmt.Sprintf("%v", this.Changes), "AssignmentChange", "AssignmentChange", 1) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func valueToStringDispatcher(v interface{}) string {
|
|
rv := reflect.ValueOf(v)
|
|
if rv.IsNil() {
|
|
return "nil"
|
|
}
|
|
pv := reflect.Indirect(rv).Interface()
|
|
return fmt.Sprintf("*%v", pv)
|
|
}
|
|
func (m *SessionRequest) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: SessionRequest: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: SessionRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.Description == nil {
|
|
m.Description = &NodeDescription{}
|
|
}
|
|
if err := m.Description.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field SessionID", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.SessionID = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipDispatcher(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *SessionMessage) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: SessionMessage: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: SessionMessage: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field SessionID", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.SessionID = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.Node == nil {
|
|
m.Node = &Node{}
|
|
}
|
|
if err := m.Node.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 3:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Managers", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Managers = append(m.Managers, &WeightedPeer{})
|
|
if err := m.Managers[len(m.Managers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 4:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field NetworkBootstrapKeys", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.NetworkBootstrapKeys = append(m.NetworkBootstrapKeys, &EncryptionKey{})
|
|
if err := m.NetworkBootstrapKeys[len(m.NetworkBootstrapKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 5:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field RootCA", wireType)
|
|
}
|
|
var byteLen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
byteLen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if byteLen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + byteLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.RootCA = append(m.RootCA[:0], dAtA[iNdEx:postIndex]...)
|
|
if m.RootCA == nil {
|
|
m.RootCA = []byte{}
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipDispatcher(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *HeartbeatRequest) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: HeartbeatRequest: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: HeartbeatRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field SessionID", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.SessionID = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipDispatcher(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *HeartbeatResponse) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: HeartbeatResponse: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: HeartbeatResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Period", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Period, dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipDispatcher(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *UpdateTaskStatusRequest) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: UpdateTaskStatusRequest: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: UpdateTaskStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field SessionID", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.SessionID = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
case 3:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Updates", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Updates = append(m.Updates, &UpdateTaskStatusRequest_TaskStatusUpdate{})
|
|
if err := m.Updates[len(m.Updates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipDispatcher(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *UpdateTaskStatusRequest_TaskStatusUpdate) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: TaskStatusUpdate: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: TaskStatusUpdate: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field TaskID", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.TaskID = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.Status == nil {
|
|
m.Status = &TaskStatus{}
|
|
}
|
|
if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipDispatcher(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *UpdateTaskStatusResponse) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: UpdateTaskStatusResponse: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: UpdateTaskStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipDispatcher(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *TasksRequest) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: TasksRequest: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: TasksRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field SessionID", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.SessionID = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipDispatcher(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *TasksMessage) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: TasksMessage: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: TasksMessage: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Tasks", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Tasks = append(m.Tasks, &Task{})
|
|
if err := m.Tasks[len(m.Tasks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipDispatcher(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *AssignmentsRequest) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: AssignmentsRequest: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: AssignmentsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field SessionID", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.SessionID = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipDispatcher(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *Assignment) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: Assignment: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: Assignment: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Task", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
v := &Task{}
|
|
if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
m.Item = &Assignment_Task{v}
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
v := &Secret{}
|
|
if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
m.Item = &Assignment_Secret{v}
|
|
iNdEx = postIndex
|
|
case 3:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
v := &Config{}
|
|
if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
m.Item = &Assignment_Config{v}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipDispatcher(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *AssignmentChange) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: AssignmentChange: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: AssignmentChange: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Assignment", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.Assignment == nil {
|
|
m.Assignment = &Assignment{}
|
|
}
|
|
if err := m.Assignment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType)
|
|
}
|
|
m.Action = 0
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
m.Action |= AssignmentChange_AssignmentAction(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipDispatcher(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *AssignmentsMessage) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: AssignmentsMessage: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: AssignmentsMessage: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
|
|
}
|
|
m.Type = 0
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
m.Type |= AssignmentsMessage_Type(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field AppliesTo", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.AppliesTo = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
case 3:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field ResultsIn", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.ResultsIn = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
case 4:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Changes", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Changes = append(m.Changes, &AssignmentChange{})
|
|
if err := m.Changes[len(m.Changes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipDispatcher(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthDispatcher
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func skipDispatcher(dAtA []byte) (n int, err error) {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
wireType := int(wire & 0x7)
|
|
switch wireType {
|
|
case 0:
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx++
|
|
if dAtA[iNdEx-1] < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
return iNdEx, nil
|
|
case 1:
|
|
iNdEx += 8
|
|
return iNdEx, nil
|
|
case 2:
|
|
var length int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
length |= (int(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if length < 0 {
|
|
return 0, ErrInvalidLengthDispatcher
|
|
}
|
|
iNdEx += length
|
|
if iNdEx < 0 {
|
|
return 0, ErrInvalidLengthDispatcher
|
|
}
|
|
return iNdEx, nil
|
|
case 3:
|
|
for {
|
|
var innerWire uint64
|
|
var start int = iNdEx
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowDispatcher
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
innerWire |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
innerWireType := int(innerWire & 0x7)
|
|
if innerWireType == 4 {
|
|
break
|
|
}
|
|
next, err := skipDispatcher(dAtA[start:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
iNdEx = start + next
|
|
if iNdEx < 0 {
|
|
return 0, ErrInvalidLengthDispatcher
|
|
}
|
|
}
|
|
return iNdEx, nil
|
|
case 4:
|
|
return iNdEx, nil
|
|
case 5:
|
|
iNdEx += 4
|
|
return iNdEx, nil
|
|
default:
|
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
}
|
|
}
|
|
panic("unreachable")
|
|
}
|
|
|
|
var (
|
|
ErrInvalidLengthDispatcher = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
ErrIntOverflowDispatcher = fmt.Errorf("proto: integer overflow")
|
|
)
|