diff --git a/acl/acl.go b/acl/acl.go new file mode 100644 index 000000000..a42698e83 --- /dev/null +++ b/acl/acl.go @@ -0,0 +1,224 @@ +package acl + +import ( + "fmt" + + iradix "github.com/hashicorp/go-immutable-radix" +) + +// ManagementACL is a singleton used for management tokens +var ManagementACL *ACL + +func init() { + var err error + ManagementACL, err = NewACL(true, nil) + if err != nil { + panic(fmt.Errorf("failed to setup management ACL: %v", err)) + } +} + +// capabilitySet is a type wrapper to help managing a set of capabilities +type capabilitySet map[string]struct{} + +func (c capabilitySet) Check(k string) bool { + _, ok := c[k] + return ok +} + +func (c capabilitySet) Set(k string) { + c[k] = struct{}{} +} + +func (c capabilitySet) Clear() { + for cap := range c { + delete(c, cap) + } +} + +// ACL object is used to convert a set of policies into a structure that +// can be efficiently evaluated to determine if an action is allowed. +type ACL struct { + // management tokens are allowed to do anything + management bool + + // namespaces maps a namespace to a capabilitySet + namespaces *iradix.Tree + + agent string + node string + operator string +} + +// maxPrivilege returns the policy which grants the most privilege +// This handles the case of Deny always taking maximum precedence. +func maxPrivilege(a, b string) string { + switch { + case a == PolicyDeny || b == PolicyDeny: + return PolicyDeny + case a == PolicyWrite || b == PolicyWrite: + return PolicyWrite + case a == PolicyRead || b == PolicyRead: + return PolicyRead + default: + return "" + } +} + +// NewACL compiles a set of policies into an ACL object +func NewACL(management bool, policies []*Policy) (*ACL, error) { + // Hot-path management tokens + if management { + return &ACL{management: true}, nil + } + + // Create the ACL object + acl := &ACL{} + nsTxn := iradix.New().Txn() + + for _, policy := range policies { + NAMESPACES: + for _, ns := range policy.Namespaces { + // Check for existing capabilities + var capabilities capabilitySet + raw, ok := nsTxn.Get([]byte(ns.Name)) + if ok { + capabilities = raw.(capabilitySet) + } else { + capabilities = make(capabilitySet) + nsTxn.Insert([]byte(ns.Name), capabilities) + } + + // Deny always takes precedence + if capabilities.Check(NamespaceCapabilityDeny) { + continue NAMESPACES + } + + // Add in all the capabilities + for _, cap := range ns.Capabilities { + if cap == NamespaceCapabilityDeny { + // Overwrite any existing capabilities + capabilities.Clear() + capabilities.Set(NamespaceCapabilityDeny) + continue NAMESPACES + } + capabilities.Set(cap) + } + } + + // Take the maximum privilege for agent, node, and operator + if policy.Agent != nil { + acl.agent = maxPrivilege(acl.agent, policy.Agent.Policy) + } + if policy.Node != nil { + acl.node = maxPrivilege(acl.node, policy.Node.Policy) + } + if policy.Operator != nil { + acl.operator = maxPrivilege(acl.operator, policy.Operator.Policy) + } + } + + // Finalize the namespaces + acl.namespaces = nsTxn.Commit() + return acl, nil +} + +// AllowNamespaceOperation checks if a given operation is allowed for a namespace +func (a *ACL) AllowNamespaceOperation(ns string, op string) bool { + // Hot path management tokens + if a.management { + return true + } + + // Check for a matching capability set + raw, ok := a.namespaces.Get([]byte(ns)) + if !ok { + return false + } + + // Check if the capability has been granted + capabilities := raw.(capabilitySet) + return capabilities.Check(op) +} + +// AllowAgentRead checks if read operations are allowed for an agent +func (a *ACL) AllowAgentRead() bool { + switch { + case a.management: + return true + case a.agent == PolicyWrite: + return true + case a.agent == PolicyRead: + return true + default: + return false + } +} + +// AllowAgentWrite checks if write operations are allowed for an agent +func (a *ACL) AllowAgentWrite() bool { + switch { + case a.management: + return true + case a.agent == PolicyWrite: + return true + default: + return false + } +} + +// AllowNodeRead checks if read operations are allowed for a node +func (a *ACL) AllowNodeRead() bool { + switch { + case a.management: + return true + case a.node == PolicyWrite: + return true + case a.node == PolicyRead: + return true + default: + return false + } +} + +// AllowNodeWrite checks if write operations are allowed for a node +func (a *ACL) AllowNodeWrite() bool { + switch { + case a.management: + return true + case a.node == PolicyWrite: + return true + default: + return false + } +} + +// AllowOperatorRead checks if read operations are allowed for a operator +func (a *ACL) AllowOperatorRead() bool { + switch { + case a.management: + return true + case a.operator == PolicyWrite: + return true + case a.operator == PolicyRead: + return true + default: + return false + } +} + +// AllowOperatorWrite checks if write operations are allowed for a operator +func (a *ACL) AllowOperatorWrite() bool { + switch { + case a.management: + return true + case a.operator == PolicyWrite: + return true + default: + return false + } +} + +// IsManagement checks if this represents a management token +func (a *ACL) IsManagement() bool { + return a.management +} diff --git a/acl/acl_test.go b/acl/acl_test.go new file mode 100644 index 000000000..86b2c20e2 --- /dev/null +++ b/acl/acl_test.go @@ -0,0 +1,197 @@ +package acl + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestCapabilitySet(t *testing.T) { + var cs capabilitySet = make(map[string]struct{}) + + // Check no capabilities by default + if cs.Check(PolicyDeny) { + t.Fatalf("unexpected check") + } + + // Do a set and check + cs.Set(PolicyDeny) + if !cs.Check(PolicyDeny) { + t.Fatalf("missing check") + } + + // Clear and check + cs.Clear() + if cs.Check(PolicyDeny) { + t.Fatalf("unexpected check") + } +} + +func TestMaxPrivilege(t *testing.T) { + type tcase struct { + Privilege string + PrecedenceOver []string + } + tcases := []tcase{ + { + PolicyDeny, + []string{PolicyDeny, PolicyWrite, PolicyRead, ""}, + }, + { + PolicyWrite, + []string{PolicyWrite, PolicyRead, ""}, + }, + { + PolicyRead, + []string{PolicyRead, ""}, + }, + } + + for idx1, tc := range tcases { + for idx2, po := range tc.PrecedenceOver { + if maxPrivilege(tc.Privilege, po) != tc.Privilege { + t.Fatalf("failed %d %d", idx1, idx2) + } + if maxPrivilege(po, tc.Privilege) != tc.Privilege { + t.Fatalf("failed %d %d", idx1, idx2) + } + } + } +} + +func TestACLManagement(t *testing.T) { + // Create management ACL + acl, err := NewACL(true, nil) + assert.Nil(t, err) + + // Check default namespace rights + assert.Equal(t, true, acl.AllowNamespaceOperation("default", NamespaceCapabilityListJobs)) + assert.Equal(t, true, acl.AllowNamespaceOperation("default", NamespaceCapabilitySubmitJob)) + + // Check non-specified namespace + assert.Equal(t, true, acl.AllowNamespaceOperation("foo", NamespaceCapabilityListJobs)) + + // Check the other simpler operations + assert.Equal(t, true, acl.IsManagement()) + assert.Equal(t, true, acl.AllowAgentRead()) + assert.Equal(t, true, acl.AllowAgentWrite()) + assert.Equal(t, true, acl.AllowNodeRead()) + assert.Equal(t, true, acl.AllowNodeWrite()) + assert.Equal(t, true, acl.AllowOperatorRead()) + assert.Equal(t, true, acl.AllowOperatorWrite()) +} + +func TestACLMerge(t *testing.T) { + // Merge read + write policy + p1, err := Parse(readAll) + assert.Nil(t, err) + p2, err := Parse(writeAll) + assert.Nil(t, err) + acl, err := NewACL(false, []*Policy{p1, p2}) + assert.Nil(t, err) + + // Check default namespace rights + assert.Equal(t, true, acl.AllowNamespaceOperation("default", NamespaceCapabilityListJobs)) + assert.Equal(t, true, acl.AllowNamespaceOperation("default", NamespaceCapabilitySubmitJob)) + + // Check non-specified namespace + assert.Equal(t, false, acl.AllowNamespaceOperation("foo", NamespaceCapabilityListJobs)) + + // Check the other simpler operations + assert.Equal(t, false, acl.IsManagement()) + assert.Equal(t, true, acl.AllowAgentRead()) + assert.Equal(t, true, acl.AllowAgentWrite()) + assert.Equal(t, true, acl.AllowNodeRead()) + assert.Equal(t, true, acl.AllowNodeWrite()) + assert.Equal(t, true, acl.AllowOperatorRead()) + assert.Equal(t, true, acl.AllowOperatorWrite()) + + // Merge read + blank + p3, err := Parse("") + assert.Nil(t, err) + acl, err = NewACL(false, []*Policy{p1, p3}) + assert.Nil(t, err) + + // Check default namespace rights + assert.Equal(t, true, acl.AllowNamespaceOperation("default", NamespaceCapabilityListJobs)) + assert.Equal(t, false, acl.AllowNamespaceOperation("default", NamespaceCapabilitySubmitJob)) + + // Check non-specified namespace + assert.Equal(t, false, acl.AllowNamespaceOperation("foo", NamespaceCapabilityListJobs)) + + // Check the other simpler operations + assert.Equal(t, false, acl.IsManagement()) + assert.Equal(t, true, acl.AllowAgentRead()) + assert.Equal(t, false, acl.AllowAgentWrite()) + assert.Equal(t, true, acl.AllowNodeRead()) + assert.Equal(t, false, acl.AllowNodeWrite()) + assert.Equal(t, true, acl.AllowOperatorRead()) + assert.Equal(t, false, acl.AllowOperatorWrite()) + + // Merge read + deny + p4, err := Parse(denyAll) + assert.Nil(t, err) + acl, err = NewACL(false, []*Policy{p1, p4}) + assert.Nil(t, err) + + // Check default namespace rights + assert.Equal(t, false, acl.AllowNamespaceOperation("default", NamespaceCapabilityListJobs)) + assert.Equal(t, false, acl.AllowNamespaceOperation("default", NamespaceCapabilitySubmitJob)) + + // Check non-specified namespace + assert.Equal(t, false, acl.AllowNamespaceOperation("foo", NamespaceCapabilityListJobs)) + + // Check the other simpler operations + assert.Equal(t, false, acl.IsManagement()) + assert.Equal(t, false, acl.AllowAgentRead()) + assert.Equal(t, false, acl.AllowAgentWrite()) + assert.Equal(t, false, acl.AllowNodeRead()) + assert.Equal(t, false, acl.AllowNodeWrite()) + assert.Equal(t, false, acl.AllowOperatorRead()) + assert.Equal(t, false, acl.AllowOperatorWrite()) +} + +var readAll = ` +namespace "default" { + policy = "read" +} +agent { + policy = "read" +} +node { + policy = "read" +} +operator { + policy = "read" +} +` + +var writeAll = ` +namespace "default" { + policy = "write" +} +agent { + policy = "write" +} +node { + policy = "write" +} +operator { + policy = "write" +} +` + +var denyAll = ` +namespace "default" { + policy = "deny" +} +agent { + policy = "deny" +} +node { + policy = "deny" +} +operator { + policy = "deny" +} +` diff --git a/acl/policy.go b/acl/policy.go new file mode 100644 index 000000000..cf2c4b245 --- /dev/null +++ b/acl/policy.go @@ -0,0 +1,159 @@ +package acl + +import ( + "fmt" + "regexp" + + "github.com/hashicorp/hcl" +) + +const ( + // The following levels are the only valid values for the `policy = "read"` stanza. + // When policies are merged together, the most privilege is granted, except for deny + // which always takes precedence and supercedes. + PolicyDeny = "deny" + PolicyRead = "read" + PolicyWrite = "write" +) + +const ( + // The following are the fine-grained capabilities that can be granted within a namespace. + // The Policy stanza is a short hand for granting several of these. When capabilities are + // combined we take the union of all capabilities. If the deny capability is present, it + // takes precedence and overwrites all other capabilities. + NamespaceCapabilityDeny = "deny" + NamespaceCapabilityListJobs = "list-jobs" + NamespaceCapabilityReadJob = "read-job" + NamespaceCapabilitySubmitJob = "submit-job" + NamespaceCapabilityReadLogs = "read-logs" + NamespaceCapabilityReadFS = "read-fs" +) + +var ( + validNamespace = regexp.MustCompile("^[a-zA-Z0-9-]{1,128}$") +) + +// Policy represents a parsed HCL or JSON policy. +type Policy struct { + Namespaces []*NamespacePolicy `hcl:"namespace,expand"` + Agent *AgentPolicy `hcl:"agent"` + Node *NodePolicy `hcl:"node"` + Operator *OperatorPolicy `hcl:"operator"` + Raw string `hcl:"-"` +} + +// NamespacePolicy is the policy for a specific namespace +type NamespacePolicy struct { + Name string `hcl:",key"` + Policy string + Capabilities []string +} + +type AgentPolicy struct { + Policy string +} + +type NodePolicy struct { + Policy string +} + +type OperatorPolicy struct { + Policy string +} + +// isPolicyValid makes sure the given string matches one of the valid policies. +func isPolicyValid(policy string) bool { + switch policy { + case PolicyDeny, PolicyRead, PolicyWrite: + return true + default: + return false + } +} + +// isNamespaceCapabilityValid ensures the given capability is valid for a namespace policy +func isNamespaceCapabilityValid(cap string) bool { + switch cap { + case NamespaceCapabilityDeny, NamespaceCapabilityListJobs, NamespaceCapabilityReadJob, + NamespaceCapabilitySubmitJob, NamespaceCapabilityReadLogs, NamespaceCapabilityReadFS: + return true + default: + return false + } +} + +// expandNamespacePolicy provides the equivalent set of capabilities for +// a namespace policy +func expandNamespacePolicy(policy string) []string { + switch policy { + case PolicyDeny: + return []string{NamespaceCapabilityDeny} + case PolicyRead: + return []string{ + NamespaceCapabilityListJobs, + NamespaceCapabilityReadJob, + } + case PolicyWrite: + return []string{ + NamespaceCapabilityListJobs, + NamespaceCapabilityReadJob, + NamespaceCapabilitySubmitJob, + NamespaceCapabilityReadLogs, + NamespaceCapabilityReadFS, + } + default: + return nil + } +} + +// Parse is used to parse the specified ACL rules into an +// intermediary set of policies, before being compiled into +// the ACL +func Parse(rules string) (*Policy, error) { + // Decode the rules + p := &Policy{Raw: rules} + if rules == "" { + // Hot path for empty rules + return p, nil + } + + // Attempt to parse + if err := hcl.Decode(p, rules); err != nil { + return nil, fmt.Errorf("Failed to parse ACL Policy: %v", err) + } + + // Validate the policy + for _, ns := range p.Namespaces { + if !validNamespace.MatchString(ns.Name) { + return nil, fmt.Errorf("Invalid namespace name: %#v", ns) + } + if ns.Policy != "" && !isPolicyValid(ns.Policy) { + return nil, fmt.Errorf("Invalid namespace policy: %#v", ns) + } + for _, cap := range ns.Capabilities { + if !isNamespaceCapabilityValid(cap) { + return nil, fmt.Errorf("Invalid namespace capability '%s': %#v", cap, ns) + } + } + + // Expand the short hand policy to the capabilities and + // add to any existing capabilities + if ns.Policy != "" { + extraCap := expandNamespacePolicy(ns.Policy) + ns.Capabilities = append(ns.Capabilities, extraCap...) + } + } + + if p.Agent != nil && !isPolicyValid(p.Agent.Policy) { + return nil, fmt.Errorf("Invalid agent policy: %#v", p.Agent) + } + + if p.Node != nil && !isPolicyValid(p.Node.Policy) { + return nil, fmt.Errorf("Invalid node policy: %#v", p.Node) + } + + if p.Operator != nil && !isPolicyValid(p.Operator.Policy) { + return nil, fmt.Errorf("Invalid operator policy: %#v", p.Operator) + } + return p, nil +} diff --git a/acl/policy_test.go b/acl/policy_test.go new file mode 100644 index 000000000..1c3f394c2 --- /dev/null +++ b/acl/policy_test.go @@ -0,0 +1,175 @@ +package acl + +import ( + "fmt" + "strings" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestParse(t *testing.T) { + type tcase struct { + Raw string + ErrStr string + Expect *Policy + } + tcases := []tcase{ + { + ` + namespace "default" { + policy = "read" + } + `, + "", + &Policy{ + Namespaces: []*NamespacePolicy{ + &NamespacePolicy{ + Name: "default", + Policy: PolicyRead, + Capabilities: []string{ + NamespaceCapabilityListJobs, + NamespaceCapabilityReadJob, + }, + }, + }, + }, + }, + { + ` + namespace "default" { + policy = "read" + } + namespace "other" { + policy = "write" + } + namespace "secret" { + capabilities = ["deny", "read-logs"] + } + agent { + policy = "read" + } + node { + policy = "write" + } + operator { + policy = "deny" + } + `, + "", + &Policy{ + Namespaces: []*NamespacePolicy{ + &NamespacePolicy{ + Name: "default", + Policy: PolicyRead, + Capabilities: []string{ + NamespaceCapabilityListJobs, + NamespaceCapabilityReadJob, + }, + }, + &NamespacePolicy{ + Name: "other", + Policy: PolicyWrite, + Capabilities: []string{ + NamespaceCapabilityListJobs, + NamespaceCapabilityReadJob, + NamespaceCapabilitySubmitJob, + NamespaceCapabilityReadLogs, + NamespaceCapabilityReadFS, + }, + }, + &NamespacePolicy{ + Name: "secret", + Capabilities: []string{ + NamespaceCapabilityDeny, + NamespaceCapabilityReadLogs, + }, + }, + }, + Agent: &AgentPolicy{ + Policy: PolicyRead, + }, + Node: &NodePolicy{ + Policy: PolicyWrite, + }, + Operator: &OperatorPolicy{ + Policy: PolicyDeny, + }, + }, + }, + { + ` + namespace "default" { + policy = "foo" + } + `, + "Invalid namespace policy", + nil, + }, + { + ` + namespace "default" { + capabilities = ["deny", "foo"] + } + `, + "Invalid namespace capability", + nil, + }, + { + ` + agent { + policy = "foo" + } + `, + "Invalid agent policy", + nil, + }, + { + ` + node { + policy = "foo" + } + `, + "Invalid node policy", + nil, + }, + { + ` + operator { + policy = "foo" + } + `, + "Invalid operator policy", + nil, + }, + { + ` + namespace "has a space"{ + policy = "read" + } + `, + "Invalid namespace name", + nil, + }, + } + + for idx, tc := range tcases { + t.Run(fmt.Sprintf("%d", idx), func(t *testing.T) { + p, err := Parse(tc.Raw) + if err != nil { + if tc.ErrStr == "" { + t.Fatalf("Unexpected err: %v", err) + } + if !strings.Contains(err.Error(), tc.ErrStr) { + t.Fatalf("Unexpected err: %v", err) + } + return + } + if err == nil && tc.ErrStr != "" { + t.Fatalf("Missing expected err") + } + tc.Expect.Raw = tc.Raw + assert.EqualValues(t, tc.Expect, p) + }) + } +} diff --git a/api/acl.go b/api/acl.go new file mode 100644 index 000000000..bac698237 --- /dev/null +++ b/api/acl.go @@ -0,0 +1,186 @@ +package api + +import ( + "fmt" + "time" +) + +// ACLPolicies is used to query the ACL Policy endpoints. +type ACLPolicies struct { + client *Client +} + +// ACLPolicies returns a new handle on the ACL policies. +func (c *Client) ACLPolicies() *ACLPolicies { + return &ACLPolicies{client: c} +} + +// List is used to dump all of the policies. +func (a *ACLPolicies) List(q *QueryOptions) ([]*ACLPolicyListStub, *QueryMeta, error) { + var resp []*ACLPolicyListStub + qm, err := a.client.query("/v1/acl/policies", &resp, q) + if err != nil { + return nil, nil, err + } + return resp, qm, nil +} + +// Upsert is used to create or update a policy +func (a *ACLPolicies) Upsert(policy *ACLPolicy, q *WriteOptions) (*WriteMeta, error) { + if policy == nil || policy.Name == "" { + return nil, fmt.Errorf("missing policy name") + } + wm, err := a.client.write("/v1/acl/policy/"+policy.Name, policy, nil, q) + if err != nil { + return nil, err + } + return wm, nil +} + +// Delete is used to delete a policy +func (a *ACLPolicies) Delete(policyName string, q *WriteOptions) (*WriteMeta, error) { + if policyName == "" { + return nil, fmt.Errorf("missing policy name") + } + wm, err := a.client.delete("/v1/acl/policy/"+policyName, nil, q) + if err != nil { + return nil, err + } + return wm, nil +} + +// Info is used to query a specific policy +func (a *ACLPolicies) Info(policyName string, q *QueryOptions) (*ACLPolicy, *QueryMeta, error) { + if policyName == "" { + return nil, nil, fmt.Errorf("missing policy name") + } + var resp ACLPolicy + wm, err := a.client.query("/v1/acl/policy/"+policyName, &resp, q) + if err != nil { + return nil, nil, err + } + return &resp, wm, nil +} + +// ACLTokens is used to query the ACL token endpoints. +type ACLTokens struct { + client *Client +} + +// ACLTokens returns a new handle on the ACL tokens. +func (c *Client) ACLTokens() *ACLTokens { + return &ACLTokens{client: c} +} + +// Bootstrap is used to get the initial bootstrap token +func (a *ACLTokens) Bootstrap(q *WriteOptions) (*ACLToken, *WriteMeta, error) { + var resp ACLToken + wm, err := a.client.write("/v1/acl/bootstrap", nil, &resp, q) + if err != nil { + return nil, nil, err + } + return &resp, wm, nil +} + +// List is used to dump all of the tokens. +func (a *ACLTokens) List(q *QueryOptions) ([]*ACLTokenListStub, *QueryMeta, error) { + var resp []*ACLTokenListStub + qm, err := a.client.query("/v1/acl/tokens", &resp, q) + if err != nil { + return nil, nil, err + } + return resp, qm, nil +} + +// Create is used to create a token +func (a *ACLTokens) Create(token *ACLToken, q *WriteOptions) (*ACLToken, *WriteMeta, error) { + if token.AccessorID != "" { + return nil, nil, fmt.Errorf("cannot specify Accessor ID") + } + var resp ACLToken + wm, err := a.client.write("/v1/acl/token", token, &resp, q) + if err != nil { + return nil, nil, err + } + return &resp, wm, nil +} + +// Update is used to update an existing token +func (a *ACLTokens) Update(token *ACLToken, q *WriteOptions) (*ACLToken, *WriteMeta, error) { + if token.AccessorID == "" { + return nil, nil, fmt.Errorf("missing accessor ID") + } + var resp ACLToken + wm, err := a.client.write("/v1/acl/token/"+token.AccessorID, + token, &resp, q) + if err != nil { + return nil, nil, err + } + return &resp, wm, nil +} + +// Delete is used to delete a token +func (a *ACLTokens) Delete(accessorID string, q *WriteOptions) (*WriteMeta, error) { + if accessorID == "" { + return nil, fmt.Errorf("missing accessor ID") + } + wm, err := a.client.delete("/v1/acl/token/"+accessorID, nil, q) + if err != nil { + return nil, err + } + return wm, nil +} + +// Info is used to query a token +func (a *ACLTokens) Info(accessorID string, q *QueryOptions) (*ACLToken, *QueryMeta, error) { + if accessorID == "" { + return nil, nil, fmt.Errorf("missing accessor ID") + } + var resp ACLToken + wm, err := a.client.query("/v1/acl/token/"+accessorID, &resp, q) + if err != nil { + return nil, nil, err + } + return &resp, wm, nil +} + +// ACLPolicyListStub is used to for listing ACL policies +type ACLPolicyListStub struct { + Name string + Description string + CreateIndex uint64 + ModifyIndex uint64 +} + +// ACLPolicy is used to represent an ACL policy +type ACLPolicy struct { + Name string + Description string + Rules string + CreateIndex uint64 + ModifyIndex uint64 +} + +// ACLToken represents a client token which is used to Authenticate +type ACLToken struct { + AccessorID string + SecretID string + Name string + Type string + Policies []string + Global bool + CreateTime time.Time + CreateIndex uint64 + ModifyIndex uint64 +} + +type ACLTokenListStub struct { + AccessorID string + Name string + Type string + Policies []string + Global bool + CreateTime time.Time + CreateIndex uint64 + ModifyIndex uint64 +} diff --git a/api/acl_test.go b/api/acl_test.go new file mode 100644 index 000000000..b987486ef --- /dev/null +++ b/api/acl_test.go @@ -0,0 +1,207 @@ +package api + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestACLPolicies_ListUpsert(t *testing.T) { + t.Parallel() + c, s, _ := makeACLClient(t, nil, nil) + defer s.Stop() + ap := c.ACLPolicies() + + // Listing when nothing exists returns empty + result, qm, err := ap.List(nil) + if err != nil { + t.Fatalf("err: %s", err) + } + if qm.LastIndex != 1 { + t.Fatalf("bad index: %d", qm.LastIndex) + } + if n := len(result); n != 0 { + t.Fatalf("expected 0 policies, got: %d", n) + } + + // Register a policy + policy := &ACLPolicy{ + Name: "test", + Description: "test", + Rules: `namespace "default" { + policy = "read" + } + `, + } + wm, err := ap.Upsert(policy, nil) + assert.Nil(t, err) + assertWriteMeta(t, wm) + + // Check the list again + result, qm, err = ap.List(nil) + if err != nil { + t.Fatalf("err: %s", err) + } + assertQueryMeta(t, qm) + if len(result) != 1 { + t.Fatalf("expected policy, got: %#v", result) + } +} + +func TestACLPolicies_Delete(t *testing.T) { + t.Parallel() + c, s, _ := makeACLClient(t, nil, nil) + defer s.Stop() + ap := c.ACLPolicies() + + // Register a policy + policy := &ACLPolicy{ + Name: "test", + Description: "test", + Rules: `namespace "default" { + policy = "read" + } + `, + } + wm, err := ap.Upsert(policy, nil) + assert.Nil(t, err) + assertWriteMeta(t, wm) + + // Delete the policy + wm, err = ap.Delete(policy.Name, nil) + assert.Nil(t, err) + assertWriteMeta(t, wm) + + // Check the list again + result, qm, err := ap.List(nil) + if err != nil { + t.Fatalf("err: %s", err) + } + assertQueryMeta(t, qm) + if len(result) != 0 { + t.Fatalf("unexpected policy, got: %#v", result) + } +} + +func TestACLPolicies_Info(t *testing.T) { + t.Parallel() + c, s, _ := makeACLClient(t, nil, nil) + defer s.Stop() + ap := c.ACLPolicies() + + // Register a policy + policy := &ACLPolicy{ + Name: "test", + Description: "test", + Rules: `namespace "default" { + policy = "read" + } + `, + } + wm, err := ap.Upsert(policy, nil) + assert.Nil(t, err) + assertWriteMeta(t, wm) + + // Query the policy + out, qm, err := ap.Info(policy.Name, nil) + assert.Nil(t, err) + assertQueryMeta(t, qm) + assert.Equal(t, policy.Name, out.Name) +} + +func TestACLTokens_List(t *testing.T) { + t.Parallel() + c, s, _ := makeACLClient(t, nil, nil) + defer s.Stop() + at := c.ACLTokens() + + // Expect out bootstrap token + result, qm, err := at.List(nil) + if err != nil { + t.Fatalf("err: %s", err) + } + if qm.LastIndex == 0 { + t.Fatalf("bad index: %d", qm.LastIndex) + } + if n := len(result); n != 1 { + t.Fatalf("expected 1 token, got: %d", n) + } +} + +func TestACLTokens_CreateUpdate(t *testing.T) { + t.Parallel() + c, s, _ := makeACLClient(t, nil, nil) + defer s.Stop() + at := c.ACLTokens() + + token := &ACLToken{ + Name: "foo", + Type: "client", + Policies: []string{"foo1"}, + } + + // Create the token + out, wm, err := at.Create(token, nil) + assert.Nil(t, err) + assertWriteMeta(t, wm) + assert.NotNil(t, out) + + // Update the token + out.Name = "other" + out2, wm, err := at.Update(out, nil) + assert.Nil(t, err) + assertWriteMeta(t, wm) + assert.NotNil(t, out2) + + // Verify the change took hold + assert.Equal(t, out.Name, out2.Name) +} + +func TestACLTokens_Info(t *testing.T) { + t.Parallel() + c, s, _ := makeACLClient(t, nil, nil) + defer s.Stop() + at := c.ACLTokens() + + token := &ACLToken{ + Name: "foo", + Type: "client", + Policies: []string{"foo1"}, + } + + // Create the token + out, wm, err := at.Create(token, nil) + assert.Nil(t, err) + assertWriteMeta(t, wm) + assert.NotNil(t, out) + + // Query the token + out2, qm, err := at.Info(out.AccessorID, nil) + assert.Nil(t, err) + assertQueryMeta(t, qm) + assert.Equal(t, out, out2) +} + +func TestACLTokens_Delete(t *testing.T) { + t.Parallel() + c, s, _ := makeACLClient(t, nil, nil) + defer s.Stop() + at := c.ACLTokens() + + token := &ACLToken{ + Name: "foo", + Type: "client", + Policies: []string{"foo1"}, + } + + // Create the token + out, wm, err := at.Create(token, nil) + assert.Nil(t, err) + assertWriteMeta(t, wm) + assert.NotNil(t, out) + + // Delete the token + wm, err = at.Delete(out.AccessorID, nil) + assert.Nil(t, err) + assertWriteMeta(t, wm) +} diff --git a/api/api.go b/api/api.go index 2c957695c..3d83de8e9 100644 --- a/api/api.go +++ b/api/api.go @@ -41,6 +41,9 @@ type QueryOptions struct { // Set HTTP parameters on the query. Params map[string]string + + // SecretID is the secret ID of an ACL token + SecretID string } // WriteOptions are used to parameterize a write @@ -48,6 +51,9 @@ type WriteOptions struct { // Providing a datacenter overwrites the region provided // by the Config Region string + + // SecretID is the secret ID of an ACL token + SecretID string } // QueryMeta is used to return meta data about a query @@ -97,6 +103,9 @@ type Config struct { // httpClient is the client to use. Default will be used if not provided. httpClient *http.Client + // SecretID to use. This can be overwritten per request. + SecretID string + // HttpAuth is the auth info to use for http access. HttpAuth *HttpBasicAuth @@ -121,6 +130,7 @@ func (c *Config) ClientConfig(region, address string, tlsEnabled bool) *Config { Address: fmt.Sprintf("%s://%s", scheme, address), Region: region, httpClient: defaultConfig.httpClient, + SecretID: c.SecretID, HttpAuth: c.HttpAuth, WaitTime: c.WaitTime, TLSConfig: c.TLSConfig.Copy(), @@ -217,7 +227,9 @@ func DefaultConfig() *Config { config.TLSConfig.Insecure = insecure } } - + if v := os.Getenv("NOMAD_TOKEN"); v != "" { + config.SecretID = v + } return config } @@ -345,12 +357,18 @@ func (c *Client) getNodeClientImpl(nodeID string, q *QueryOptions, lookup nodeLo return NewClient(conf) } +// SetSecretID sets the ACL token secret for API requests. +func (c *Client) SetSecretID(secretID string) { + c.config.SecretID = secretID +} + // request is used to help build up a request type request struct { config *Config method string url *url.URL params url.Values + token string body io.Reader obj interface{} } @@ -364,6 +382,9 @@ func (r *request) setQueryOptions(q *QueryOptions) { if q.Region != "" { r.params.Set("region", q.Region) } + if q.SecretID != "" { + r.token = q.SecretID + } if q.AllowStale { r.params.Set("stale", "") } @@ -395,6 +416,9 @@ func (r *request) setWriteOptions(q *WriteOptions) { if q.Region != "" { r.params.Set("region", q.Region) } + if q.SecretID != "" { + r.token = q.SecretID + } } // toHTTP converts the request to an HTTP request @@ -427,6 +451,10 @@ func (r *request) toHTTP() (*http.Request, error) { } req.Header.Add("Accept-Encoding", "gzip") + if r.token != "" { + req.Header.Set("X-Nomad-Token", r.token) + } + req.URL.Host = r.url.Host req.URL.Scheme = r.url.Scheme req.Host = r.url.Host @@ -457,6 +485,9 @@ func (c *Client) newRequest(method, path string) (*request, error) { if c.config.WaitTime != 0 { r.params.Set("wait", durToMsec(r.config.WaitTime)) } + if c.config.SecretID != "" { + r.token = r.config.SecretID + } // Add in the query parameters, if any for key, values := range u.Query() { diff --git a/api/api_test.go b/api/api_test.go index ae79fee40..a38feffb7 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -24,6 +24,24 @@ func init() { seen = make(map[*testing.T]struct{}) } +func makeACLClient(t *testing.T, cb1 configCallback, + cb2 testutil.ServerConfigCallback) (*Client, *testutil.TestServer, *ACLToken) { + client, server := makeClient(t, cb1, func(c *testutil.TestServerConfig) { + c.ACL.Enabled = true + if cb2 != nil { + cb2(c) + } + }) + + // Get the root token + root, _, err := client.ACLTokens().Bootstrap(nil) + if err != nil { + t.Fatalf("failed to bootstrap ACLs: %v", err) + } + client.SetSecretID(root.SecretID) + return client, server, root +} + func makeClient(t *testing.T, cb1 configCallback, cb2 testutil.ServerConfigCallback) (*Client, *testutil.TestServer) { // Make client config @@ -97,6 +115,7 @@ func TestDefaultConfig_env(t *testing.T) { t.Parallel() url := "http://1.2.3.4:5678" auth := []string{"nomaduser", "12345"} + token := "foobar" os.Setenv("NOMAD_ADDR", url) defer os.Setenv("NOMAD_ADDR", "") @@ -104,6 +123,9 @@ func TestDefaultConfig_env(t *testing.T) { os.Setenv("NOMAD_HTTP_AUTH", strings.Join(auth, ":")) defer os.Setenv("NOMAD_HTTP_AUTH", "") + os.Setenv("NOMAD_TOKEN", token) + defer os.Setenv("NOMAD_TOKEN", "") + config := DefaultConfig() if config.Address != url { @@ -117,6 +139,10 @@ func TestDefaultConfig_env(t *testing.T) { if config.HttpAuth.Password != auth[1] { t.Errorf("expected %q to be %q", config.HttpAuth.Password, auth[1]) } + + if config.SecretID != token { + t.Errorf("Expected %q to be %q", config.SecretID, token) + } } func TestSetQueryOptions(t *testing.T) { @@ -130,6 +156,7 @@ func TestSetQueryOptions(t *testing.T) { AllowStale: true, WaitIndex: 1000, WaitTime: 100 * time.Second, + SecretID: "foobar", } r.setQueryOptions(q) @@ -145,6 +172,9 @@ func TestSetQueryOptions(t *testing.T) { if r.params.Get("wait") != "100000ms" { t.Fatalf("bad: %v", r.params) } + if r.token != "foobar" { + t.Fatalf("bad: %v", r.token) + } } func TestSetWriteOptions(t *testing.T) { @@ -154,13 +184,17 @@ func TestSetWriteOptions(t *testing.T) { r, _ := c.newRequest("GET", "/v1/jobs") q := &WriteOptions{ - Region: "foo", + Region: "foo", + SecretID: "foobar", } r.setWriteOptions(q) if r.params.Get("region") != "foo" { t.Fatalf("bad: %v", r.params) } + if r.token != "foobar" { + t.Fatalf("bad: %v", r.token) + } } func TestRequestToHTTP(t *testing.T) { @@ -170,7 +204,8 @@ func TestRequestToHTTP(t *testing.T) { r, _ := c.newRequest("DELETE", "/v1/jobs/foo") q := &QueryOptions{ - Region: "foo", + Region: "foo", + SecretID: "foobar", } r.setQueryOptions(q) req, err := r.toHTTP() @@ -184,6 +219,9 @@ func TestRequestToHTTP(t *testing.T) { if req.URL.RequestURI() != "/v1/jobs/foo?region=foo" { t.Fatalf("bad: %v", req) } + if req.Header.Get("X-Nomad-Token") != "foobar" { + t.Fatalf("bad: %v", req) + } } func TestParseQueryMeta(t *testing.T) { diff --git a/api/jobs.go b/api/jobs.go index da0efa42d..4bba48cf9 100644 --- a/api/jobs.go +++ b/api/jobs.go @@ -729,6 +729,9 @@ func (j *Job) AddPeriodicConfig(cfg *PeriodicConfig) *Job { type WriteRequest struct { // The target region for this write Region string + + // SecretID is the secret ID of an ACL token + SecretID string } // JobValidateRequest is used to validate a job diff --git a/client/acl.go b/client/acl.go new file mode 100644 index 000000000..87ca8badd --- /dev/null +++ b/client/acl.go @@ -0,0 +1,219 @@ +package client + +import ( + "time" + + metrics "github.com/armon/go-metrics" + lru "github.com/hashicorp/golang-lru" + "github.com/hashicorp/nomad/acl" + "github.com/hashicorp/nomad/nomad/structs" +) + +const ( + // policyCacheSize is the number of ACL policies to keep cached. Policies have a fetching cost + // so we keep the hot policies cached to reduce the ACL token resolution time. + policyCacheSize = 64 + + // aclCacheSize is the number of ACL objects to keep cached. ACLs have a parsing and + // construction cost, so we keep the hot objects cached to reduce the ACL token resolution time. + aclCacheSize = 64 + + // tokenCacheSize is the number of ACL tokens to keep cached. Tokens have a fetching cost, + // so we keep the hot tokens cached to reduce the lookups. + tokenCacheSize = 64 +) + +// clientACLResolver holds the state required for client resolution +// of ACLs +type clientACLResolver struct { + // aclCache is used to maintain the parsed ACL objects + aclCache *lru.TwoQueueCache + + // policyCache is used to maintain the fetched policy objects + policyCache *lru.TwoQueueCache + + // tokenCache is used to maintain the fetched token objects + tokenCache *lru.TwoQueueCache +} + +// init is used to setup the client resolver state +func (c *clientACLResolver) init() error { + // Create the ACL object cache + var err error + c.aclCache, err = lru.New2Q(aclCacheSize) + if err != nil { + return err + } + c.policyCache, err = lru.New2Q(policyCacheSize) + if err != nil { + return err + } + c.tokenCache, err = lru.New2Q(tokenCacheSize) + if err != nil { + return err + } + return nil +} + +// cachedACLValue is used to manage ACL Token or Policy TTLs +type cachedACLValue struct { + Token *structs.ACLToken + Policy *structs.ACLPolicy + CacheTime time.Time +} + +// Age is the time since the token was cached +func (c *cachedACLValue) Age() time.Duration { + return time.Since(c.CacheTime) +} + +// ResolveToken is used to translate an ACL Token Secret ID into +// an ACL object, nil if ACLs are disabled, or an error. +func (c *Client) ResolveToken(secretID string) (*acl.ACL, error) { + // Fast-path if ACLs are disabled + if !c.config.ACLEnabled { + return nil, nil + } + defer metrics.MeasureSince([]string{"client", "acl", "resolve_token"}, time.Now()) + + // Resolve the token value + token, err := c.resolveTokenValue(secretID) + if err != nil { + return nil, err + } + if token == nil { + return nil, structs.ErrTokenNotFound + } + + // Check if this is a management token + if token.Type == structs.ACLManagementToken { + return acl.ManagementACL, nil + } + + // Resolve the policies + policies, err := c.resolvePolicies(token.SecretID, token.Policies) + if err != nil { + return nil, err + } + + // Resolve the ACL object + aclObj, err := structs.CompileACLObject(c.aclCache, policies) + if err != nil { + return nil, err + } + return aclObj, nil +} + +// resolveTokenValue is used to translate a secret ID into an ACL token with caching +// We use a local cache up to the TTL limit, and then resolve via a server. If we cannot +// reach a server, but have a cached value we extend the TTL to gracefully handle outages. +func (c *Client) resolveTokenValue(secretID string) (*structs.ACLToken, error) { + // Hot-path the anonymous token + if secretID == "" { + return structs.AnonymousACLToken, nil + } + + // Lookup the token in the cache + raw, ok := c.tokenCache.Get(secretID) + if ok { + cached := raw.(*cachedACLValue) + if cached.Age() <= c.config.ACLTokenTTL { + return cached.Token, nil + } + } + + // Lookup the token + req := structs.ResolveACLTokenRequest{ + SecretID: secretID, + QueryOptions: structs.QueryOptions{ + Region: c.Region(), + AllowStale: true, + }, + } + var resp structs.ResolveACLTokenResponse + if err := c.RPC("ACL.ResolveToken", &req, &resp); err != nil { + // If we encounter an error but have a cached value, mask the error and extend the cache + if ok { + c.logger.Printf("[WARN] client: failed to resolve token, using expired cached value: %v", err) + cached := raw.(*cachedACLValue) + return cached.Token, nil + } + return nil, err + } + + // Cache the response (positive or negative) + c.tokenCache.Add(secretID, &cachedACLValue{ + Token: resp.Token, + CacheTime: time.Now(), + }) + return resp.Token, nil +} + +// resolvePolicies is used to translate a set of named ACL policies into the objects. +// We cache the policies locally, and fault them from a server as necessary. Policies +// are cached for a TTL, and then refreshed. If a server cannot be reached, the cache TTL +// will be ignored to gracefully handle outages. +func (c *Client) resolvePolicies(secretID string, policies []string) ([]*structs.ACLPolicy, error) { + var out []*structs.ACLPolicy + var expired []*structs.ACLPolicy + var missing []string + + // Scan the cache for each policy + for _, policyName := range policies { + // Lookup the policy in the cache + raw, ok := c.policyCache.Get(policyName) + if !ok { + missing = append(missing, policyName) + continue + } + + // Check if the cached value is valid or expired + cached := raw.(*cachedACLValue) + if cached.Age() <= c.config.ACLPolicyTTL { + out = append(out, cached.Policy) + } else { + expired = append(expired, cached.Policy) + } + } + + // Hot-path if we have no missing or expired policies + if len(missing)+len(expired) == 0 { + return out, nil + } + + // Lookup the missing and expired policies + fetch := missing + for _, p := range expired { + fetch = append(fetch, p.Name) + } + req := structs.ACLPolicySetRequest{ + Names: fetch, + QueryOptions: structs.QueryOptions{ + Region: c.Region(), + SecretID: secretID, + AllowStale: true, + }, + } + var resp structs.ACLPolicySetResponse + if err := c.RPC("ACL.GetPolicies", &req, &resp); err != nil { + // If we encounter an error but have cached policies, mask the error and extend the cache + if len(missing) == 0 { + c.logger.Printf("[WARN] client: failed to resolve policies, using expired cached value: %v", err) + out = append(out, expired...) + return out, nil + } + return nil, err + } + + // Handle each output + for _, policy := range resp.Policies { + c.policyCache.Add(policy.Name, &cachedACLValue{ + Policy: policy, + CacheTime: time.Now(), + }) + out = append(out, policy) + } + + // Return the valid policies + return out, nil +} diff --git a/client/acl_test.go b/client/acl_test.go new file mode 100644 index 000000000..90a08b0e0 --- /dev/null +++ b/client/acl_test.go @@ -0,0 +1,166 @@ +package client + +import ( + "testing" + + "github.com/hashicorp/nomad/acl" + "github.com/hashicorp/nomad/client/config" + "github.com/hashicorp/nomad/nomad/mock" + "github.com/hashicorp/nomad/nomad/structs" + "github.com/hashicorp/nomad/testutil" + "github.com/stretchr/testify/assert" +) + +func TestClient_ACL_resolveTokenValue(t *testing.T) { + s1, _, _ := testACLServer(t, nil) + defer s1.Shutdown() + testutil.WaitForLeader(t, s1.RPC) + + c1 := testClient(t, func(c *config.Config) { + c.RPCHandler = s1 + c.ACLEnabled = true + }) + defer c1.Shutdown() + + // Create a policy / token + policy := mock.ACLPolicy() + policy2 := mock.ACLPolicy() + token := mock.ACLToken() + token.Policies = []string{policy.Name, policy2.Name} + token2 := mock.ACLToken() + token2.Type = structs.ACLManagementToken + token2.Policies = nil + err := s1.State().UpsertACLPolicies(100, []*structs.ACLPolicy{policy, policy2}) + assert.Nil(t, err) + err = s1.State().UpsertACLTokens(110, []*structs.ACLToken{token, token2}) + assert.Nil(t, err) + + // Test the client resolution + out0, err := c1.resolveTokenValue("") + assert.Nil(t, err) + assert.NotNil(t, out0) + assert.Equal(t, structs.AnonymousACLToken, out0) + + // Test the client resolution + out1, err := c1.resolveTokenValue(token.SecretID) + assert.Nil(t, err) + assert.NotNil(t, out1) + assert.Equal(t, token, out1) + + out2, err := c1.resolveTokenValue(token2.SecretID) + assert.Nil(t, err) + assert.NotNil(t, out2) + assert.Equal(t, token2, out2) + + out3, err := c1.resolveTokenValue(token.SecretID) + assert.Nil(t, err) + assert.NotNil(t, out3) + if out1 != out3 { + t.Fatalf("bad caching") + } +} + +func TestClient_ACL_resolvePolicies(t *testing.T) { + s1, _, root := testACLServer(t, nil) + defer s1.Shutdown() + testutil.WaitForLeader(t, s1.RPC) + + c1 := testClient(t, func(c *config.Config) { + c.RPCHandler = s1 + c.ACLEnabled = true + }) + defer c1.Shutdown() + + // Create a policy / token + policy := mock.ACLPolicy() + policy2 := mock.ACLPolicy() + token := mock.ACLToken() + token.Policies = []string{policy.Name, policy2.Name} + token2 := mock.ACLToken() + token2.Type = structs.ACLManagementToken + token2.Policies = nil + err := s1.State().UpsertACLPolicies(100, []*structs.ACLPolicy{policy, policy2}) + assert.Nil(t, err) + err = s1.State().UpsertACLTokens(110, []*structs.ACLToken{token, token2}) + assert.Nil(t, err) + + // Test the client resolution + out, err := c1.resolvePolicies(root.SecretID, []string{policy.Name, policy2.Name}) + assert.Nil(t, err) + assert.Equal(t, 2, len(out)) + + // Test caching + out2, err := c1.resolvePolicies(root.SecretID, []string{policy.Name, policy2.Name}) + assert.Nil(t, err) + assert.Equal(t, 2, len(out2)) + + // Check we get the same objects back (ignore ordering) + if out[0] != out2[0] && out[0] != out2[1] { + t.Fatalf("bad caching") + } +} + +func TestClient_ACL_ResolveToken_Disabled(t *testing.T) { + s1, _ := testServer(t, nil) + defer s1.Shutdown() + testutil.WaitForLeader(t, s1.RPC) + + c1 := testClient(t, func(c *config.Config) { + c.RPCHandler = s1 + }) + defer c1.Shutdown() + + // Should always get nil when disabled + aclObj, err := c1.ResolveToken("blah") + assert.Nil(t, err) + assert.Nil(t, aclObj) +} + +func TestClient_ACL_ResolveToken(t *testing.T) { + s1, _, _ := testACLServer(t, nil) + defer s1.Shutdown() + testutil.WaitForLeader(t, s1.RPC) + + c1 := testClient(t, func(c *config.Config) { + c.RPCHandler = s1 + c.ACLEnabled = true + }) + defer c1.Shutdown() + + // Create a policy / token + policy := mock.ACLPolicy() + policy2 := mock.ACLPolicy() + token := mock.ACLToken() + token.Policies = []string{policy.Name, policy2.Name} + token2 := mock.ACLToken() + token2.Type = structs.ACLManagementToken + token2.Policies = nil + err := s1.State().UpsertACLPolicies(100, []*structs.ACLPolicy{policy, policy2}) + assert.Nil(t, err) + err = s1.State().UpsertACLTokens(110, []*structs.ACLToken{token, token2}) + assert.Nil(t, err) + + // Test the client resolution + out, err := c1.ResolveToken(token.SecretID) + assert.Nil(t, err) + assert.NotNil(t, out) + + // Test caching + out2, err := c1.ResolveToken(token.SecretID) + assert.Nil(t, err) + if out != out2 { + t.Fatalf("should be cached") + } + + // Test management token + out3, err := c1.ResolveToken(token2.SecretID) + assert.Nil(t, err) + if acl.ManagementACL != out3 { + t.Fatalf("should be management") + } + + // Test bad token + out4, err := c1.ResolveToken(structs.GenerateUUID()) + assert.Equal(t, structs.ErrTokenNotFound, err) + assert.Nil(t, out4) +} diff --git a/client/client.go b/client/client.go index b72e54a1a..c5ed19097 100644 --- a/client/client.go +++ b/client/client.go @@ -150,6 +150,9 @@ type Client struct { // garbageCollector is used to garbage collect terminal allocations present // in the node automatically garbageCollector *AllocGarbageCollector + + // clientACLResolver holds the ACL resolution state + clientACLResolver } var ( @@ -192,6 +195,11 @@ func NewClient(cfg *config.Config, consulCatalog consul.CatalogAPI, consulServic return nil, fmt.Errorf("failed to initialize client: %v", err) } + // Initialize the ACL state + if err := c.clientACLResolver.init(); err != nil { + return nil, fmt.Errorf("failed to initialize ACL state: %v", err) + } + // Add the stats collector statsCollector := stats.NewHostStatsCollector(logger, c.config.AllocDir) c.hostStatsCollector = statsCollector diff --git a/client/client_test.go b/client/client_test.go index 30baff15b..0e77e6cb8 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -30,6 +30,21 @@ func getPort() int { return 1030 + int(rand.Int31n(6440)) } +func testACLServer(t *testing.T, cb func(*nomad.Config)) (*nomad.Server, string, *structs.ACLToken) { + server, addr := testServer(t, func(c *nomad.Config) { + c.ACLEnabled = true + if cb != nil { + cb(c) + } + }) + token := mock.ACLManagementToken() + err := server.State().BootstrapACLTokens(1, token) + if err != nil { + t.Fatalf("failed to bootstrap ACL token: %v", err) + } + return server, addr, token +} + func testServer(t *testing.T, cb func(*nomad.Config)) (*nomad.Server, string) { // Setup the default settings config := nomad.DefaultConfig() diff --git a/client/config/config.go b/client/config/config.go index 266d4099e..6ce263eb0 100644 --- a/client/config/config.go +++ b/client/config/config.go @@ -179,6 +179,15 @@ type Config struct { // NoHostUUID disables using the host's UUID and will force generation of a // random UUID. NoHostUUID bool + + // ACLEnabled controls if ACL enforcement and management is enabled. + ACLEnabled bool + + // ACLTokenTTL is how long we cache token values for + ACLTokenTTL time.Duration + + // ACLPolicyTTL is how long we cache policy values for + ACLPolicyTTL time.Duration } func (c *Config) Copy() *Config { diff --git a/command/agent/acl_endpoint.go b/command/agent/acl_endpoint.go new file mode 100644 index 000000000..be3535f01 --- /dev/null +++ b/command/agent/acl_endpoint.go @@ -0,0 +1,250 @@ +package agent + +import ( + "net/http" + "strings" + + "github.com/hashicorp/nomad/nomad/structs" +) + +func (s *HTTPServer) ACLPoliciesRequest(resp http.ResponseWriter, req *http.Request) (interface{}, error) { + if req.Method != "GET" { + return nil, CodedError(405, ErrInvalidMethod) + } + + args := structs.ACLPolicyListRequest{} + if s.parse(resp, req, &args.Region, &args.QueryOptions) { + return nil, nil + } + + var out structs.ACLPolicyListResponse + if err := s.agent.RPC("ACL.ListPolicies", &args, &out); err != nil { + return nil, err + } + + setMeta(resp, &out.QueryMeta) + if out.Policies == nil { + out.Policies = make([]*structs.ACLPolicyListStub, 0) + } + return out.Policies, nil +} + +func (s *HTTPServer) ACLPolicySpecificRequest(resp http.ResponseWriter, req *http.Request) (interface{}, error) { + name := strings.TrimPrefix(req.URL.Path, "/v1/acl/policy/") + if len(name) == 0 { + return nil, CodedError(400, "Missing Policy Name") + } + switch req.Method { + case "GET": + return s.aclPolicyQuery(resp, req, name) + case "PUT", "POST": + return s.aclPolicyUpdate(resp, req, name) + case "DELETE": + return s.aclPolicyDelete(resp, req, name) + default: + return nil, CodedError(405, ErrInvalidMethod) + } +} + +func (s *HTTPServer) aclPolicyQuery(resp http.ResponseWriter, req *http.Request, + policyName string) (interface{}, error) { + args := structs.ACLPolicySpecificRequest{ + Name: policyName, + } + if s.parse(resp, req, &args.Region, &args.QueryOptions) { + return nil, nil + } + + var out structs.SingleACLPolicyResponse + if err := s.agent.RPC("ACL.GetPolicy", &args, &out); err != nil { + return nil, err + } + + setMeta(resp, &out.QueryMeta) + if out.Policy == nil { + return nil, CodedError(404, "ACL policy not found") + } + return out.Policy, nil +} + +func (s *HTTPServer) aclPolicyUpdate(resp http.ResponseWriter, req *http.Request, + policyName string) (interface{}, error) { + // Parse the policy + var policy structs.ACLPolicy + if err := decodeBody(req, &policy); err != nil { + return nil, CodedError(500, err.Error()) + } + + // Ensure the policy name matches + if policy.Name != policyName { + return nil, CodedError(400, "ACL policy name does not match request path") + } + + // Format the request + args := structs.ACLPolicyUpsertRequest{ + Policies: []*structs.ACLPolicy{&policy}, + } + s.parseWrite(req, &args.WriteRequest) + + var out structs.GenericResponse + if err := s.agent.RPC("ACL.UpsertPolicies", &args, &out); err != nil { + return nil, err + } + setIndex(resp, out.Index) + return nil, nil +} + +func (s *HTTPServer) aclPolicyDelete(resp http.ResponseWriter, req *http.Request, + policyName string) (interface{}, error) { + + args := structs.ACLPolicyDeleteRequest{ + Names: []string{policyName}, + } + s.parseWrite(req, &args.WriteRequest) + + var out structs.GenericResponse + if err := s.agent.RPC("ACL.DeletePolicies", &args, &out); err != nil { + return nil, err + } + setIndex(resp, out.Index) + return nil, nil +} + +func (s *HTTPServer) ACLTokensRequest(resp http.ResponseWriter, req *http.Request) (interface{}, error) { + if req.Method != "GET" { + return nil, CodedError(405, ErrInvalidMethod) + } + + args := structs.ACLTokenListRequest{} + if s.parse(resp, req, &args.Region, &args.QueryOptions) { + return nil, nil + } + + var out structs.ACLTokenListResponse + if err := s.agent.RPC("ACL.ListTokens", &args, &out); err != nil { + return nil, err + } + + setMeta(resp, &out.QueryMeta) + if out.Tokens == nil { + out.Tokens = make([]*structs.ACLTokenListStub, 0) + } + return out.Tokens, nil +} + +func (s *HTTPServer) ACLTokenBootstrap(resp http.ResponseWriter, req *http.Request) (interface{}, error) { + // Ensure this is a PUT or POST + if !(req.Method == "PUT" || req.Method == "POST") { + return nil, CodedError(405, ErrInvalidMethod) + } + + // Format the request + args := structs.ACLTokenBootstrapRequest{} + s.parseWrite(req, &args.WriteRequest) + + var out structs.ACLTokenUpsertResponse + if err := s.agent.RPC("ACL.Bootstrap", &args, &out); err != nil { + return nil, err + } + setIndex(resp, out.Index) + if len(out.Tokens) > 0 { + return out.Tokens[0], nil + } + return nil, nil +} + +func (s *HTTPServer) ACLTokenSpecificRequest(resp http.ResponseWriter, req *http.Request) (interface{}, error) { + accessor := strings.TrimPrefix(req.URL.Path, "/v1/acl/token") + + // If there is no accessor, this must be a create + if len(accessor) == 0 { + if !(req.Method == "PUT" || req.Method == "POST") { + return nil, CodedError(405, ErrInvalidMethod) + } + return s.aclTokenUpdate(resp, req, "") + } + + // Check if no accessor is given past the slash + accessor = accessor[1:] + if accessor == "" { + return nil, CodedError(400, "Missing Token Accessor") + } + + switch req.Method { + case "GET": + return s.aclTokenQuery(resp, req, accessor) + case "PUT", "POST": + return s.aclTokenUpdate(resp, req, accessor) + case "DELETE": + return s.aclTokenDelete(resp, req, accessor) + default: + return nil, CodedError(405, ErrInvalidMethod) + } +} + +func (s *HTTPServer) aclTokenQuery(resp http.ResponseWriter, req *http.Request, + tokenAccessor string) (interface{}, error) { + args := structs.ACLTokenSpecificRequest{ + AccessorID: tokenAccessor, + } + if s.parse(resp, req, &args.Region, &args.QueryOptions) { + return nil, nil + } + + var out structs.SingleACLTokenResponse + if err := s.agent.RPC("ACL.GetToken", &args, &out); err != nil { + return nil, err + } + + setMeta(resp, &out.QueryMeta) + if out.Token == nil { + return nil, CodedError(404, "ACL token not found") + } + return out.Token, nil +} + +func (s *HTTPServer) aclTokenUpdate(resp http.ResponseWriter, req *http.Request, + tokenAccessor string) (interface{}, error) { + // Parse the token + var token structs.ACLToken + if err := decodeBody(req, &token); err != nil { + return nil, CodedError(500, err.Error()) + } + + // Ensure the token accessor matches + if tokenAccessor != "" && (token.AccessorID != tokenAccessor) { + return nil, CodedError(400, "ACL token accessor does not match request path") + } + + // Format the request + args := structs.ACLTokenUpsertRequest{ + Tokens: []*structs.ACLToken{&token}, + } + s.parseWrite(req, &args.WriteRequest) + + var out structs.ACLTokenUpsertResponse + if err := s.agent.RPC("ACL.UpsertTokens", &args, &out); err != nil { + return nil, err + } + setIndex(resp, out.Index) + if len(out.Tokens) > 0 { + return out.Tokens[0], nil + } + return nil, nil +} + +func (s *HTTPServer) aclTokenDelete(resp http.ResponseWriter, req *http.Request, + tokenAccessor string) (interface{}, error) { + + args := structs.ACLTokenDeleteRequest{ + AccessorIDs: []string{tokenAccessor}, + } + s.parseWrite(req, &args.WriteRequest) + + var out structs.GenericResponse + if err := s.agent.RPC("ACL.DeleteTokens", &args, &out); err != nil { + return nil, err + } + setIndex(resp, out.Index) + return nil, nil +} diff --git a/command/agent/acl_endpoint_test.go b/command/agent/acl_endpoint_test.go new file mode 100644 index 000000000..f87b8063d --- /dev/null +++ b/command/agent/acl_endpoint_test.go @@ -0,0 +1,401 @@ +package agent + +import ( + "net/http" + "net/http/httptest" + "testing" + + "github.com/hashicorp/nomad/nomad/mock" + "github.com/hashicorp/nomad/nomad/structs" + "github.com/stretchr/testify/assert" +) + +func TestHTTP_ACLPolicyList(t *testing.T) { + t.Parallel() + httpACLTest(t, nil, func(s *TestAgent) { + p1 := mock.ACLPolicy() + p2 := mock.ACLPolicy() + p3 := mock.ACLPolicy() + args := structs.ACLPolicyUpsertRequest{ + Policies: []*structs.ACLPolicy{p1, p2, p3}, + WriteRequest: structs.WriteRequest{ + Region: "global", + SecretID: s.Token.SecretID, + }, + } + var resp structs.GenericResponse + if err := s.Agent.RPC("ACL.UpsertPolicies", &args, &resp); err != nil { + t.Fatalf("err: %v", err) + } + + // Make the HTTP request + req, err := http.NewRequest("GET", "/v1/acl/policies", nil) + if err != nil { + t.Fatalf("err: %v", err) + } + respW := httptest.NewRecorder() + setToken(req, s.Token) + + // Make the request + obj, err := s.Server.ACLPoliciesRequest(respW, req) + if err != nil { + t.Fatalf("err: %v", err) + } + + // Check for the index + if respW.HeaderMap.Get("X-Nomad-Index") == "" { + t.Fatalf("missing index") + } + if respW.HeaderMap.Get("X-Nomad-KnownLeader") != "true" { + t.Fatalf("missing known leader") + } + if respW.HeaderMap.Get("X-Nomad-LastContact") == "" { + t.Fatalf("missing last contact") + } + + // Check the output + n := obj.([]*structs.ACLPolicyListStub) + if len(n) != 3 { + t.Fatalf("bad: %#v", n) + } + }) +} + +func TestHTTP_ACLPolicyQuery(t *testing.T) { + t.Parallel() + httpACLTest(t, nil, func(s *TestAgent) { + p1 := mock.ACLPolicy() + args := structs.ACLPolicyUpsertRequest{ + Policies: []*structs.ACLPolicy{p1}, + WriteRequest: structs.WriteRequest{ + Region: "global", + SecretID: s.Token.SecretID, + }, + } + var resp structs.GenericResponse + if err := s.Agent.RPC("ACL.UpsertPolicies", &args, &resp); err != nil { + t.Fatalf("err: %v", err) + } + + // Make the HTTP request + req, err := http.NewRequest("GET", "/v1/acl/policy/"+p1.Name, nil) + if err != nil { + t.Fatalf("err: %v", err) + } + respW := httptest.NewRecorder() + setToken(req, s.Token) + + // Make the request + obj, err := s.Server.ACLPolicySpecificRequest(respW, req) + if err != nil { + t.Fatalf("err: %v", err) + } + + // Check for the index + if respW.HeaderMap.Get("X-Nomad-Index") == "" { + t.Fatalf("missing index") + } + if respW.HeaderMap.Get("X-Nomad-KnownLeader") != "true" { + t.Fatalf("missing known leader") + } + if respW.HeaderMap.Get("X-Nomad-LastContact") == "" { + t.Fatalf("missing last contact") + } + + // Check the output + n := obj.(*structs.ACLPolicy) + if n.Name != p1.Name { + t.Fatalf("bad: %#v", n) + } + }) +} + +func TestHTTP_ACLPolicyCreate(t *testing.T) { + t.Parallel() + httpACLTest(t, nil, func(s *TestAgent) { + // Make the HTTP request + p1 := mock.ACLPolicy() + buf := encodeReq(p1) + req, err := http.NewRequest("PUT", "/v1/acl/policy/"+p1.Name, buf) + if err != nil { + t.Fatalf("err: %v", err) + } + respW := httptest.NewRecorder() + setToken(req, s.Token) + + // Make the request + obj, err := s.Server.ACLPolicySpecificRequest(respW, req) + assert.Nil(t, err) + assert.Nil(t, obj) + + // Check for the index + if respW.HeaderMap.Get("X-Nomad-Index") == "" { + t.Fatalf("missing index") + } + + // Check policy was created + state := s.Agent.server.State() + out, err := state.ACLPolicyByName(nil, p1.Name) + assert.Nil(t, err) + assert.NotNil(t, out) + + p1.CreateIndex, p1.ModifyIndex = out.CreateIndex, out.ModifyIndex + assert.Equal(t, p1.Name, out.Name) + assert.Equal(t, p1, out) + }) +} + +func TestHTTP_ACLPolicyDelete(t *testing.T) { + t.Parallel() + httpACLTest(t, nil, func(s *TestAgent) { + p1 := mock.ACLPolicy() + args := structs.ACLPolicyUpsertRequest{ + Policies: []*structs.ACLPolicy{p1}, + WriteRequest: structs.WriteRequest{ + Region: "global", + SecretID: s.Token.SecretID, + }, + } + var resp structs.GenericResponse + if err := s.Agent.RPC("ACL.UpsertPolicies", &args, &resp); err != nil { + t.Fatalf("err: %v", err) + } + + // Make the HTTP request + req, err := http.NewRequest("DELETE", "/v1/acl/policy/"+p1.Name, nil) + if err != nil { + t.Fatalf("err: %v", err) + } + respW := httptest.NewRecorder() + setToken(req, s.Token) + + // Make the request + obj, err := s.Server.ACLPolicySpecificRequest(respW, req) + assert.Nil(t, err) + assert.Nil(t, obj) + + // Check for the index + if respW.HeaderMap.Get("X-Nomad-Index") == "" { + t.Fatalf("missing index") + } + + // Check policy was created + state := s.Agent.server.State() + out, err := state.ACLPolicyByName(nil, p1.Name) + assert.Nil(t, err) + assert.Nil(t, out) + }) +} + +func TestHTTP_ACLTokenBootstrap(t *testing.T) { + t.Parallel() + conf := func(c *Config) { + c.ACL.Enabled = true + c.ACL.PolicyTTL = 0 // Special flag to disable auto-bootstrap + } + httpTest(t, conf, func(s *TestAgent) { + // Make the HTTP request + req, err := http.NewRequest("PUT", "/v1/acl/bootstrap", nil) + if err != nil { + t.Fatalf("err: %v", err) + } + respW := httptest.NewRecorder() + + // Make the request + obj, err := s.Server.ACLTokenBootstrap(respW, req) + if err != nil { + t.Fatalf("err: %v", err) + } + + // Check for the index + if respW.HeaderMap.Get("X-Nomad-Index") == "" { + t.Fatalf("missing index") + } + + // Check the output + n := obj.(*structs.ACLToken) + assert.NotNil(t, n) + assert.Equal(t, "Bootstrap Token", n.Name) + }) +} + +func TestHTTP_ACLTokenList(t *testing.T) { + t.Parallel() + httpACLTest(t, nil, func(s *TestAgent) { + p1 := mock.ACLToken() + p1.AccessorID = "" + p2 := mock.ACLToken() + p2.AccessorID = "" + p3 := mock.ACLToken() + p3.AccessorID = "" + args := structs.ACLTokenUpsertRequest{ + Tokens: []*structs.ACLToken{p1, p2, p3}, + WriteRequest: structs.WriteRequest{ + Region: "global", + SecretID: s.Token.SecretID, + }, + } + var resp structs.ACLTokenUpsertResponse + if err := s.Agent.RPC("ACL.UpsertTokens", &args, &resp); err != nil { + t.Fatalf("err: %v", err) + } + + // Make the HTTP request + req, err := http.NewRequest("GET", "/v1/acl/tokens", nil) + if err != nil { + t.Fatalf("err: %v", err) + } + respW := httptest.NewRecorder() + setToken(req, s.Token) + + // Make the request + obj, err := s.Server.ACLTokensRequest(respW, req) + if err != nil { + t.Fatalf("err: %v", err) + } + + // Check for the index + if respW.HeaderMap.Get("X-Nomad-Index") == "" { + t.Fatalf("missing index") + } + if respW.HeaderMap.Get("X-Nomad-KnownLeader") != "true" { + t.Fatalf("missing known leader") + } + if respW.HeaderMap.Get("X-Nomad-LastContact") == "" { + t.Fatalf("missing last contact") + } + + // Check the output (includes boostrap token) + n := obj.([]*structs.ACLTokenListStub) + if len(n) != 4 { + t.Fatalf("bad: %#v", n) + } + }) +} + +func TestHTTP_ACLTokenQuery(t *testing.T) { + t.Parallel() + httpACLTest(t, nil, func(s *TestAgent) { + p1 := mock.ACLToken() + p1.AccessorID = "" + args := structs.ACLTokenUpsertRequest{ + Tokens: []*structs.ACLToken{p1}, + WriteRequest: structs.WriteRequest{ + Region: "global", + SecretID: s.Token.SecretID, + }, + } + var resp structs.ACLTokenUpsertResponse + if err := s.Agent.RPC("ACL.UpsertTokens", &args, &resp); err != nil { + t.Fatalf("err: %v", err) + } + out := resp.Tokens[0] + + // Make the HTTP request + req, err := http.NewRequest("GET", "/v1/acl/token/"+out.AccessorID, nil) + if err != nil { + t.Fatalf("err: %v", err) + } + respW := httptest.NewRecorder() + setToken(req, s.Token) + + // Make the request + obj, err := s.Server.ACLTokenSpecificRequest(respW, req) + if err != nil { + t.Fatalf("err: %v", err) + } + + // Check for the index + if respW.HeaderMap.Get("X-Nomad-Index") == "" { + t.Fatalf("missing index") + } + if respW.HeaderMap.Get("X-Nomad-KnownLeader") != "true" { + t.Fatalf("missing known leader") + } + if respW.HeaderMap.Get("X-Nomad-LastContact") == "" { + t.Fatalf("missing last contact") + } + + // Check the output + n := obj.(*structs.ACLToken) + assert.Equal(t, out, n) + }) +} + +func TestHTTP_ACLTokenCreate(t *testing.T) { + t.Parallel() + httpACLTest(t, nil, func(s *TestAgent) { + // Make the HTTP request + p1 := mock.ACLToken() + p1.AccessorID = "" + buf := encodeReq(p1) + req, err := http.NewRequest("PUT", "/v1/acl/token", buf) + if err != nil { + t.Fatalf("err: %v", err) + } + respW := httptest.NewRecorder() + setToken(req, s.Token) + + // Make the request + obj, err := s.Server.ACLTokenSpecificRequest(respW, req) + assert.Nil(t, err) + assert.NotNil(t, obj) + outTK := obj.(*structs.ACLToken) + + // Check for the index + if respW.HeaderMap.Get("X-Nomad-Index") == "" { + t.Fatalf("missing index") + } + + // Check token was created + state := s.Agent.server.State() + out, err := state.ACLTokenByAccessorID(nil, outTK.AccessorID) + assert.Nil(t, err) + assert.NotNil(t, out) + assert.Equal(t, outTK, out) + }) +} + +func TestHTTP_ACLTokenDelete(t *testing.T) { + t.Parallel() + httpACLTest(t, nil, func(s *TestAgent) { + p1 := mock.ACLToken() + p1.AccessorID = "" + args := structs.ACLTokenUpsertRequest{ + Tokens: []*structs.ACLToken{p1}, + WriteRequest: structs.WriteRequest{ + Region: "global", + SecretID: s.Token.SecretID, + }, + } + var resp structs.ACLTokenUpsertResponse + if err := s.Agent.RPC("ACL.UpsertTokens", &args, &resp); err != nil { + t.Fatalf("err: %v", err) + } + ID := resp.Tokens[0].AccessorID + + // Make the HTTP request + req, err := http.NewRequest("DELETE", "/v1/acl/token/"+ID, nil) + if err != nil { + t.Fatalf("err: %v", err) + } + respW := httptest.NewRecorder() + setToken(req, s.Token) + + // Make the request + obj, err := s.Server.ACLTokenSpecificRequest(respW, req) + assert.Nil(t, err) + assert.Nil(t, obj) + + // Check for the index + if respW.HeaderMap.Get("X-Nomad-Index") == "" { + t.Fatalf("missing index") + } + + // Check token was created + state := s.Agent.server.State() + out, err := state.ACLTokenByAccessorID(nil, ID) + assert.Nil(t, err) + assert.Nil(t, out) + }) +} diff --git a/command/agent/agent.go b/command/agent/agent.go index bc238443a..5970a0c0f 100644 --- a/command/agent/agent.go +++ b/command/agent/agent.go @@ -106,6 +106,15 @@ func convertServerConfig(agentConfig *Config, logOutput io.Writer) (*nomad.Confi if agentConfig.Region != "" { conf.Region = agentConfig.Region } + + // Set the Authoritative Region if set, otherwise default to + // the same as the local region. + if agentConfig.Server.AuthoritativeRegion != "" { + conf.AuthoritativeRegion = agentConfig.Server.AuthoritativeRegion + } else if agentConfig.Region != "" { + conf.AuthoritativeRegion = agentConfig.Region + } + if agentConfig.Datacenter != "" { conf.Datacenter = agentConfig.Datacenter } @@ -134,6 +143,12 @@ func convertServerConfig(agentConfig *Config, logOutput io.Writer) (*nomad.Confi if len(agentConfig.Server.EnabledSchedulers) != 0 { conf.EnabledSchedulers = agentConfig.Server.EnabledSchedulers } + if agentConfig.ACL.Enabled { + conf.ACLEnabled = true + } + if agentConfig.ACL.ReplicationToken != "" { + conf.ReplicationToken = agentConfig.ACL.ReplicationToken + } // Set up the bind addresses rpcAddr, err := net.ResolveTCPAddr("tcp", agentConfig.normalizedAddrs.RPC) @@ -337,6 +352,11 @@ func (a *Agent) clientConfig() (*clientconfig.Config, error) { conf.NoHostUUID = true } + // Setup the ACLs + conf.ACLEnabled = a.config.ACL.Enabled + conf.ACLTokenTTL = a.config.ACL.TokenTTL + conf.ACLPolicyTTL = a.config.ACL.PolicyTTL + return conf, nil } diff --git a/command/agent/agent_test.go b/command/agent/agent_test.go index 524bdef23..53607a601 100644 --- a/command/agent/agent_test.go +++ b/command/agent/agent_test.go @@ -57,6 +57,7 @@ func TestAgent_ServerConfig(t *testing.T) { conf.AdvertiseAddrs.Serf = "127.0.0.1:4000" conf.AdvertiseAddrs.RPC = "127.0.0.1:4001" conf.AdvertiseAddrs.HTTP = "10.10.11.1:4005" + conf.ACL.Enabled = true // Parses the advertise addrs correctly if err := conf.normalizeAddrs(); err != nil { @@ -74,6 +75,12 @@ func TestAgent_ServerConfig(t *testing.T) { if serfPort != 4000 { t.Fatalf("expected 4000, got: %d", serfPort) } + if out.AuthoritativeRegion != "global" { + t.Fatalf("bad: %#v", out.AuthoritativeRegion) + } + if !out.ACLEnabled { + t.Fatalf("ACL not enabled") + } // Assert addresses weren't changed if addr := conf.AdvertiseAddrs.RPC; addr != "127.0.0.1:4001" { diff --git a/command/agent/config-test-fixtures/basic.hcl b/command/agent/config-test-fixtures/basic.hcl index 00ffdb10e..459474b3c 100644 --- a/command/agent/config-test-fixtures/basic.hcl +++ b/command/agent/config-test-fixtures/basic.hcl @@ -63,6 +63,7 @@ client { } server { enabled = true + authoritative_region = "foobar" bootstrap_expect = 5 data_dir = "/tmp/data" protocol_version = 3 @@ -82,6 +83,12 @@ server { rejoin_after_leave = true encrypt = "abc" } +acl { + enabled = true + token_ttl = "60s" + policy_ttl = "60s" + replication_token = "foobar" +} telemetry { statsite_address = "127.0.0.1:1234" statsd_address = "127.0.0.1:2345" diff --git a/command/agent/config.go b/command/agent/config.go index 024c0b74b..36052df18 100644 --- a/command/agent/config.go +++ b/command/agent/config.go @@ -67,6 +67,9 @@ type Config struct { // Server has our server related settings Server *ServerConfig `mapstructure:"server"` + // ACL has our acl related settings + ACL *ACLConfig `mapstructure:"acl"` + // Telemetry is used to configure sending telemetry Telemetry *Telemetry `mapstructure:"telemetry"` @@ -228,11 +231,38 @@ type ClientConfig struct { NoHostUUID *bool `mapstructure:"no_host_uuid"` } +// ACLConfig is configuration specific to the ACL system +type ACLConfig struct { + // Enabled controls if we are enforce and manage ACLs + Enabled bool `mapstructure:"enabled"` + + // TokenTTL controls how long we cache ACL tokens. This controls + // how stale they can be when we are enforcing policies. Defaults + // to "30s". Reducing this impacts performance by forcing more + // frequent resolution. + TokenTTL time.Duration `mapstructure:"token_ttl"` + + // PolicyTTL controls how long we cache ACL policies. This controls + // how stale they can be when we are enforcing policies. Defaults + // to "30s". Reducing this impacts performance by forcing more + // frequent resolution. + PolicyTTL time.Duration `mapstructure:"policy_ttl"` + + // ReplicationToken is used by servers to replicate tokens and policies + // from the authoritative region. This must be a valid management token + // within the authoritative region. + ReplicationToken string `mapstructure:"replication_token"` +} + // ServerConfig is configuration specific to the server mode type ServerConfig struct { // Enabled controls if we are a server Enabled bool `mapstructure:"enabled"` + // AuthoritativeRegion is used to control which region is treated as + // the source of truth for global tokens and ACL policies. + AuthoritativeRegion string `mapstructure:"authoritative_region"` + // BootstrapExpect tries to automatically bootstrap the Consul cluster, // by withholding peers until enough servers join. BootstrapExpect int `mapstructure:"bootstrap_expect"` @@ -565,6 +595,11 @@ func DefaultConfig() *Config { RetryInterval: "30s", RetryMaxAttempts: 0, }, + ACL: &ACLConfig{ + Enabled: false, + TokenTTL: 30 * time.Second, + PolicyTTL: 30 * time.Second, + }, SyslogFacility: "LOCAL0", Telemetry: &Telemetry{ CollectionInterval: "1s", @@ -676,6 +711,14 @@ func (c *Config) Merge(b *Config) *Config { result.Server = result.Server.Merge(b.Server) } + // Apply the acl config + if result.ACL == nil && b.ACL != nil { + server := *b.ACL + result.ACL = &server + } else if b.ACL != nil { + result.ACL = result.ACL.Merge(b.ACL) + } + // Apply the ports config if result.Ports == nil && b.Ports != nil { ports := *b.Ports @@ -902,6 +945,25 @@ func isTooManyColons(err error) bool { return err != nil && strings.Contains(err.Error(), tooManyColons) } +// Merge is used to merge two ACL configs together. The settings from the input always take precedence. +func (a *ACLConfig) Merge(b *ACLConfig) *ACLConfig { + result := *a + + if b.Enabled { + result.Enabled = true + } + if b.TokenTTL != 0 { + result.TokenTTL = b.TokenTTL + } + if b.PolicyTTL != 0 { + result.PolicyTTL = b.PolicyTTL + } + if b.ReplicationToken != "" { + result.ReplicationToken = b.ReplicationToken + } + return &result +} + // Merge is used to merge two server configs together func (a *ServerConfig) Merge(b *ServerConfig) *ServerConfig { result := *a @@ -909,6 +971,9 @@ func (a *ServerConfig) Merge(b *ServerConfig) *ServerConfig { if b.Enabled { result.Enabled = true } + if b.AuthoritativeRegion != "" { + result.AuthoritativeRegion = b.AuthoritativeRegion + } if b.BootstrapExpect > 0 { result.BootstrapExpect = b.BootstrapExpect } diff --git a/command/agent/config_parse.go b/command/agent/config_parse.go index de1401cb5..2894f7901 100644 --- a/command/agent/config_parse.go +++ b/command/agent/config_parse.go @@ -96,6 +96,7 @@ func parseConfig(result *Config, list *ast.ObjectList) error { "vault", "tls", "http_api_response_headers", + "acl", } if err := checkHCLKeys(list, valid); err != nil { return multierror.Prefix(err, "config:") @@ -118,6 +119,7 @@ func parseConfig(result *Config, list *ast.ObjectList) error { delete(m, "vault") delete(m, "tls") delete(m, "http_api_response_headers") + delete(m, "acl") // Decode the rest if err := mapstructure.WeakDecode(m, result); err != nil { @@ -159,6 +161,13 @@ func parseConfig(result *Config, list *ast.ObjectList) error { } } + // Parse ACL config + if o := list.Filter("acl"); len(o.Items) > 0 { + if err := parseACL(&result.ACL, o); err != nil { + return multierror.Prefix(err, "acl ->") + } + } + // Parse telemetry config if o := list.Filter("telemetry"); len(o.Items) > 0 { if err := parseTelemetry(&result.Telemetry, o); err != nil { @@ -514,6 +523,7 @@ func parseServer(result **ServerConfig, list *ast.ObjectList) error { "retry_interval", "rejoin_after_leave", "encrypt", + "authoritative_region", } if err := checkHCLKeys(listVal, valid); err != nil { return err @@ -541,6 +551,56 @@ func parseServer(result **ServerConfig, list *ast.ObjectList) error { return nil } +func parseACL(result **ACLConfig, list *ast.ObjectList) error { + list = list.Elem() + if len(list.Items) > 1 { + return fmt.Errorf("only one 'acl' block allowed") + } + + // Get our server object + obj := list.Items[0] + + // Value should be an object + var listVal *ast.ObjectList + if ot, ok := obj.Val.(*ast.ObjectType); ok { + listVal = ot.List + } else { + return fmt.Errorf("acl value: should be an object") + } + + // Check for invalid keys + valid := []string{ + "enabled", + "token_ttl", + "policy_ttl", + "replication_token", + } + if err := checkHCLKeys(listVal, valid); err != nil { + return err + } + + var m map[string]interface{} + if err := hcl.DecodeObject(&m, listVal); err != nil { + return err + } + + var config ACLConfig + dec, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ + DecodeHook: mapstructure.StringToTimeDurationHookFunc(), + WeaklyTypedInput: true, + Result: &config, + }) + if err != nil { + return err + } + if err := dec.Decode(m); err != nil { + return err + } + + *result = &config + return nil +} + func parseTelemetry(result **Telemetry, list *ast.ObjectList) error { list = list.Elem() if len(list.Items) > 1 { diff --git a/command/agent/config_parse_test.go b/command/agent/config_parse_test.go index a677f62c7..e088926a2 100644 --- a/command/agent/config_parse_test.go +++ b/command/agent/config_parse_test.go @@ -84,6 +84,7 @@ func TestConfig_Parse(t *testing.T) { }, Server: &ServerConfig{ Enabled: true, + AuthoritativeRegion: "foobar", BootstrapExpect: 5, DataDir: "/tmp/data", ProtocolVersion: 3, @@ -103,6 +104,12 @@ func TestConfig_Parse(t *testing.T) { RetryMaxAttempts: 3, EncryptKey: "abc", }, + ACL: &ACLConfig{ + Enabled: true, + TokenTTL: 60 * time.Second, + PolicyTTL: 60 * time.Second, + ReplicationToken: "foobar", + }, Telemetry: &Telemetry{ StatsiteAddr: "127.0.0.1:1234", StatsdAddr: "127.0.0.1:2345", diff --git a/command/agent/config_test.go b/command/agent/config_test.go index cdfa36baa..2e8d20710 100644 --- a/command/agent/config_test.go +++ b/command/agent/config_test.go @@ -27,6 +27,7 @@ func TestConfig_Merge(t *testing.T) { Telemetry: &Telemetry{}, Client: &ClientConfig{}, Server: &ServerConfig{}, + ACL: &ACLConfig{}, Ports: &Ports{}, Addresses: &Addresses{}, AdvertiseAddrs: &AdvertiseAddrs{}, @@ -91,6 +92,7 @@ func TestConfig_Merge(t *testing.T) { }, Server: &ServerConfig{ Enabled: false, + AuthoritativeRegion: "global", BootstrapExpect: 1, DataDir: "/tmp/data1", ProtocolVersion: 1, @@ -100,6 +102,12 @@ func TestConfig_Merge(t *testing.T) { MinHeartbeatTTL: 30 * time.Second, MaxHeartbeatsPerSecond: 30.0, }, + ACL: &ACLConfig{ + Enabled: true, + TokenTTL: 60 * time.Second, + PolicyTTL: 60 * time.Second, + ReplicationToken: "foo", + }, Ports: &Ports{ HTTP: 4646, RPC: 4647, @@ -223,6 +231,7 @@ func TestConfig_Merge(t *testing.T) { }, Server: &ServerConfig{ Enabled: true, + AuthoritativeRegion: "global2", BootstrapExpect: 2, DataDir: "/tmp/data2", ProtocolVersion: 2, @@ -238,6 +247,12 @@ func TestConfig_Merge(t *testing.T) { RetryInterval: "10s", retryInterval: time.Second * 10, }, + ACL: &ACLConfig{ + Enabled: true, + TokenTTL: 20 * time.Second, + PolicyTTL: 20 * time.Second, + ReplicationToken: "foobar", + }, Ports: &Ports{ HTTP: 20000, RPC: 21000, diff --git a/command/agent/http.go b/command/agent/http.go index ebee73c30..67afb8ea0 100644 --- a/command/agent/http.go +++ b/command/agent/http.go @@ -148,6 +148,14 @@ func (s *HTTPServer) registerHandlers(enableDebug bool) { s.mux.HandleFunc("/v1/deployments", s.wrap(s.DeploymentsRequest)) s.mux.HandleFunc("/v1/deployment/", s.wrap(s.DeploymentSpecificRequest)) + s.mux.HandleFunc("/v1/acl/policies", s.wrap(s.ACLPoliciesRequest)) + s.mux.HandleFunc("/v1/acl/policy/", s.wrap(s.ACLPolicySpecificRequest)) + + s.mux.HandleFunc("/v1/acl/bootstrap", s.wrap(s.ACLTokenBootstrap)) + s.mux.HandleFunc("/v1/acl/tokens", s.wrap(s.ACLTokensRequest)) + s.mux.HandleFunc("/v1/acl/token", s.wrap(s.ACLTokenSpecificRequest)) + s.mux.HandleFunc("/v1/acl/token/", s.wrap(s.ACLTokenSpecificRequest)) + s.mux.HandleFunc("/v1/client/fs/", s.wrap(s.FsRequest)) s.mux.HandleFunc("/v1/client/stats", s.wrap(s.ClientStatsRequest)) s.mux.HandleFunc("/v1/client/allocation/", s.wrap(s.ClientAllocRequest)) @@ -351,9 +359,24 @@ func (s *HTTPServer) parseRegion(req *http.Request, r *string) { } } +// parseToken is used to parse the X-Nomad-Token param +func (s *HTTPServer) parseToken(req *http.Request, token *string) { + if other := req.Header.Get("X-Nomad-Token"); other != "" { + *token = other + return + } +} + +// parseWrite is a convenience method for endpoints that call write methods +func (s *HTTPServer) parseWrite(req *http.Request, b *structs.WriteRequest) { + s.parseRegion(req, &b.Region) + s.parseToken(req, &b.SecretID) +} + // parse is a convenience method for endpoints that need to parse multiple flags func (s *HTTPServer) parse(resp http.ResponseWriter, req *http.Request, r *string, b *structs.QueryOptions) bool { s.parseRegion(req, r) + s.parseToken(req, &b.SecretID) parseConsistency(req, b) parsePrefix(req, b) return parseWait(resp, req, b) diff --git a/command/agent/http_test.go b/command/agent/http_test.go index dd4e69c1e..1547d51bb 100644 --- a/command/agent/http_test.go +++ b/command/agent/http_test.go @@ -338,6 +338,24 @@ func TestParseRegion(t *testing.T) { } } +func TestParseToken(t *testing.T) { + t.Parallel() + s := makeHTTPServer(t, nil) + defer s.Shutdown() + + req, err := http.NewRequest("GET", "/v1/jobs", nil) + req.Header.Add("X-Nomad-Token", "foobar") + if err != nil { + t.Fatalf("err: %v", err) + } + + var token string + s.Server.parseToken(req, &token) + if token != "foobar" { + t.Fatalf("bad %s", token) + } +} + // TestHTTP_VerifyHTTPSClient asserts that a client certificate signed by the // appropriate CA is required when VerifyHTTPSClient=true. func TestHTTP_VerifyHTTPSClient(t *testing.T) { @@ -496,6 +514,22 @@ func httpTest(t testing.TB, cb func(c *Config), f func(srv *TestAgent)) { f(s) } +func httpACLTest(t testing.TB, cb func(c *Config), f func(srv *TestAgent)) { + s := makeHTTPServer(t, func(c *Config) { + c.ACL.Enabled = true + if cb != nil { + cb(c) + } + }) + defer s.Shutdown() + testutil.WaitForLeader(t, s.Agent.RPC) + f(s) +} + +func setToken(req *http.Request, token *structs.ACLToken) { + req.Header.Set("X-Nomad-Token", token.SecretID) +} + func encodeReq(obj interface{}) io.ReadCloser { buf := bytes.NewBuffer(nil) enc := json.NewEncoder(buf) diff --git a/command/agent/job_endpoint.go b/command/agent/job_endpoint.go index 75a67ae36..87a066f6a 100644 --- a/command/agent/job_endpoint.go +++ b/command/agent/job_endpoint.go @@ -349,6 +349,7 @@ func (s *HTTPServer) jobUpdate(resp http.ResponseWriter, req *http.Request, return nil, CodedError(400, "Job ID does not match name") } s.parseRegion(req, &args.Region) + s.parseToken(req, &args.SecretID) sJob := ApiJobToStructJob(args.Job) @@ -357,7 +358,8 @@ func (s *HTTPServer) jobUpdate(resp http.ResponseWriter, req *http.Request, EnforceIndex: args.EnforceIndex, JobModifyIndex: args.JobModifyIndex, WriteRequest: structs.WriteRequest{ - Region: args.WriteRequest.Region, + Region: args.WriteRequest.Region, + SecretID: args.WriteRequest.SecretID, }, } var out structs.JobRegisterResponse diff --git a/command/agent/job_endpoint_test.go b/command/agent/job_endpoint_test.go index 7e0857216..f60cc78eb 100644 --- a/command/agent/job_endpoint_test.go +++ b/command/agent/job_endpoint_test.go @@ -171,6 +171,37 @@ func TestHTTP_JobsRegister(t *testing.T) { }) } +// Test that ACL token is properly threaded through to the RPC endpoint +func TestHTTP_JobsRegister_ACL(t *testing.T) { + t.Parallel() + httpACLTest(t, nil, func(s *TestAgent) { + // Create the job + job := api.MockJob() + args := api.JobRegisterRequest{ + Job: job, + WriteRequest: api.WriteRequest{ + Region: "global", + }, + } + buf := encodeReq(args) + + // Make the HTTP request + req, err := http.NewRequest("PUT", "/v1/jobs", buf) + if err != nil { + t.Fatalf("err: %v", err) + } + respW := httptest.NewRecorder() + setToken(req, s.Token) + + // Make the request + obj, err := s.Server.JobsRequest(respW, req) + if err != nil { + t.Fatalf("err: %v", err) + } + assert.NotNil(t, obj) + }) +} + func TestHTTP_JobsRegister_Defaulting(t *testing.T) { t.Parallel() httpTest(t, nil, func(s *TestAgent) { diff --git a/command/agent/testagent.go b/command/agent/testagent.go index 0cb04bc70..2396a4cf4 100644 --- a/command/agent/testagent.go +++ b/command/agent/testagent.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/nomad/api" "github.com/hashicorp/nomad/client/fingerprint" "github.com/hashicorp/nomad/nomad" + "github.com/hashicorp/nomad/nomad/mock" "github.com/hashicorp/nomad/nomad/structs" sconfig "github.com/hashicorp/nomad/nomad/structs/config" "github.com/hashicorp/nomad/testutil" @@ -66,6 +67,9 @@ type TestAgent struct { // Agent is the embedded Nomad agent. // It is valid after Start(). *Agent + + // Token is auto-bootstrapped if ACLs are enabled + Token *structs.ACLToken } // NewTestAgent returns a started agent with the given name and @@ -164,6 +168,17 @@ func (a *TestAgent) Start() *TestAgent { panic(fmt.Sprintf("failed OK response: %v", err)) }) } + + // Check if ACLs enabled. Use special value of PolicyTTL 0s + // to do a bypass of this step. This is so we can test bootstrap + // without having to pass down a special flag. + if a.Config.ACL.Enabled && a.Config.Server.Enabled && a.Config.ACL.PolicyTTL != 0 { + a.Token = mock.ACLManagementToken() + state := a.Agent.server.State() + if err := state.BootstrapACLTokens(1, a.Token); err != nil { + panic(fmt.Sprintf("token bootstrap failed: %v", err)) + } + } return a } diff --git a/nomad/acl.go b/nomad/acl.go new file mode 100644 index 000000000..93fd6fb64 --- /dev/null +++ b/nomad/acl.go @@ -0,0 +1,80 @@ +package nomad + +import ( + "time" + + metrics "github.com/armon/go-metrics" + lru "github.com/hashicorp/golang-lru" + "github.com/hashicorp/nomad/acl" + "github.com/hashicorp/nomad/nomad/state" + "github.com/hashicorp/nomad/nomad/structs" +) + +// resolveToken is used to translate an ACL Token Secret ID into +// an ACL object, nil if ACLs are disabled, or an error. +func (s *Server) resolveToken(secretID string) (*acl.ACL, error) { + // Fast-path if ACLs are disabled + if !s.config.ACLEnabled { + return nil, nil + } + defer metrics.MeasureSince([]string{"nomad", "acl", "resolveToken"}, time.Now()) + + // Snapshot the state + snap, err := s.fsm.State().Snapshot() + if err != nil { + return nil, err + } + + // Resolve the ACL + return resolveTokenFromSnapshotCache(snap, s.aclCache, secretID) +} + +// resolveTokenFromSnapshotCache is used to resolve an ACL object from a snapshot of state, +// using a cache to avoid parsing and ACL construction when possible. It is split from resolveToken +// to simplify testing. +func resolveTokenFromSnapshotCache(snap *state.StateSnapshot, cache *lru.TwoQueueCache, secretID string) (*acl.ACL, error) { + // Lookup the ACL Token + var token *structs.ACLToken + var err error + + // Handle anonymous requests + if secretID == "" { + token = structs.AnonymousACLToken + } else { + token, err = snap.ACLTokenBySecretID(nil, secretID) + if err != nil { + return nil, err + } + if token == nil { + return nil, structs.ErrTokenNotFound + } + } + + // Check if this is a management token + if token.Type == structs.ACLManagementToken { + return acl.ManagementACL, nil + } + + // Get all associated policies + policies := make([]*structs.ACLPolicy, 0, len(token.Policies)) + for _, policyName := range token.Policies { + policy, err := snap.ACLPolicyByName(nil, policyName) + if err != nil { + return nil, err + } + if policy == nil { + // Ignore policies that don't exist, since they don't grant any more privilege + continue + } + + // Save the policy and update the cache key + policies = append(policies, policy) + } + + // Compile and cache the ACL object + aclObj, err := structs.CompileACLObject(cache, policies) + if err != nil { + return nil, err + } + return aclObj, nil +} diff --git a/nomad/acl_endpoint.go b/nomad/acl_endpoint.go new file mode 100644 index 000000000..c673d2235 --- /dev/null +++ b/nomad/acl_endpoint.go @@ -0,0 +1,698 @@ +package nomad + +import ( + "fmt" + "time" + + metrics "github.com/armon/go-metrics" + memdb "github.com/hashicorp/go-memdb" + "github.com/hashicorp/nomad/nomad/state" + "github.com/hashicorp/nomad/nomad/structs" +) + +var ( + // aclDisabled is returned when an ACL endpoint is hit but ACLs are not enabled + aclDisabled = fmt.Errorf("ACL support disabled") +) + +// ACL endpoint is used for manipulating ACL tokens and policies +type ACL struct { + srv *Server +} + +// UpsertPolicies is used to create or update a set of policies +func (a *ACL) UpsertPolicies(args *structs.ACLPolicyUpsertRequest, reply *structs.GenericResponse) error { + // Ensure ACLs are enabled, and always flow modification requests to the authoritative region + if !a.srv.config.ACLEnabled { + return aclDisabled + } + args.Region = a.srv.config.AuthoritativeRegion + + if done, err := a.srv.forward("ACL.UpsertPolicies", args, args, reply); done { + return err + } + defer metrics.MeasureSince([]string{"nomad", "acl", "upsert_policies"}, time.Now()) + + // Check management level permissions + if acl, err := a.srv.resolveToken(args.SecretID); err != nil { + return err + } else if acl == nil || !acl.IsManagement() { + return structs.ErrPermissionDenied + } + + // Validate non-zero set of policies + if len(args.Policies) == 0 { + return fmt.Errorf("must specify as least one policy") + } + + // Validate each policy, compute hash + for idx, policy := range args.Policies { + if err := policy.Validate(); err != nil { + return fmt.Errorf("policy %d invalid: %v", idx, err) + } + policy.SetHash() + } + + // Update via Raft + _, index, err := a.srv.raftApply(structs.ACLPolicyUpsertRequestType, args) + if err != nil { + return err + } + + // Update the index + reply.Index = index + return nil +} + +// DeletePolicies is used to delete policies +func (a *ACL) DeletePolicies(args *structs.ACLPolicyDeleteRequest, reply *structs.GenericResponse) error { + // Ensure ACLs are enabled, and always flow modification requests to the authoritative region + if !a.srv.config.ACLEnabled { + return aclDisabled + } + args.Region = a.srv.config.AuthoritativeRegion + + if done, err := a.srv.forward("ACL.DeletePolicies", args, args, reply); done { + return err + } + defer metrics.MeasureSince([]string{"nomad", "acl", "delete_policies"}, time.Now()) + + // Check management level permissions + if acl, err := a.srv.resolveToken(args.SecretID); err != nil { + return err + } else if acl == nil || !acl.IsManagement() { + return structs.ErrPermissionDenied + } + + // Validate non-zero set of policies + if len(args.Names) == 0 { + return fmt.Errorf("must specify as least one policy") + } + + // Update via Raft + _, index, err := a.srv.raftApply(structs.ACLPolicyDeleteRequestType, args) + if err != nil { + return err + } + + // Update the index + reply.Index = index + return nil +} + +// ListPolicies is used to list the policies +func (a *ACL) ListPolicies(args *structs.ACLPolicyListRequest, reply *structs.ACLPolicyListResponse) error { + if !a.srv.config.ACLEnabled { + return aclDisabled + } + if done, err := a.srv.forward("ACL.ListPolicies", args, args, reply); done { + return err + } + defer metrics.MeasureSince([]string{"nomad", "acl", "list_policies"}, time.Now()) + + // Check management level permissions + if acl, err := a.srv.resolveToken(args.SecretID); err != nil { + return err + } else if acl == nil || !acl.IsManagement() { + return structs.ErrPermissionDenied + } + + // Setup the blocking query + opts := blockingOptions{ + queryOpts: &args.QueryOptions, + queryMeta: &reply.QueryMeta, + run: func(ws memdb.WatchSet, state *state.StateStore) error { + // Iterate over all the policies + var err error + var iter memdb.ResultIterator + if prefix := args.QueryOptions.Prefix; prefix != "" { + iter, err = state.ACLPolicyByNamePrefix(ws, prefix) + } else { + iter, err = state.ACLPolicies(ws) + } + if err != nil { + return err + } + + // Convert all the policies to a list stub + reply.Policies = nil + for { + raw := iter.Next() + if raw == nil { + break + } + policy := raw.(*structs.ACLPolicy) + reply.Policies = append(reply.Policies, policy.Stub()) + } + + // Use the last index that affected the policy table + index, err := state.Index("acl_policy") + if err != nil { + return err + } + + // Ensure we never set the index to zero, otherwise a blocking query cannot be used. + // We floor the index at one, since realistically the first write must have a higher index. + if index == 0 { + index = 1 + } + reply.Index = index + return nil + }} + return a.srv.blockingRPC(&opts) +} + +// GetPolicy is used to get a specific policy +func (a *ACL) GetPolicy(args *structs.ACLPolicySpecificRequest, reply *structs.SingleACLPolicyResponse) error { + if !a.srv.config.ACLEnabled { + return aclDisabled + } + if done, err := a.srv.forward("ACL.GetPolicy", args, args, reply); done { + return err + } + defer metrics.MeasureSince([]string{"nomad", "acl", "get_policy"}, time.Now()) + + // Check management level permissions + if acl, err := a.srv.resolveToken(args.SecretID); err != nil { + return err + } else if acl == nil || !acl.IsManagement() { + return structs.ErrPermissionDenied + } + + // Setup the blocking query + opts := blockingOptions{ + queryOpts: &args.QueryOptions, + queryMeta: &reply.QueryMeta, + run: func(ws memdb.WatchSet, state *state.StateStore) error { + // Look for the policy + out, err := state.ACLPolicyByName(ws, args.Name) + if err != nil { + return err + } + + // Setup the output + reply.Policy = out + if out != nil { + reply.Index = out.ModifyIndex + } else { + // Use the last index that affected the policy table + index, err := state.Index("acl_policy") + if err != nil { + return err + } + reply.Index = index + } + return nil + }} + return a.srv.blockingRPC(&opts) +} + +// GetPolicies is used to get a set of policies +func (a *ACL) GetPolicies(args *structs.ACLPolicySetRequest, reply *structs.ACLPolicySetResponse) error { + if !a.srv.config.ACLEnabled { + return aclDisabled + } + if done, err := a.srv.forward("ACL.GetPolicies", args, args, reply); done { + return err + } + defer metrics.MeasureSince([]string{"nomad", "acl", "get_policies"}, time.Now()) + + // For client typed tokens, allow them to query any policies associated with that token. + // This is used by clients which are resolving the policies to enforce. Any associated + // policies need to be fetched so that the client can determine what to allow. + token, err := a.srv.State().ACLTokenBySecretID(nil, args.SecretID) + if err != nil { + return err + } + if token == nil { + return structs.ErrTokenNotFound + } + if token.Type != structs.ACLManagementToken && !token.PolicySubset(args.Names) { + return structs.ErrPermissionDenied + } + + // Setup the blocking query + opts := blockingOptions{ + queryOpts: &args.QueryOptions, + queryMeta: &reply.QueryMeta, + run: func(ws memdb.WatchSet, state *state.StateStore) error { + // Setup the output + reply.Policies = make(map[string]*structs.ACLPolicy, len(args.Names)) + + // Look for the policy + for _, policyName := range args.Names { + out, err := state.ACLPolicyByName(ws, policyName) + if err != nil { + return err + } + if out != nil { + reply.Policies[policyName] = out + } + } + + // Use the last index that affected the policy table + index, err := state.Index("acl_policy") + if err != nil { + return err + } + reply.Index = index + return nil + }} + return a.srv.blockingRPC(&opts) +} + +// Bootstrap is used to bootstrap the initial token +func (a *ACL) Bootstrap(args *structs.ACLTokenBootstrapRequest, reply *structs.ACLTokenUpsertResponse) error { + // Ensure ACLs are enabled, and always flow modification requests to the authoritative region + if !a.srv.config.ACLEnabled { + return aclDisabled + } + args.Region = a.srv.config.AuthoritativeRegion + + if done, err := a.srv.forward("ACL.Bootstrap", args, args, reply); done { + return err + } + defer metrics.MeasureSince([]string{"nomad", "acl", "bootstrap"}, time.Now()) + + // Snapshot the state + state, err := a.srv.State().Snapshot() + if err != nil { + return err + } + + // Verify bootstrap is possible. The state store method re-verifies this, + // but we do an early check to avoid raft transactions when possible. + ok, err := state.CanBootstrapACLToken() + if err != nil { + return err + } + if !ok { + return fmt.Errorf("ACL bootstrap already done") + } + + // Create a new global management token, override any parameter + args.Token = &structs.ACLToken{ + AccessorID: structs.GenerateUUID(), + SecretID: structs.GenerateUUID(), + Name: "Bootstrap Token", + Type: structs.ACLManagementToken, + Global: true, + CreateTime: time.Now().UTC(), + } + args.Token.SetHash() + + // Update via Raft + _, index, err := a.srv.raftApply(structs.ACLTokenBootstrapRequestType, args) + if err != nil { + return err + } + + // Populate the response. We do a lookup against the state to + // pickup the proper create / modify times. + state, err = a.srv.State().Snapshot() + if err != nil { + return err + } + out, err := state.ACLTokenByAccessorID(nil, args.Token.AccessorID) + if err != nil { + return fmt.Errorf("token lookup failed: %v", err) + } + reply.Tokens = append(reply.Tokens, out) + + // Update the index + reply.Index = index + return nil +} + +// UpsertTokens is used to create or update a set of tokens +func (a *ACL) UpsertTokens(args *structs.ACLTokenUpsertRequest, reply *structs.ACLTokenUpsertResponse) error { + // Ensure ACLs are enabled, and always flow modification requests to the authoritative region + if !a.srv.config.ACLEnabled { + return aclDisabled + } + + // Validate non-zero set of tokens + if len(args.Tokens) == 0 { + return fmt.Errorf("must specify as least one token") + } + + // Force the request to the authoritative region if we are creating global tokens + hasGlobal := false + allGlobal := true + for _, token := range args.Tokens { + if token.Global { + hasGlobal = true + } else { + allGlobal = false + } + } + + // Disallow mixed requests with global and non-global tokens since we forward + // the entire request as a single batch. + if hasGlobal { + if !allGlobal { + return fmt.Errorf("cannot upsert mixed global and non-global tokens") + } + + // Force the request to the authoritative region if it has global + args.Region = a.srv.config.AuthoritativeRegion + } + + if done, err := a.srv.forward("ACL.UpsertTokens", args, args, reply); done { + return err + } + defer metrics.MeasureSince([]string{"nomad", "acl", "upsert_tokens"}, time.Now()) + + // Check management level permissions + if acl, err := a.srv.resolveToken(args.SecretID); err != nil { + return err + } else if acl == nil || !acl.IsManagement() { + return structs.ErrPermissionDenied + } + + // Snapshot the state + state, err := a.srv.State().Snapshot() + if err != nil { + return err + } + + // Validate each token + for idx, token := range args.Tokens { + if err := token.Validate(); err != nil { + return fmt.Errorf("token %d invalid: %v", idx, err) + } + + // Generate an accessor and secret ID if new + if token.AccessorID == "" { + token.AccessorID = structs.GenerateUUID() + token.SecretID = structs.GenerateUUID() + token.CreateTime = time.Now().UTC() + + } else { + // Verify the token exists + out, err := state.ACLTokenByAccessorID(nil, token.AccessorID) + if err != nil { + return fmt.Errorf("token lookup failed: %v", err) + } + if out == nil { + return fmt.Errorf("cannot find token %s", token.AccessorID) + } + + // Cannot toggle the "Global" mode + if token.Global != out.Global { + return fmt.Errorf("cannot toggle global mode of %s", token.AccessorID) + } + } + + // Compute the token hash + token.SetHash() + } + + // Update via Raft + _, index, err := a.srv.raftApply(structs.ACLTokenUpsertRequestType, args) + if err != nil { + return err + } + + // Populate the response. We do a lookup against the state to + // pickup the proper create / modify times. + state, err = a.srv.State().Snapshot() + if err != nil { + return err + } + for _, token := range args.Tokens { + out, err := state.ACLTokenByAccessorID(nil, token.AccessorID) + if err != nil { + return fmt.Errorf("token lookup failed: %v", err) + } + reply.Tokens = append(reply.Tokens, out) + } + + // Update the index + reply.Index = index + return nil +} + +// DeleteTokens is used to delete tokens +func (a *ACL) DeleteTokens(args *structs.ACLTokenDeleteRequest, reply *structs.GenericResponse) error { + // Ensure ACLs are enabled, and always flow modification requests to the authoritative region + if !a.srv.config.ACLEnabled { + return aclDisabled + } + + // Validate non-zero set of tokens + if len(args.AccessorIDs) == 0 { + return fmt.Errorf("must specify as least one token") + } + + if done, err := a.srv.forward("ACL.DeleteTokens", args, args, reply); done { + return err + } + defer metrics.MeasureSince([]string{"nomad", "acl", "delete_tokens"}, time.Now()) + + // Check management level permissions + if acl, err := a.srv.resolveToken(args.SecretID); err != nil { + return err + } else if acl == nil || !acl.IsManagement() { + return structs.ErrPermissionDenied + } + + // Snapshot the state + state, err := a.srv.State().Snapshot() + if err != nil { + return err + } + + // Determine if we are deleting local or global tokens + hasGlobal := false + allGlobal := true + for _, accessor := range args.AccessorIDs { + token, err := state.ACLTokenByAccessorID(nil, accessor) + if err != nil { + return fmt.Errorf("token lookup failed: %v", err) + } + if token == nil { + continue + } + if token.Global { + hasGlobal = true + } else { + allGlobal = false + } + } + + // Disallow mixed requests with global and non-global tokens since we forward + // the entire request as a single batch. + if hasGlobal { + if !allGlobal { + return fmt.Errorf("cannot delete mixed global and non-global tokens") + } + + // Force the request to the authoritative region if it has global + if a.srv.config.Region != a.srv.config.AuthoritativeRegion { + args.Region = a.srv.config.AuthoritativeRegion + _, err := a.srv.forward("ACL.DeleteTokens", args, args, reply) + return err + } + } + + // Update via Raft + _, index, err := a.srv.raftApply(structs.ACLTokenDeleteRequestType, args) + if err != nil { + return err + } + + // Update the index + reply.Index = index + return nil +} + +// ListTokens is used to list the tokens +func (a *ACL) ListTokens(args *structs.ACLTokenListRequest, reply *structs.ACLTokenListResponse) error { + if !a.srv.config.ACLEnabled { + return aclDisabled + } + if done, err := a.srv.forward("ACL.ListTokens", args, args, reply); done { + return err + } + defer metrics.MeasureSince([]string{"nomad", "acl", "list_tokens"}, time.Now()) + + // Check management level permissions + if acl, err := a.srv.resolveToken(args.SecretID); err != nil { + return err + } else if acl == nil || !acl.IsManagement() { + return structs.ErrPermissionDenied + } + + // Setup the blocking query + opts := blockingOptions{ + queryOpts: &args.QueryOptions, + queryMeta: &reply.QueryMeta, + run: func(ws memdb.WatchSet, state *state.StateStore) error { + // Iterate over all the tokens + var err error + var iter memdb.ResultIterator + if prefix := args.QueryOptions.Prefix; prefix != "" { + iter, err = state.ACLTokenByAccessorIDPrefix(ws, prefix) + } else if args.GlobalOnly { + iter, err = state.ACLTokensByGlobal(ws, true) + } else { + iter, err = state.ACLTokens(ws) + } + if err != nil { + return err + } + + // Convert all the tokens to a list stub + reply.Tokens = nil + for { + raw := iter.Next() + if raw == nil { + break + } + token := raw.(*structs.ACLToken) + reply.Tokens = append(reply.Tokens, token.Stub()) + } + + // Use the last index that affected the token table + index, err := state.Index("acl_token") + if err != nil { + return err + } + reply.Index = index + return nil + }} + return a.srv.blockingRPC(&opts) +} + +// GetToken is used to get a specific token +func (a *ACL) GetToken(args *structs.ACLTokenSpecificRequest, reply *structs.SingleACLTokenResponse) error { + if !a.srv.config.ACLEnabled { + return aclDisabled + } + if done, err := a.srv.forward("ACL.GetToken", args, args, reply); done { + return err + } + defer metrics.MeasureSince([]string{"nomad", "acl", "get_token"}, time.Now()) + + // Check management level permissions + if acl, err := a.srv.resolveToken(args.SecretID); err != nil { + return err + } else if acl == nil || !acl.IsManagement() { + return structs.ErrPermissionDenied + } + + // Setup the blocking query + opts := blockingOptions{ + queryOpts: &args.QueryOptions, + queryMeta: &reply.QueryMeta, + run: func(ws memdb.WatchSet, state *state.StateStore) error { + // Look for the token + out, err := state.ACLTokenByAccessorID(ws, args.AccessorID) + if err != nil { + return err + } + + // Setup the output + reply.Token = out + if out != nil { + reply.Index = out.ModifyIndex + } else { + // Use the last index that affected the token table + index, err := state.Index("acl_token") + if err != nil { + return err + } + reply.Index = index + } + return nil + }} + return a.srv.blockingRPC(&opts) +} + +// GetTokens is used to get a set of token +func (a *ACL) GetTokens(args *structs.ACLTokenSetRequest, reply *structs.ACLTokenSetResponse) error { + if !a.srv.config.ACLEnabled { + return aclDisabled + } + if done, err := a.srv.forward("ACL.GetTokens", args, args, reply); done { + return err + } + defer metrics.MeasureSince([]string{"nomad", "acl", "get_tokens"}, time.Now()) + + // Check management level permissions + if acl, err := a.srv.resolveToken(args.SecretID); err != nil { + return err + } else if acl == nil || !acl.IsManagement() { + return structs.ErrPermissionDenied + } + + // Setup the blocking query + opts := blockingOptions{ + queryOpts: &args.QueryOptions, + queryMeta: &reply.QueryMeta, + run: func(ws memdb.WatchSet, state *state.StateStore) error { + // Setup the output + reply.Tokens = make(map[string]*structs.ACLToken, len(args.AccessorIDS)) + + // Look for the token + for _, accessor := range args.AccessorIDS { + out, err := state.ACLTokenByAccessorID(ws, accessor) + if err != nil { + return err + } + if out != nil { + reply.Tokens[out.AccessorID] = out + } + } + + // Use the last index that affected the token table + index, err := state.Index("acl_token") + if err != nil { + return err + } + reply.Index = index + return nil + }} + return a.srv.blockingRPC(&opts) +} + +// ResolveToken is used to lookup a specific token by a secret ID. This is used for enforcing ACLs by clients. +func (a *ACL) ResolveToken(args *structs.ResolveACLTokenRequest, reply *structs.ResolveACLTokenResponse) error { + if !a.srv.config.ACLEnabled { + return aclDisabled + } + if done, err := a.srv.forward("ACL.ResolveToken", args, args, reply); done { + return err + } + defer metrics.MeasureSince([]string{"nomad", "acl", "resolve_token"}, time.Now()) + + // Setup the query meta + a.srv.setQueryMeta(&reply.QueryMeta) + + // Snapshot the state + state, err := a.srv.State().Snapshot() + if err != nil { + return err + } + + // Look for the token + out, err := state.ACLTokenBySecretID(nil, args.SecretID) + if err != nil { + return err + } + + // Setup the output + reply.Token = out + if out != nil { + reply.Index = out.ModifyIndex + } else { + // Use the last index that affected the token table + index, err := state.Index("acl_token") + if err != nil { + return err + } + reply.Index = index + } + return nil +} diff --git a/nomad/acl_endpoint_test.go b/nomad/acl_endpoint_test.go new file mode 100644 index 000000000..ad3d76073 --- /dev/null +++ b/nomad/acl_endpoint_test.go @@ -0,0 +1,1001 @@ +package nomad + +import ( + "strings" + "testing" + "time" + + msgpackrpc "github.com/hashicorp/net-rpc-msgpackrpc" + "github.com/hashicorp/nomad/nomad/mock" + "github.com/hashicorp/nomad/nomad/structs" + "github.com/hashicorp/nomad/testutil" + "github.com/stretchr/testify/assert" +) + +func TestACLEndpoint_GetPolicy(t *testing.T) { + t.Parallel() + s1, root := testACLServer(t, nil) + defer s1.Shutdown() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Create the register request + policy := mock.ACLPolicy() + s1.fsm.State().UpsertACLPolicies(1000, []*structs.ACLPolicy{policy}) + + // Lookup the policy + get := &structs.ACLPolicySpecificRequest{ + Name: policy.Name, + QueryOptions: structs.QueryOptions{ + Region: "global", + SecretID: root.SecretID, + }, + } + var resp structs.SingleACLPolicyResponse + if err := msgpackrpc.CallWithCodec(codec, "ACL.GetPolicy", get, &resp); err != nil { + t.Fatalf("err: %v", err) + } + assert.Equal(t, uint64(1000), resp.Index) + assert.Equal(t, policy, resp.Policy) + + // Lookup non-existing policy + get.Name = structs.GenerateUUID() + if err := msgpackrpc.CallWithCodec(codec, "ACL.GetPolicy", get, &resp); err != nil { + t.Fatalf("err: %v", err) + } + assert.Equal(t, uint64(1000), resp.Index) + assert.Nil(t, resp.Policy) +} + +func TestACLEndpoint_GetPolicy_Blocking(t *testing.T) { + t.Parallel() + s1, root := testACLServer(t, nil) + defer s1.Shutdown() + state := s1.fsm.State() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Create the policies + p1 := mock.ACLPolicy() + p2 := mock.ACLPolicy() + + // First create an unrelated policy + time.AfterFunc(100*time.Millisecond, func() { + err := state.UpsertACLPolicies(100, []*structs.ACLPolicy{p1}) + if err != nil { + t.Fatalf("err: %v", err) + } + }) + + // Upsert the policy we are watching later + time.AfterFunc(200*time.Millisecond, func() { + err := state.UpsertACLPolicies(200, []*structs.ACLPolicy{p2}) + if err != nil { + t.Fatalf("err: %v", err) + } + }) + + // Lookup the policy + req := &structs.ACLPolicySpecificRequest{ + Name: p2.Name, + QueryOptions: structs.QueryOptions{ + Region: "global", + MinQueryIndex: 150, + SecretID: root.SecretID, + }, + } + var resp structs.SingleACLPolicyResponse + start := time.Now() + if err := msgpackrpc.CallWithCodec(codec, "ACL.GetPolicy", req, &resp); err != nil { + t.Fatalf("err: %v", err) + } + + if elapsed := time.Since(start); elapsed < 200*time.Millisecond { + t.Fatalf("should block (returned in %s) %#v", elapsed, resp) + } + if resp.Index != 200 { + t.Fatalf("Bad index: %d %d", resp.Index, 200) + } + if resp.Policy == nil || resp.Policy.Name != p2.Name { + t.Fatalf("bad: %#v", resp.Policy) + } + + // Eval delete triggers watches + time.AfterFunc(100*time.Millisecond, func() { + err := state.DeleteACLPolicies(300, []string{p2.Name}) + if err != nil { + t.Fatalf("err: %v", err) + } + }) + + req.QueryOptions.MinQueryIndex = 250 + var resp2 structs.SingleACLPolicyResponse + start = time.Now() + if err := msgpackrpc.CallWithCodec(codec, "ACL.GetPolicy", req, &resp2); err != nil { + t.Fatalf("err: %v", err) + } + + if elapsed := time.Since(start); elapsed < 100*time.Millisecond { + t.Fatalf("should block (returned in %s) %#v", elapsed, resp2) + } + if resp2.Index != 300 { + t.Fatalf("Bad index: %d %d", resp2.Index, 300) + } + if resp2.Policy != nil { + t.Fatalf("bad: %#v", resp2.Policy) + } +} + +func TestACLEndpoint_GetPolicies(t *testing.T) { + t.Parallel() + s1, root := testACLServer(t, nil) + defer s1.Shutdown() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Create the register request + policy := mock.ACLPolicy() + policy2 := mock.ACLPolicy() + s1.fsm.State().UpsertACLPolicies(1000, []*structs.ACLPolicy{policy, policy2}) + + // Lookup the policy + get := &structs.ACLPolicySetRequest{ + Names: []string{policy.Name, policy2.Name}, + QueryOptions: structs.QueryOptions{ + Region: "global", + SecretID: root.SecretID, + }, + } + var resp structs.ACLPolicySetResponse + if err := msgpackrpc.CallWithCodec(codec, "ACL.GetPolicies", get, &resp); err != nil { + t.Fatalf("err: %v", err) + } + assert.Equal(t, uint64(1000), resp.Index) + assert.Equal(t, 2, len(resp.Policies)) + assert.Equal(t, policy, resp.Policies[policy.Name]) + assert.Equal(t, policy2, resp.Policies[policy2.Name]) + + // Lookup non-existing policy + get.Names = []string{structs.GenerateUUID()} + resp = structs.ACLPolicySetResponse{} + if err := msgpackrpc.CallWithCodec(codec, "ACL.GetPolicies", get, &resp); err != nil { + t.Fatalf("err: %v", err) + } + assert.Equal(t, uint64(1000), resp.Index) + assert.Equal(t, 0, len(resp.Policies)) +} + +func TestACLEndpoint_GetPolicies_TokenSubset(t *testing.T) { + t.Parallel() + s1, _ := testACLServer(t, nil) + defer s1.Shutdown() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Create the register request + policy := mock.ACLPolicy() + policy2 := mock.ACLPolicy() + s1.fsm.State().UpsertACLPolicies(1000, []*structs.ACLPolicy{policy, policy2}) + + token := mock.ACLToken() + token.Policies = []string{policy.Name} + s1.fsm.State().UpsertACLTokens(1000, []*structs.ACLToken{token}) + + // Lookup the policy which is a subset of our tokens + get := &structs.ACLPolicySetRequest{ + Names: []string{policy.Name}, + QueryOptions: structs.QueryOptions{ + Region: "global", + SecretID: token.SecretID, + }, + } + var resp structs.ACLPolicySetResponse + if err := msgpackrpc.CallWithCodec(codec, "ACL.GetPolicies", get, &resp); err != nil { + t.Fatalf("err: %v", err) + } + assert.Equal(t, uint64(1000), resp.Index) + assert.Equal(t, 1, len(resp.Policies)) + assert.Equal(t, policy, resp.Policies[policy.Name]) + + // Lookup non-associated policy + get.Names = []string{policy2.Name} + resp = structs.ACLPolicySetResponse{} + if err := msgpackrpc.CallWithCodec(codec, "ACL.GetPolicies", get, &resp); err == nil { + t.Fatalf("expected error") + } +} + +func TestACLEndpoint_GetPolicies_Blocking(t *testing.T) { + t.Parallel() + s1, root := testACLServer(t, nil) + defer s1.Shutdown() + state := s1.fsm.State() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Create the policies + p1 := mock.ACLPolicy() + p2 := mock.ACLPolicy() + + // First create an unrelated policy + time.AfterFunc(100*time.Millisecond, func() { + err := state.UpsertACLPolicies(100, []*structs.ACLPolicy{p1}) + if err != nil { + t.Fatalf("err: %v", err) + } + }) + + // Upsert the policy we are watching later + time.AfterFunc(200*time.Millisecond, func() { + err := state.UpsertACLPolicies(200, []*structs.ACLPolicy{p2}) + if err != nil { + t.Fatalf("err: %v", err) + } + }) + + // Lookup the policy + req := &structs.ACLPolicySetRequest{ + Names: []string{p2.Name}, + QueryOptions: structs.QueryOptions{ + Region: "global", + MinQueryIndex: 150, + SecretID: root.SecretID, + }, + } + var resp structs.ACLPolicySetResponse + start := time.Now() + if err := msgpackrpc.CallWithCodec(codec, "ACL.GetPolicies", req, &resp); err != nil { + t.Fatalf("err: %v", err) + } + + if elapsed := time.Since(start); elapsed < 200*time.Millisecond { + t.Fatalf("should block (returned in %s) %#v", elapsed, resp) + } + if resp.Index != 200 { + t.Fatalf("Bad index: %d %d", resp.Index, 200) + } + if len(resp.Policies) == 0 || resp.Policies[p2.Name] == nil { + t.Fatalf("bad: %#v", resp.Policies) + } + + // Eval delete triggers watches + time.AfterFunc(100*time.Millisecond, func() { + err := state.DeleteACLPolicies(300, []string{p2.Name}) + if err != nil { + t.Fatalf("err: %v", err) + } + }) + + req.QueryOptions.MinQueryIndex = 250 + var resp2 structs.ACLPolicySetResponse + start = time.Now() + if err := msgpackrpc.CallWithCodec(codec, "ACL.GetPolicies", req, &resp2); err != nil { + t.Fatalf("err: %v", err) + } + + if elapsed := time.Since(start); elapsed < 100*time.Millisecond { + t.Fatalf("should block (returned in %s) %#v", elapsed, resp2) + } + if resp2.Index != 300 { + t.Fatalf("Bad index: %d %d", resp2.Index, 300) + } + if len(resp2.Policies) != 0 { + t.Fatalf("bad: %#v", resp2.Policies) + } +} + +func TestACLEndpoint_ListPolicies(t *testing.T) { + t.Parallel() + s1, root := testACLServer(t, nil) + defer s1.Shutdown() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Create the register request + p1 := mock.ACLPolicy() + p2 := mock.ACLPolicy() + + p1.Name = "aaaaaaaa-3350-4b4b-d185-0e1992ed43e9" + p2.Name = "aaaabbbb-3350-4b4b-d185-0e1992ed43e9" + s1.fsm.State().UpsertACLPolicies(1000, []*structs.ACLPolicy{p1, p2}) + + // Lookup the policies + get := &structs.ACLPolicyListRequest{ + QueryOptions: structs.QueryOptions{ + Region: "global", + SecretID: root.SecretID, + }, + } + var resp structs.ACLPolicyListResponse + if err := msgpackrpc.CallWithCodec(codec, "ACL.ListPolicies", get, &resp); err != nil { + t.Fatalf("err: %v", err) + } + assert.Equal(t, uint64(1000), resp.Index) + assert.Equal(t, 2, len(resp.Policies)) + + // Lookup the policies by prefix + get = &structs.ACLPolicyListRequest{ + QueryOptions: structs.QueryOptions{ + Region: "global", + Prefix: "aaaabb", + SecretID: root.SecretID, + }, + } + var resp2 structs.ACLPolicyListResponse + if err := msgpackrpc.CallWithCodec(codec, "ACL.ListPolicies", get, &resp2); err != nil { + t.Fatalf("err: %v", err) + } + assert.Equal(t, uint64(1000), resp2.Index) + assert.Equal(t, 1, len(resp2.Policies)) +} + +func TestACLEndpoint_ListPolicies_Blocking(t *testing.T) { + t.Parallel() + s1, root := testACLServer(t, nil) + defer s1.Shutdown() + state := s1.fsm.State() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Create the policy + policy := mock.ACLPolicy() + + // Upsert eval triggers watches + time.AfterFunc(100*time.Millisecond, func() { + if err := state.UpsertACLPolicies(2, []*structs.ACLPolicy{policy}); err != nil { + t.Fatalf("err: %v", err) + } + }) + + req := &structs.ACLPolicyListRequest{ + QueryOptions: structs.QueryOptions{ + Region: "global", + MinQueryIndex: 1, + SecretID: root.SecretID, + }, + } + start := time.Now() + var resp structs.ACLPolicyListResponse + if err := msgpackrpc.CallWithCodec(codec, "ACL.ListPolicies", req, &resp); err != nil { + t.Fatalf("err: %v", err) + } + + if elapsed := time.Since(start); elapsed < 100*time.Millisecond { + t.Fatalf("should block (returned in %s) %#v", elapsed, resp) + } + assert.Equal(t, uint64(2), resp.Index) + if len(resp.Policies) != 1 || resp.Policies[0].Name != policy.Name { + t.Fatalf("bad: %#v", resp.Policies) + } + + // Eval deletion triggers watches + time.AfterFunc(100*time.Millisecond, func() { + if err := state.DeleteACLPolicies(3, []string{policy.Name}); err != nil { + t.Fatalf("err: %v", err) + } + }) + + req.MinQueryIndex = 2 + start = time.Now() + var resp2 structs.ACLPolicyListResponse + if err := msgpackrpc.CallWithCodec(codec, "ACL.ListPolicies", req, &resp2); err != nil { + t.Fatalf("err: %v", err) + } + + if elapsed := time.Since(start); elapsed < 100*time.Millisecond { + t.Fatalf("should block (returned in %s) %#v", elapsed, resp2) + } + assert.Equal(t, uint64(3), resp2.Index) + assert.Equal(t, 0, len(resp2.Policies)) +} + +func TestACLEndpoint_DeletePolicies(t *testing.T) { + t.Parallel() + s1, root := testACLServer(t, nil) + defer s1.Shutdown() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Create the register request + p1 := mock.ACLPolicy() + s1.fsm.State().UpsertACLPolicies(1000, []*structs.ACLPolicy{p1}) + + // Lookup the policies + req := &structs.ACLPolicyDeleteRequest{ + Names: []string{p1.Name}, + WriteRequest: structs.WriteRequest{ + Region: "global", + SecretID: root.SecretID, + }, + } + var resp structs.GenericResponse + if err := msgpackrpc.CallWithCodec(codec, "ACL.DeletePolicies", req, &resp); err != nil { + t.Fatalf("err: %v", err) + } + assert.NotEqual(t, uint64(0), resp.Index) +} + +func TestACLEndpoint_UpsertPolicies(t *testing.T) { + t.Parallel() + s1, root := testACLServer(t, nil) + defer s1.Shutdown() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Create the register request + p1 := mock.ACLPolicy() + + // Lookup the policies + req := &structs.ACLPolicyUpsertRequest{ + Policies: []*structs.ACLPolicy{p1}, + WriteRequest: structs.WriteRequest{ + Region: "global", + SecretID: root.SecretID, + }, + } + var resp structs.GenericResponse + if err := msgpackrpc.CallWithCodec(codec, "ACL.UpsertPolicies", req, &resp); err != nil { + t.Fatalf("err: %v", err) + } + assert.NotEqual(t, uint64(0), resp.Index) + + // Check we created the policy + out, err := s1.fsm.State().ACLPolicyByName(nil, p1.Name) + assert.Nil(t, err) + assert.NotNil(t, out) +} + +func TestACLEndpoint_UpsertPolicies_Invalid(t *testing.T) { + t.Parallel() + s1, root := testACLServer(t, nil) + defer s1.Shutdown() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Create the register request + p1 := mock.ACLPolicy() + p1.Rules = "blah blah invalid" + + // Lookup the policies + req := &structs.ACLPolicyUpsertRequest{ + Policies: []*structs.ACLPolicy{p1}, + WriteRequest: structs.WriteRequest{ + Region: "global", + SecretID: root.SecretID, + }, + } + var resp structs.GenericResponse + err := msgpackrpc.CallWithCodec(codec, "ACL.UpsertPolicies", req, &resp) + assert.NotNil(t, err) + if !strings.Contains(err.Error(), "failed to parse") { + t.Fatalf("bad: %s", err) + } +} + +func TestACLEndpoint_GetToken(t *testing.T) { + t.Parallel() + s1, root := testACLServer(t, nil) + defer s1.Shutdown() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Create the register request + token := mock.ACLToken() + s1.fsm.State().UpsertACLTokens(1000, []*structs.ACLToken{token}) + + // Lookup the token + get := &structs.ACLTokenSpecificRequest{ + AccessorID: token.AccessorID, + QueryOptions: structs.QueryOptions{ + Region: "global", + SecretID: root.SecretID, + }, + } + var resp structs.SingleACLTokenResponse + if err := msgpackrpc.CallWithCodec(codec, "ACL.GetToken", get, &resp); err != nil { + t.Fatalf("err: %v", err) + } + assert.Equal(t, uint64(1000), resp.Index) + assert.Equal(t, token, resp.Token) + + // Lookup non-existing token + get.AccessorID = structs.GenerateUUID() + if err := msgpackrpc.CallWithCodec(codec, "ACL.GetToken", get, &resp); err != nil { + t.Fatalf("err: %v", err) + } + assert.Equal(t, uint64(1000), resp.Index) + assert.Nil(t, resp.Token) +} + +func TestACLEndpoint_GetToken_Blocking(t *testing.T) { + t.Parallel() + s1, root := testACLServer(t, nil) + defer s1.Shutdown() + state := s1.fsm.State() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Create the tokens + p1 := mock.ACLToken() + p2 := mock.ACLToken() + + // First create an unrelated token + time.AfterFunc(100*time.Millisecond, func() { + err := state.UpsertACLTokens(100, []*structs.ACLToken{p1}) + if err != nil { + t.Fatalf("err: %v", err) + } + }) + + // Upsert the token we are watching later + time.AfterFunc(200*time.Millisecond, func() { + err := state.UpsertACLTokens(200, []*structs.ACLToken{p2}) + if err != nil { + t.Fatalf("err: %v", err) + } + }) + + // Lookup the token + req := &structs.ACLTokenSpecificRequest{ + AccessorID: p2.AccessorID, + QueryOptions: structs.QueryOptions{ + Region: "global", + MinQueryIndex: 150, + SecretID: root.SecretID, + }, + } + var resp structs.SingleACLTokenResponse + start := time.Now() + if err := msgpackrpc.CallWithCodec(codec, "ACL.GetToken", req, &resp); err != nil { + t.Fatalf("err: %v", err) + } + + if elapsed := time.Since(start); elapsed < 200*time.Millisecond { + t.Fatalf("should block (returned in %s) %#v", elapsed, resp) + } + if resp.Index != 200 { + t.Fatalf("Bad index: %d %d", resp.Index, 200) + } + if resp.Token == nil || resp.Token.AccessorID != p2.AccessorID { + t.Fatalf("bad: %#v", resp.Token) + } + + // Eval delete triggers watches + time.AfterFunc(100*time.Millisecond, func() { + err := state.DeleteACLTokens(300, []string{p2.AccessorID}) + if err != nil { + t.Fatalf("err: %v", err) + } + }) + + req.QueryOptions.MinQueryIndex = 250 + var resp2 structs.SingleACLTokenResponse + start = time.Now() + if err := msgpackrpc.CallWithCodec(codec, "ACL.GetToken", req, &resp2); err != nil { + t.Fatalf("err: %v", err) + } + + if elapsed := time.Since(start); elapsed < 100*time.Millisecond { + t.Fatalf("should block (returned in %s) %#v", elapsed, resp2) + } + if resp2.Index != 300 { + t.Fatalf("Bad index: %d %d", resp2.Index, 300) + } + if resp2.Token != nil { + t.Fatalf("bad: %#v", resp2.Token) + } +} + +func TestACLEndpoint_GetTokens(t *testing.T) { + t.Parallel() + s1, root := testACLServer(t, nil) + defer s1.Shutdown() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Create the register request + token := mock.ACLToken() + token2 := mock.ACLToken() + s1.fsm.State().UpsertACLTokens(1000, []*structs.ACLToken{token, token2}) + + // Lookup the token + get := &structs.ACLTokenSetRequest{ + AccessorIDS: []string{token.AccessorID, token2.AccessorID}, + QueryOptions: structs.QueryOptions{ + Region: "global", + SecretID: root.SecretID, + }, + } + var resp structs.ACLTokenSetResponse + if err := msgpackrpc.CallWithCodec(codec, "ACL.GetTokens", get, &resp); err != nil { + t.Fatalf("err: %v", err) + } + assert.Equal(t, uint64(1000), resp.Index) + assert.Equal(t, 2, len(resp.Tokens)) + assert.Equal(t, token, resp.Tokens[token.AccessorID]) + + // Lookup non-existing token + get.AccessorIDS = []string{structs.GenerateUUID()} + resp = structs.ACLTokenSetResponse{} + if err := msgpackrpc.CallWithCodec(codec, "ACL.GetTokens", get, &resp); err != nil { + t.Fatalf("err: %v", err) + } + assert.Equal(t, uint64(1000), resp.Index) + assert.Equal(t, 0, len(resp.Tokens)) +} + +func TestACLEndpoint_GetTokens_Blocking(t *testing.T) { + t.Parallel() + s1, root := testACLServer(t, nil) + defer s1.Shutdown() + state := s1.fsm.State() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Create the tokens + p1 := mock.ACLToken() + p2 := mock.ACLToken() + + // First create an unrelated token + time.AfterFunc(100*time.Millisecond, func() { + err := state.UpsertACLTokens(100, []*structs.ACLToken{p1}) + if err != nil { + t.Fatalf("err: %v", err) + } + }) + + // Upsert the token we are watching later + time.AfterFunc(200*time.Millisecond, func() { + err := state.UpsertACLTokens(200, []*structs.ACLToken{p2}) + if err != nil { + t.Fatalf("err: %v", err) + } + }) + + // Lookup the token + req := &structs.ACLTokenSetRequest{ + AccessorIDS: []string{p2.AccessorID}, + QueryOptions: structs.QueryOptions{ + Region: "global", + MinQueryIndex: 150, + SecretID: root.SecretID, + }, + } + var resp structs.ACLTokenSetResponse + start := time.Now() + if err := msgpackrpc.CallWithCodec(codec, "ACL.GetTokens", req, &resp); err != nil { + t.Fatalf("err: %v", err) + } + + if elapsed := time.Since(start); elapsed < 200*time.Millisecond { + t.Fatalf("should block (returned in %s) %#v", elapsed, resp) + } + if resp.Index != 200 { + t.Fatalf("Bad index: %d %d", resp.Index, 200) + } + if len(resp.Tokens) == 0 || resp.Tokens[p2.AccessorID] == nil { + t.Fatalf("bad: %#v", resp.Tokens) + } + + // Eval delete triggers watches + time.AfterFunc(100*time.Millisecond, func() { + err := state.DeleteACLTokens(300, []string{p2.AccessorID}) + if err != nil { + t.Fatalf("err: %v", err) + } + }) + + req.QueryOptions.MinQueryIndex = 250 + var resp2 structs.ACLTokenSetResponse + start = time.Now() + if err := msgpackrpc.CallWithCodec(codec, "ACL.GetTokens", req, &resp2); err != nil { + t.Fatalf("err: %v", err) + } + + if elapsed := time.Since(start); elapsed < 100*time.Millisecond { + t.Fatalf("should block (returned in %s) %#v", elapsed, resp2) + } + if resp2.Index != 300 { + t.Fatalf("Bad index: %d %d", resp2.Index, 300) + } + if len(resp2.Tokens) != 0 { + t.Fatalf("bad: %#v", resp2.Tokens) + } +} + +func TestACLEndpoint_ListTokens(t *testing.T) { + t.Parallel() + s1, root := testACLServer(t, nil) + defer s1.Shutdown() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Create the register request + p1 := mock.ACLToken() + p2 := mock.ACLToken() + p2.Global = true + + p1.AccessorID = "aaaaaaaa-3350-4b4b-d185-0e1992ed43e9" + p2.AccessorID = "aaaabbbb-3350-4b4b-d185-0e1992ed43e9" + s1.fsm.State().UpsertACLTokens(1000, []*structs.ACLToken{p1, p2}) + + // Lookup the tokens + get := &structs.ACLTokenListRequest{ + QueryOptions: structs.QueryOptions{ + Region: "global", + SecretID: root.SecretID, + }, + } + var resp structs.ACLTokenListResponse + if err := msgpackrpc.CallWithCodec(codec, "ACL.ListTokens", get, &resp); err != nil { + t.Fatalf("err: %v", err) + } + assert.Equal(t, uint64(1000), resp.Index) + assert.Equal(t, 3, len(resp.Tokens)) + + // Lookup the tokens by prefix + get = &structs.ACLTokenListRequest{ + QueryOptions: structs.QueryOptions{ + Region: "global", + Prefix: "aaaabb", + SecretID: root.SecretID, + }, + } + var resp2 structs.ACLTokenListResponse + if err := msgpackrpc.CallWithCodec(codec, "ACL.ListTokens", get, &resp2); err != nil { + t.Fatalf("err: %v", err) + } + assert.Equal(t, uint64(1000), resp2.Index) + assert.Equal(t, 1, len(resp2.Tokens)) + + // Lookup the global tokens + get = &structs.ACLTokenListRequest{ + GlobalOnly: true, + QueryOptions: structs.QueryOptions{ + Region: "global", + SecretID: root.SecretID, + }, + } + var resp3 structs.ACLTokenListResponse + if err := msgpackrpc.CallWithCodec(codec, "ACL.ListTokens", get, &resp3); err != nil { + t.Fatalf("err: %v", err) + } + assert.Equal(t, uint64(1000), resp3.Index) + assert.Equal(t, 2, len(resp3.Tokens)) +} + +func TestACLEndpoint_ListTokens_Blocking(t *testing.T) { + t.Parallel() + s1, root := testACLServer(t, nil) + defer s1.Shutdown() + state := s1.fsm.State() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Create the token + token := mock.ACLToken() + + // Upsert eval triggers watches + time.AfterFunc(100*time.Millisecond, func() { + if err := state.UpsertACLTokens(3, []*structs.ACLToken{token}); err != nil { + t.Fatalf("err: %v", err) + } + }) + + req := &structs.ACLTokenListRequest{ + QueryOptions: structs.QueryOptions{ + Region: "global", + MinQueryIndex: 2, + SecretID: root.SecretID, + }, + } + start := time.Now() + var resp structs.ACLTokenListResponse + if err := msgpackrpc.CallWithCodec(codec, "ACL.ListTokens", req, &resp); err != nil { + t.Fatalf("err: %v", err) + } + + if elapsed := time.Since(start); elapsed < 100*time.Millisecond { + t.Fatalf("should block (returned in %s) %#v", elapsed, resp) + } + assert.Equal(t, uint64(3), resp.Index) + if len(resp.Tokens) != 2 { + t.Fatalf("bad: %#v", resp.Tokens) + } + + // Eval deletion triggers watches + time.AfterFunc(100*time.Millisecond, func() { + if err := state.DeleteACLTokens(4, []string{token.AccessorID}); err != nil { + t.Fatalf("err: %v", err) + } + }) + + req.MinQueryIndex = 3 + start = time.Now() + var resp2 structs.ACLTokenListResponse + if err := msgpackrpc.CallWithCodec(codec, "ACL.ListTokens", req, &resp2); err != nil { + t.Fatalf("err: %v", err) + } + + if elapsed := time.Since(start); elapsed < 100*time.Millisecond { + t.Fatalf("should block (returned in %s) %#v", elapsed, resp2) + } + assert.Equal(t, uint64(4), resp2.Index) + assert.Equal(t, 1, len(resp2.Tokens)) +} + +func TestACLEndpoint_DeleteTokens(t *testing.T) { + t.Parallel() + s1, root := testACLServer(t, nil) + defer s1.Shutdown() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Create the register request + p1 := mock.ACLToken() + s1.fsm.State().UpsertACLTokens(1000, []*structs.ACLToken{p1}) + + // Lookup the tokens + req := &structs.ACLTokenDeleteRequest{ + AccessorIDs: []string{p1.AccessorID}, + WriteRequest: structs.WriteRequest{ + Region: "global", + SecretID: root.SecretID, + }, + } + var resp structs.GenericResponse + if err := msgpackrpc.CallWithCodec(codec, "ACL.DeleteTokens", req, &resp); err != nil { + t.Fatalf("err: %v", err) + } + assert.NotEqual(t, uint64(0), resp.Index) +} + +func TestACLEndpoint_Bootstrap(t *testing.T) { + t.Parallel() + s1 := testServer(t, func(c *Config) { + c.ACLEnabled = true + }) + defer s1.Shutdown() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Lookup the tokens + req := &structs.ACLTokenBootstrapRequest{ + WriteRequest: structs.WriteRequest{Region: "global"}, + } + var resp structs.ACLTokenUpsertResponse + if err := msgpackrpc.CallWithCodec(codec, "ACL.Bootstrap", req, &resp); err != nil { + t.Fatalf("err: %v", err) + } + assert.NotEqual(t, uint64(0), resp.Index) + assert.NotNil(t, resp.Tokens[0]) + + // Get the token out from the response + created := resp.Tokens[0] + assert.NotEqual(t, "", created.AccessorID) + assert.NotEqual(t, "", created.SecretID) + assert.NotEqual(t, time.Time{}, created.CreateTime) + assert.Equal(t, structs.ACLManagementToken, created.Type) + assert.Equal(t, "Bootstrap Token", created.Name) + assert.Equal(t, true, created.Global) + + // Check we created the token + out, err := s1.fsm.State().ACLTokenByAccessorID(nil, created.AccessorID) + assert.Nil(t, err) + assert.Equal(t, created, out) +} + +func TestACLEndpoint_UpsertTokens(t *testing.T) { + t.Parallel() + s1, root := testACLServer(t, nil) + defer s1.Shutdown() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Create the register request + p1 := mock.ACLToken() + p1.AccessorID = "" // Blank to create + + // Lookup the tokens + req := &structs.ACLTokenUpsertRequest{ + Tokens: []*structs.ACLToken{p1}, + WriteRequest: structs.WriteRequest{ + Region: "global", + SecretID: root.SecretID, + }, + } + var resp structs.ACLTokenUpsertResponse + if err := msgpackrpc.CallWithCodec(codec, "ACL.UpsertTokens", req, &resp); err != nil { + t.Fatalf("err: %v", err) + } + assert.NotEqual(t, uint64(0), resp.Index) + + // Get the token out from the response + created := resp.Tokens[0] + assert.NotEqual(t, "", created.AccessorID) + assert.NotEqual(t, "", created.SecretID) + assert.NotEqual(t, time.Time{}, created.CreateTime) + assert.Equal(t, p1.Type, created.Type) + assert.Equal(t, p1.Policies, created.Policies) + assert.Equal(t, p1.Name, created.Name) + + // Check we created the token + out, err := s1.fsm.State().ACLTokenByAccessorID(nil, created.AccessorID) + assert.Nil(t, err) + assert.Equal(t, created, out) + + // Update the token type + req.Tokens[0] = created + created.Type = "management" + created.Policies = nil + + // Upsert again + if err := msgpackrpc.CallWithCodec(codec, "ACL.UpsertTokens", req, &resp); err != nil { + t.Fatalf("err: %v", err) + } + assert.NotEqual(t, uint64(0), resp.Index) + + // Check we modified the token + out, err = s1.fsm.State().ACLTokenByAccessorID(nil, created.AccessorID) + assert.Nil(t, err) + assert.Equal(t, created, out) +} + +func TestACLEndpoint_UpsertTokens_Invalid(t *testing.T) { + t.Parallel() + s1, root := testACLServer(t, nil) + defer s1.Shutdown() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Create the register request + p1 := mock.ACLToken() + p1.Type = "blah blah" + + // Lookup the tokens + req := &structs.ACLTokenUpsertRequest{ + Tokens: []*structs.ACLToken{p1}, + WriteRequest: structs.WriteRequest{ + Region: "global", + SecretID: root.SecretID, + }, + } + var resp structs.GenericResponse + err := msgpackrpc.CallWithCodec(codec, "ACL.UpsertTokens", req, &resp) + assert.NotNil(t, err) + if !strings.Contains(err.Error(), "client or management") { + t.Fatalf("bad: %s", err) + } +} + +func TestACLEndpoint_ResolveToken(t *testing.T) { + t.Parallel() + s1, _ := testACLServer(t, nil) + defer s1.Shutdown() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Create the register request + token := mock.ACLToken() + s1.fsm.State().UpsertACLTokens(1000, []*structs.ACLToken{token}) + + // Lookup the token + get := &structs.ResolveACLTokenRequest{ + SecretID: token.SecretID, + QueryOptions: structs.QueryOptions{Region: "global"}, + } + var resp structs.ResolveACLTokenResponse + if err := msgpackrpc.CallWithCodec(codec, "ACL.ResolveToken", get, &resp); err != nil { + t.Fatalf("err: %v", err) + } + assert.Equal(t, uint64(1000), resp.Index) + assert.Equal(t, token, resp.Token) + + // Lookup non-existing token + get.SecretID = structs.GenerateUUID() + if err := msgpackrpc.CallWithCodec(codec, "ACL.ResolveToken", get, &resp); err != nil { + t.Fatalf("err: %v", err) + } + assert.Equal(t, uint64(1000), resp.Index) + assert.Nil(t, resp.Token) +} diff --git a/nomad/acl_test.go b/nomad/acl_test.go new file mode 100644 index 000000000..b83e6687c --- /dev/null +++ b/nomad/acl_test.go @@ -0,0 +1,91 @@ +package nomad + +import ( + "os" + "testing" + + lru "github.com/hashicorp/golang-lru" + "github.com/hashicorp/nomad/acl" + "github.com/hashicorp/nomad/nomad/mock" + "github.com/hashicorp/nomad/nomad/state" + "github.com/hashicorp/nomad/nomad/structs" + "github.com/stretchr/testify/assert" +) + +func TestResolveACLToken(t *testing.T) { + // Create mock state store and cache + state, err := state.NewStateStore(os.Stderr) + assert.Nil(t, err) + cache, err := lru.New2Q(16) + assert.Nil(t, err) + + // Create a policy / token + policy := mock.ACLPolicy() + policy2 := mock.ACLPolicy() + token := mock.ACLToken() + token.Policies = []string{policy.Name, policy2.Name} + token2 := mock.ACLToken() + token2.Type = structs.ACLManagementToken + token2.Policies = nil + err = state.UpsertACLPolicies(100, []*structs.ACLPolicy{policy, policy2}) + assert.Nil(t, err) + err = state.UpsertACLTokens(110, []*structs.ACLToken{token, token2}) + assert.Nil(t, err) + + snap, err := state.Snapshot() + assert.Nil(t, err) + + // Attempt resolution of blank token. Should return anonymous policy + aclObj, err := resolveTokenFromSnapshotCache(snap, cache, "") + assert.Nil(t, err) + assert.NotNil(t, aclObj) + + // Attempt resolution of unknown token. Should fail. + randID := structs.GenerateUUID() + aclObj, err = resolveTokenFromSnapshotCache(snap, cache, randID) + assert.Equal(t, structs.ErrTokenNotFound, err) + assert.Nil(t, aclObj) + + // Attempt resolution of management token. Should get singleton. + aclObj, err = resolveTokenFromSnapshotCache(snap, cache, token2.SecretID) + assert.Nil(t, err) + assert.NotNil(t, aclObj) + assert.Equal(t, true, aclObj.IsManagement()) + if aclObj != acl.ManagementACL { + t.Fatalf("expected singleton") + } + + // Attempt resolution of client token + aclObj, err = resolveTokenFromSnapshotCache(snap, cache, token.SecretID) + assert.Nil(t, err) + assert.NotNil(t, aclObj) + + // Check that the ACL object is sane + assert.Equal(t, false, aclObj.IsManagement()) + allowed := aclObj.AllowNamespaceOperation("default", acl.NamespaceCapabilityListJobs) + assert.Equal(t, true, allowed) + allowed = aclObj.AllowNamespaceOperation("other", acl.NamespaceCapabilityListJobs) + assert.Equal(t, false, allowed) + + // Resolve the same token again, should get cache value + aclObj2, err := resolveTokenFromSnapshotCache(snap, cache, token.SecretID) + assert.Nil(t, err) + assert.NotNil(t, aclObj2) + if aclObj != aclObj2 { + t.Fatalf("expected cached value") + } + + // Bust the cache by upserting the policy + err = state.UpsertACLPolicies(120, []*structs.ACLPolicy{policy}) + assert.Nil(t, err) + snap, err = state.Snapshot() + assert.Nil(t, err) + + // Resolve the same token again, should get different value + aclObj3, err := resolveTokenFromSnapshotCache(snap, cache, token.SecretID) + assert.Nil(t, err) + assert.NotNil(t, aclObj3) + if aclObj == aclObj3 { + t.Fatalf("unexpected cached value") + } +} diff --git a/nomad/config.go b/nomad/config.go index 29161ee57..418d3f79a 100644 --- a/nomad/config.go +++ b/nomad/config.go @@ -101,6 +101,10 @@ type Config struct { // Region is the region this Nomad server belongs to. Region string + // AuthoritativeRegion is the region which is treated as the authoritative source + // for ACLs and Policies. This provides a single source of truth to resolve conflicts. + AuthoritativeRegion string + // Datacenter is the datacenter this Nomad server belongs to. Datacenter string @@ -224,6 +228,17 @@ type Config struct { // TLSConfig holds various TLS related configurations TLSConfig *config.TLSConfig + + // ACLEnabled controls if ACL enforcement and management is enabled. + ACLEnabled bool + + // ReplicationBackoff is how much we backoff when replication errors. + // This is a tunable knob for testing primarily. + ReplicationBackoff time.Duration + + // ReplicationToken is the ACL Token Secret ID used to fetch from + // the Authoritative Region. + ReplicationToken string } // CheckVersion is used to check if the ProtocolVersion is valid @@ -247,6 +262,7 @@ func DefaultConfig() *Config { c := &Config{ Region: DefaultRegion, + AuthoritativeRegion: DefaultRegion, Datacenter: DefaultDC, NodeName: hostname, ProtocolVersion: ProtocolVersionMax, @@ -279,6 +295,7 @@ func DefaultConfig() *Config { VaultConfig: config.DefaultVaultConfig(), RPCHoldTimeout: 5 * time.Second, TLSConfig: &config.TLSConfig{}, + ReplicationBackoff: 30 * time.Second, } // Enable all known schedulers by default diff --git a/nomad/fsm.go b/nomad/fsm.go index fd8f294e2..dddb90ff1 100644 --- a/nomad/fsm.go +++ b/nomad/fsm.go @@ -41,6 +41,8 @@ const ( VaultAccessorSnapshot JobVersionSnapshot DeploymentSnapshot + ACLPolicySnapshot + ACLTokenSnapshot ) // nomadFSM implements a finite state machine that is used @@ -167,6 +169,16 @@ func (n *nomadFSM) Apply(log *raft.Log) interface{} { return n.applyDeploymentDelete(buf[1:], log.Index) case structs.JobStabilityRequestType: return n.applyJobStability(buf[1:], log.Index) + case structs.ACLPolicyUpsertRequestType: + return n.applyACLPolicyUpsert(buf[1:], log.Index) + case structs.ACLPolicyDeleteRequestType: + return n.applyACLPolicyDelete(buf[1:], log.Index) + case structs.ACLTokenUpsertRequestType: + return n.applyACLTokenUpsert(buf[1:], log.Index) + case structs.ACLTokenDeleteRequestType: + return n.applyACLTokenDelete(buf[1:], log.Index) + case structs.ACLTokenBootstrapRequestType: + return n.applyACLTokenBootstrap(buf[1:], log.Index) default: if ignoreUnknown { n.logger.Printf("[WARN] nomad.fsm: ignoring unknown message type (%d), upgrade to newer version", msgType) @@ -669,6 +681,81 @@ func (n *nomadFSM) applyJobStability(buf []byte, index uint64) interface{} { return nil } +// applyACLPolicyUpsert is used to upsert a set of policies +func (n *nomadFSM) applyACLPolicyUpsert(buf []byte, index uint64) interface{} { + defer metrics.MeasureSince([]string{"nomad", "fsm", "apply_acl_policy_upsert"}, time.Now()) + var req structs.ACLPolicyUpsertRequest + if err := structs.Decode(buf, &req); err != nil { + panic(fmt.Errorf("failed to decode request: %v", err)) + } + + if err := n.state.UpsertACLPolicies(index, req.Policies); err != nil { + n.logger.Printf("[ERR] nomad.fsm: UpsertACLPolicies failed: %v", err) + return err + } + return nil +} + +// applyACLPolicyDelete is used to delete a set of policies +func (n *nomadFSM) applyACLPolicyDelete(buf []byte, index uint64) interface{} { + defer metrics.MeasureSince([]string{"nomad", "fsm", "apply_acl_policy_delete"}, time.Now()) + var req structs.ACLPolicyDeleteRequest + if err := structs.Decode(buf, &req); err != nil { + panic(fmt.Errorf("failed to decode request: %v", err)) + } + + if err := n.state.DeleteACLPolicies(index, req.Names); err != nil { + n.logger.Printf("[ERR] nomad.fsm: DeleteACLPolicies failed: %v", err) + return err + } + return nil +} + +// applyACLTokenUpsert is used to upsert a set of policies +func (n *nomadFSM) applyACLTokenUpsert(buf []byte, index uint64) interface{} { + defer metrics.MeasureSince([]string{"nomad", "fsm", "apply_acl_token_upsert"}, time.Now()) + var req structs.ACLTokenUpsertRequest + if err := structs.Decode(buf, &req); err != nil { + panic(fmt.Errorf("failed to decode request: %v", err)) + } + + if err := n.state.UpsertACLTokens(index, req.Tokens); err != nil { + n.logger.Printf("[ERR] nomad.fsm: UpsertACLTokens failed: %v", err) + return err + } + return nil +} + +// applyACLTokenDelete is used to delete a set of policies +func (n *nomadFSM) applyACLTokenDelete(buf []byte, index uint64) interface{} { + defer metrics.MeasureSince([]string{"nomad", "fsm", "apply_acl_token_delete"}, time.Now()) + var req structs.ACLTokenDeleteRequest + if err := structs.Decode(buf, &req); err != nil { + panic(fmt.Errorf("failed to decode request: %v", err)) + } + + if err := n.state.DeleteACLTokens(index, req.AccessorIDs); err != nil { + n.logger.Printf("[ERR] nomad.fsm: DeleteACLTokens failed: %v", err) + return err + } + return nil +} + +// applyACLTokenBootstrap is used to bootstrap an ACL token +func (n *nomadFSM) applyACLTokenBootstrap(buf []byte, index uint64) interface{} { + defer metrics.MeasureSince([]string{"nomad", "fsm", "apply_acl_token_bootstrap"}, time.Now()) + var req structs.ACLTokenBootstrapRequest + if err := structs.Decode(buf, &req); err != nil { + panic(fmt.Errorf("failed to decode request: %v", err)) + } + + if err := n.state.BootstrapACLTokens(index, req.Token); err != nil { + n.logger.Printf("[ERR] nomad.fsm: BootstrapACLToken failed: %v", err) + return err + } + return nil +} + func (n *nomadFSM) Snapshot() (raft.FSMSnapshot, error) { // Create a new snapshot snap, err := n.state.Snapshot() @@ -826,6 +913,24 @@ func (n *nomadFSM) Restore(old io.ReadCloser) error { return err } + case ACLPolicySnapshot: + policy := new(structs.ACLPolicy) + if err := dec.Decode(policy); err != nil { + return err + } + if err := restore.ACLPolicyRestore(policy); err != nil { + return err + } + + case ACLTokenSnapshot: + token := new(structs.ACLToken) + if err := dec.Decode(token); err != nil { + return err + } + if err := restore.ACLTokenRestore(token); err != nil { + return err + } + default: return fmt.Errorf("Unrecognized snapshot type: %v", msgType) } @@ -1032,6 +1137,14 @@ func (s *nomadSnapshot) Persist(sink raft.SnapshotSink) error { sink.Cancel() return err } + if err := s.persistACLPolicies(sink, encoder); err != nil { + sink.Cancel() + return err + } + if err := s.persistACLTokens(sink, encoder); err != nil { + sink.Cancel() + return err + } return nil } @@ -1308,6 +1421,62 @@ func (s *nomadSnapshot) persistDeployments(sink raft.SnapshotSink, return nil } +func (s *nomadSnapshot) persistACLPolicies(sink raft.SnapshotSink, + encoder *codec.Encoder) error { + // Get all the policies + ws := memdb.NewWatchSet() + policies, err := s.snap.ACLPolicies(ws) + if err != nil { + return err + } + + for { + // Get the next item + raw := policies.Next() + if raw == nil { + break + } + + // Prepare the request struct + policy := raw.(*structs.ACLPolicy) + + // Write out a policy registration + sink.Write([]byte{byte(ACLPolicySnapshot)}) + if err := encoder.Encode(policy); err != nil { + return err + } + } + return nil +} + +func (s *nomadSnapshot) persistACLTokens(sink raft.SnapshotSink, + encoder *codec.Encoder) error { + // Get all the policies + ws := memdb.NewWatchSet() + tokens, err := s.snap.ACLTokens(ws) + if err != nil { + return err + } + + for { + // Get the next item + raw := tokens.Next() + if raw == nil { + break + } + + // Prepare the request struct + token := raw.(*structs.ACLToken) + + // Write out a token registration + sink.Write([]byte{byte(ACLTokenSnapshot)}) + if err := encoder.Encode(token); err != nil { + return err + } + } + return nil +} + // Release is a no-op, as we just need to GC the pointer // to the state store snapshot. There is nothing to explicitly // cleanup. diff --git a/nomad/fsm_test.go b/nomad/fsm_test.go index b5e60a5e5..e872ce2df 100644 --- a/nomad/fsm_test.go +++ b/nomad/fsm_test.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/nomad/testutil" "github.com/hashicorp/raft" "github.com/kr/pretty" + "github.com/stretchr/testify/assert" ) type MockSink struct { @@ -1517,6 +1518,136 @@ func TestFSM_DeleteDeployment(t *testing.T) { } } +func TestFSM_UpsertACLPolicies(t *testing.T) { + t.Parallel() + fsm := testFSM(t) + + policy := mock.ACLPolicy() + req := structs.ACLPolicyUpsertRequest{ + Policies: []*structs.ACLPolicy{policy}, + } + buf, err := structs.Encode(structs.ACLPolicyUpsertRequestType, req) + if err != nil { + t.Fatalf("err: %v", err) + } + + resp := fsm.Apply(makeLog(buf)) + if resp != nil { + t.Fatalf("resp: %v", resp) + } + + // Verify we are registered + ws := memdb.NewWatchSet() + out, err := fsm.State().ACLPolicyByName(ws, policy.Name) + assert.Nil(t, err) + assert.NotNil(t, out) +} + +func TestFSM_DeleteACLPolicies(t *testing.T) { + t.Parallel() + fsm := testFSM(t) + + policy := mock.ACLPolicy() + err := fsm.State().UpsertACLPolicies(1000, []*structs.ACLPolicy{policy}) + assert.Nil(t, err) + + req := structs.ACLPolicyDeleteRequest{ + Names: []string{policy.Name}, + } + buf, err := structs.Encode(structs.ACLPolicyDeleteRequestType, req) + if err != nil { + t.Fatalf("err: %v", err) + } + + resp := fsm.Apply(makeLog(buf)) + if resp != nil { + t.Fatalf("resp: %v", resp) + } + + // Verify we are NOT registered + ws := memdb.NewWatchSet() + out, err := fsm.State().ACLPolicyByName(ws, policy.Name) + assert.Nil(t, err) + assert.Nil(t, out) +} + +func TestFSM_BootstrapACLTokens(t *testing.T) { + t.Parallel() + fsm := testFSM(t) + + token := mock.ACLToken() + req := structs.ACLTokenBootstrapRequest{ + Token: token, + } + buf, err := structs.Encode(structs.ACLTokenBootstrapRequestType, req) + if err != nil { + t.Fatalf("err: %v", err) + } + + resp := fsm.Apply(makeLog(buf)) + if resp != nil { + t.Fatalf("resp: %v", resp) + } + + // Verify we are registered + out, err := fsm.State().ACLTokenByAccessorID(nil, token.AccessorID) + assert.Nil(t, err) + assert.NotNil(t, out) +} + +func TestFSM_UpsertACLTokens(t *testing.T) { + t.Parallel() + fsm := testFSM(t) + + token := mock.ACLToken() + req := structs.ACLTokenUpsertRequest{ + Tokens: []*structs.ACLToken{token}, + } + buf, err := structs.Encode(structs.ACLTokenUpsertRequestType, req) + if err != nil { + t.Fatalf("err: %v", err) + } + + resp := fsm.Apply(makeLog(buf)) + if resp != nil { + t.Fatalf("resp: %v", resp) + } + + // Verify we are registered + ws := memdb.NewWatchSet() + out, err := fsm.State().ACLTokenByAccessorID(ws, token.AccessorID) + assert.Nil(t, err) + assert.NotNil(t, out) +} + +func TestFSM_DeleteACLTokens(t *testing.T) { + t.Parallel() + fsm := testFSM(t) + + token := mock.ACLToken() + err := fsm.State().UpsertACLTokens(1000, []*structs.ACLToken{token}) + assert.Nil(t, err) + + req := structs.ACLTokenDeleteRequest{ + AccessorIDs: []string{token.AccessorID}, + } + buf, err := structs.Encode(structs.ACLTokenDeleteRequestType, req) + if err != nil { + t.Fatalf("err: %v", err) + } + + resp := fsm.Apply(makeLog(buf)) + if resp != nil { + t.Fatalf("resp: %v", resp) + } + + // Verify we are NOT registered + ws := memdb.NewWatchSet() + out, err := fsm.State().ACLTokenByAccessorID(ws, token.AccessorID) + assert.Nil(t, err) + assert.Nil(t, out) +} + func testSnapshotRestore(t *testing.T, fsm *nomadFSM) *nomadFSM { // Snapshot snap, err := fsm.Snapshot() @@ -1858,6 +1989,44 @@ func TestFSM_SnapshotRestore_Deployments(t *testing.T) { } } +func TestFSM_SnapshotRestore_ACLPolicy(t *testing.T) { + t.Parallel() + // Add some state + fsm := testFSM(t) + state := fsm.State() + p1 := mock.ACLPolicy() + p2 := mock.ACLPolicy() + state.UpsertACLPolicies(1000, []*structs.ACLPolicy{p1, p2}) + + // Verify the contents + fsm2 := testSnapshotRestore(t, fsm) + state2 := fsm2.State() + ws := memdb.NewWatchSet() + out1, _ := state2.ACLPolicyByName(ws, p1.Name) + out2, _ := state2.ACLPolicyByName(ws, p2.Name) + assert.Equal(t, p1, out1) + assert.Equal(t, p2, out2) +} + +func TestFSM_SnapshotRestore_ACLTokens(t *testing.T) { + t.Parallel() + // Add some state + fsm := testFSM(t) + state := fsm.State() + tk1 := mock.ACLToken() + tk2 := mock.ACLToken() + state.UpsertACLTokens(1000, []*structs.ACLToken{tk1, tk2}) + + // Verify the contents + fsm2 := testSnapshotRestore(t, fsm) + state2 := fsm2.State() + ws := memdb.NewWatchSet() + out1, _ := state2.ACLTokenByAccessorID(ws, tk1.AccessorID) + out2, _ := state2.ACLTokenByAccessorID(ws, tk2.AccessorID) + assert.Equal(t, tk1, out1) + assert.Equal(t, tk2, out2) +} + func TestFSM_SnapshotRestore_AddMissingSummary(t *testing.T) { t.Parallel() // Add some state diff --git a/nomad/job_endpoint.go b/nomad/job_endpoint.go index b37ea308d..281d1f516 100644 --- a/nomad/job_endpoint.go +++ b/nomad/job_endpoint.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/consul/lib" "github.com/hashicorp/go-memdb" "github.com/hashicorp/go-multierror" + "github.com/hashicorp/nomad/acl" "github.com/hashicorp/nomad/client/driver" "github.com/hashicorp/nomad/helper" "github.com/hashicorp/nomad/nomad/state" @@ -71,6 +72,13 @@ func (j *Job) Register(args *structs.JobRegisterRequest, reply *structs.JobRegis // Set the warning message reply.Warnings = structs.MergeMultierrorWarnings(warnings, canonicalizeWarnings) + // Check job submission permissions + if aclObj, err := j.srv.resolveToken(args.SecretID); err != nil { + return err + } else if aclObj != nil && !aclObj.AllowNamespaceOperation(structs.DefaultNamespace, acl.NamespaceCapabilitySubmitJob) { + return structs.ErrPermissionDenied + } + // Lookup the job snap, err := j.srv.fsm.State().Snapshot() if err != nil { diff --git a/nomad/job_endpoint_test.go b/nomad/job_endpoint_test.go index d92d8629e..add802001 100644 --- a/nomad/job_endpoint_test.go +++ b/nomad/job_endpoint_test.go @@ -93,6 +93,49 @@ func TestJobEndpoint_Register(t *testing.T) { } } +func TestJobEndpoint_Register_ACL(t *testing.T) { + t.Parallel() + s1, root := testACLServer(t, func(c *Config) { + c.NumSchedulers = 0 // Prevent automatic dequeue + }) + defer s1.Shutdown() + codec := rpcClient(t, s1) + testutil.WaitForLeader(t, s1.RPC) + + // Create the register request + job := mock.Job() + req := &structs.JobRegisterRequest{ + Job: job, + WriteRequest: structs.WriteRequest{Region: "global"}, + } + + // Try without a token, expect failure + var resp structs.JobRegisterResponse + if err := msgpackrpc.CallWithCodec(codec, "Job.Register", req, &resp); err == nil { + t.Fatalf("expected error") + } + + // Try with a token + req.SecretID = root.SecretID + if err := msgpackrpc.CallWithCodec(codec, "Job.Register", req, &resp); err != nil { + t.Fatalf("err: %v", err) + } + if resp.Index == 0 { + t.Fatalf("bad index: %d", resp.Index) + } + + // Check for the node in the FSM + state := s1.fsm.State() + ws := memdb.NewWatchSet() + out, err := state.JobByID(ws, job.ID) + if err != nil { + t.Fatalf("err: %v", err) + } + if out == nil { + t.Fatalf("expected job") + } +} + func TestJobEndpoint_Register_InvalidDriverConfig(t *testing.T) { t.Parallel() s1 := testServer(t, func(c *Config) { diff --git a/nomad/leader.go b/nomad/leader.go index 75211d0d8..d35743a6f 100644 --- a/nomad/leader.go +++ b/nomad/leader.go @@ -1,6 +1,7 @@ package nomad import ( + "bytes" "context" "errors" "fmt" @@ -8,8 +9,11 @@ import ( "net" "time" + "golang.org/x/time/rate" + "github.com/armon/go-metrics" memdb "github.com/hashicorp/go-memdb" + "github.com/hashicorp/nomad/nomad/state" "github.com/hashicorp/nomad/nomad/structs" "github.com/hashicorp/raft" "github.com/hashicorp/serf/serf" @@ -20,6 +24,10 @@ const ( // unblocked to re-enter the scheduler. A failed evaluation occurs under // high contention when the schedulers plan does not make progress. failedEvalUnblockInterval = 1 * time.Minute + + // replicationRateLimit is used to rate limit how often data is replicated + // between the authoritative region and the local region + replicationRateLimit rate.Limit = 10.0 ) // monitorLeadership is used to monitor if we acquire or lose our role @@ -188,6 +196,13 @@ func (s *Server) establishLeadership(stopCh chan struct{}) error { if err := s.reconcileJobSummaries(); err != nil { return fmt.Errorf("unable to reconcile job summaries: %v", err) } + + // Start replication of ACLs and Policies if they are enabled, + // and we are not the authoritative region. + if s.config.ACLEnabled && s.config.Region != s.config.AuthoritativeRegion { + go s.replicateACLPolicies(stopCh) + go s.replicateACLTokens(stopCh) + } return nil } @@ -654,3 +669,286 @@ REMOVE: } return nil } + +// replicateACLPolicies is used to replicate ACL policies from +// the authoritative region to this region. +func (s *Server) replicateACLPolicies(stopCh chan struct{}) { + req := structs.ACLPolicyListRequest{ + QueryOptions: structs.QueryOptions{ + Region: s.config.AuthoritativeRegion, + AllowStale: true, + }, + } + limiter := rate.NewLimiter(replicationRateLimit, int(replicationRateLimit)) + s.logger.Printf("[DEBUG] nomad: starting ACL policy replication from authoritative region %q", req.Region) + +START: + for { + select { + case <-stopCh: + return + default: + // Rate limit how often we attempt replication + limiter.Wait(context.Background()) + + // Fetch the list of policies + var resp structs.ACLPolicyListResponse + req.SecretID = s.ReplicationToken() + err := s.forwardRegion(s.config.AuthoritativeRegion, + "ACL.ListPolicies", &req, &resp) + if err != nil { + s.logger.Printf("[ERR] nomad: failed to fetch policies from authoritative region: %v", err) + goto ERR_WAIT + } + + // Perform a two-way diff + delete, update := diffACLPolicies(s.State(), req.MinQueryIndex, resp.Policies) + + // Delete policies that should not exist + if len(delete) > 0 { + args := &structs.ACLPolicyDeleteRequest{ + Names: delete, + } + _, _, err := s.raftApply(structs.ACLPolicyDeleteRequestType, args) + if err != nil { + s.logger.Printf("[ERR] nomad: failed to delete policies: %v", err) + goto ERR_WAIT + } + } + + // Fetch any outdated policies + var fetched []*structs.ACLPolicy + if len(update) > 0 { + req := structs.ACLPolicySetRequest{ + Names: update, + QueryOptions: structs.QueryOptions{ + Region: s.config.AuthoritativeRegion, + SecretID: s.ReplicationToken(), + AllowStale: true, + MinQueryIndex: resp.Index - 1, + }, + } + var reply structs.ACLPolicySetResponse + if err := s.forwardRegion(s.config.AuthoritativeRegion, + "ACL.GetPolicies", &req, &reply); err != nil { + s.logger.Printf("[ERR] nomad: failed to fetch policies from authoritative region: %v", err) + goto ERR_WAIT + } + for _, policy := range reply.Policies { + fetched = append(fetched, policy) + } + } + + // Update local policies + if len(fetched) > 0 { + args := &structs.ACLPolicyUpsertRequest{ + Policies: fetched, + } + _, _, err := s.raftApply(structs.ACLPolicyUpsertRequestType, args) + if err != nil { + s.logger.Printf("[ERR] nomad: failed to update policies: %v", err) + goto ERR_WAIT + } + } + + // Update the minimum query index, blocks until there + // is a change. + req.MinQueryIndex = resp.Index + } + } + +ERR_WAIT: + select { + case <-time.After(s.config.ReplicationBackoff): + goto START + case <-stopCh: + return + } +} + +// diffACLPolicies is used to perform a two-way diff between the local +// policies and the remote policies to determine which policies need to +// be deleted or updated. +func diffACLPolicies(state *state.StateStore, minIndex uint64, remoteList []*structs.ACLPolicyListStub) (delete []string, update []string) { + // Construct a set of the local and remote policies + local := make(map[string][]byte) + remote := make(map[string]struct{}) + + // Add all the local policies + iter, err := state.ACLPolicies(nil) + if err != nil { + panic("failed to iterate local policies") + } + for { + raw := iter.Next() + if raw == nil { + break + } + policy := raw.(*structs.ACLPolicy) + local[policy.Name] = policy.Hash + } + + // Iterate over the remote policies + for _, rp := range remoteList { + remote[rp.Name] = struct{}{} + + // Check if the policy is missing locally + if localHash, ok := local[rp.Name]; !ok { + update = append(update, rp.Name) + + // Check if policy is newer remotely and there is a hash mis-match. + } else if rp.ModifyIndex > minIndex && !bytes.Equal(localHash, rp.Hash) { + update = append(update, rp.Name) + } + } + + // Check if policy should be deleted + for lp := range local { + if _, ok := remote[lp]; !ok { + delete = append(delete, lp) + } + } + return +} + +// replicateACLTokens is used to replicate global ACL tokens from +// the authoritative region to this region. +func (s *Server) replicateACLTokens(stopCh chan struct{}) { + req := structs.ACLTokenListRequest{ + GlobalOnly: true, + QueryOptions: structs.QueryOptions{ + Region: s.config.AuthoritativeRegion, + AllowStale: true, + }, + } + limiter := rate.NewLimiter(replicationRateLimit, int(replicationRateLimit)) + s.logger.Printf("[DEBUG] nomad: starting ACL token replication from authoritative region %q", req.Region) + +START: + for { + select { + case <-stopCh: + return + default: + // Rate limit how often we attempt replication + limiter.Wait(context.Background()) + + // Fetch the list of tokens + var resp structs.ACLTokenListResponse + req.SecretID = s.ReplicationToken() + err := s.forwardRegion(s.config.AuthoritativeRegion, + "ACL.ListTokens", &req, &resp) + if err != nil { + s.logger.Printf("[ERR] nomad: failed to fetch tokens from authoritative region: %v", err) + goto ERR_WAIT + } + + // Perform a two-way diff + delete, update := diffACLTokens(s.State(), req.MinQueryIndex, resp.Tokens) + + // Delete tokens that should not exist + if len(delete) > 0 { + args := &structs.ACLTokenDeleteRequest{ + AccessorIDs: delete, + } + _, _, err := s.raftApply(structs.ACLTokenDeleteRequestType, args) + if err != nil { + s.logger.Printf("[ERR] nomad: failed to delete tokens: %v", err) + goto ERR_WAIT + } + } + + // Fetch any outdated policies. + var fetched []*structs.ACLToken + if len(update) > 0 { + req := structs.ACLTokenSetRequest{ + AccessorIDS: update, + QueryOptions: structs.QueryOptions{ + Region: s.config.AuthoritativeRegion, + SecretID: s.ReplicationToken(), + AllowStale: true, + MinQueryIndex: resp.Index - 1, + }, + } + var reply structs.ACLTokenSetResponse + if err := s.forwardRegion(s.config.AuthoritativeRegion, + "ACL.GetTokens", &req, &reply); err != nil { + s.logger.Printf("[ERR] nomad: failed to fetch tokens from authoritative region: %v", err) + goto ERR_WAIT + } + for _, token := range reply.Tokens { + fetched = append(fetched, token) + } + } + + // Update local tokens + if len(fetched) > 0 { + args := &structs.ACLTokenUpsertRequest{ + Tokens: fetched, + } + _, _, err := s.raftApply(structs.ACLTokenUpsertRequestType, args) + if err != nil { + s.logger.Printf("[ERR] nomad: failed to update tokens: %v", err) + goto ERR_WAIT + } + } + + // Update the minimum query index, blocks until there + // is a change. + req.MinQueryIndex = resp.Index + } + } + +ERR_WAIT: + select { + case <-time.After(s.config.ReplicationBackoff): + goto START + case <-stopCh: + return + } +} + +// diffACLTokens is used to perform a two-way diff between the local +// tokens and the remote tokens to determine which tokens need to +// be deleted or updated. +func diffACLTokens(state *state.StateStore, minIndex uint64, remoteList []*structs.ACLTokenListStub) (delete []string, update []string) { + // Construct a set of the local and remote policies + local := make(map[string][]byte) + remote := make(map[string]struct{}) + + // Add all the local global tokens + iter, err := state.ACLTokensByGlobal(nil, true) + if err != nil { + panic("failed to iterate local tokens") + } + for { + raw := iter.Next() + if raw == nil { + break + } + token := raw.(*structs.ACLToken) + local[token.AccessorID] = token.Hash + } + + // Iterate over the remote tokens + for _, rp := range remoteList { + remote[rp.AccessorID] = struct{}{} + + // Check if the token is missing locally + if localHash, ok := local[rp.AccessorID]; !ok { + update = append(update, rp.AccessorID) + + // Check if policy is newer remotely and there is a hash mis-match. + } else if rp.ModifyIndex > minIndex && !bytes.Equal(localHash, rp.Hash) { + update = append(update, rp.AccessorID) + } + } + + // Check if local token should be deleted + for lp := range local { + if _, ok := remote[lp]; !ok { + delete = append(delete, lp) + } + } + return +} diff --git a/nomad/leader_test.go b/nomad/leader_test.go index 4fc8cb06d..8b3381d56 100644 --- a/nomad/leader_test.go +++ b/nomad/leader_test.go @@ -3,13 +3,16 @@ package nomad import ( "errors" "fmt" + "os" "testing" "time" memdb "github.com/hashicorp/go-memdb" "github.com/hashicorp/nomad/nomad/mock" + "github.com/hashicorp/nomad/nomad/state" "github.com/hashicorp/nomad/nomad/structs" "github.com/hashicorp/nomad/testutil" + "github.com/stretchr/testify/assert" ) func TestLeader_LeftServer(t *testing.T) { @@ -623,3 +626,154 @@ func TestLeader_RestoreVaultAccessors(t *testing.T) { t.Fatalf("Bad revoked accessors: %v", tvc.RevokedTokens) } } + +func TestLeader_ReplicateACLPolicies(t *testing.T) { + t.Parallel() + s1, root := testACLServer(t, func(c *Config) { + c.Region = "region1" + c.AuthoritativeRegion = "region1" + c.ACLEnabled = true + }) + defer s1.Shutdown() + s2, _ := testACLServer(t, func(c *Config) { + c.Region = "region2" + c.AuthoritativeRegion = "region1" + c.ACLEnabled = true + c.ReplicationBackoff = 20 * time.Millisecond + c.ReplicationToken = root.SecretID + }) + defer s2.Shutdown() + testJoin(t, s1, s2) + testutil.WaitForLeader(t, s1.RPC) + testutil.WaitForLeader(t, s2.RPC) + + // Write a policy to the authoritative region + p1 := mock.ACLPolicy() + if err := s1.State().UpsertACLPolicies(100, []*structs.ACLPolicy{p1}); err != nil { + t.Fatalf("bad: %v", err) + } + + // Wait for the policy to replicate + testutil.WaitForResult(func() (bool, error) { + state := s2.State() + out, err := state.ACLPolicyByName(nil, p1.Name) + return out != nil, err + }, func(err error) { + t.Fatalf("should replicate policy") + }) +} + +func TestLeader_DiffACLPolicies(t *testing.T) { + t.Parallel() + + state, err := state.NewStateStore(os.Stderr) + if err != nil { + t.Fatalf("err: %v", err) + } + + // Populate the local state + p1 := mock.ACLPolicy() + p2 := mock.ACLPolicy() + p3 := mock.ACLPolicy() + err = state.UpsertACLPolicies(100, []*structs.ACLPolicy{p1, p2, p3}) + assert.Nil(t, err) + + // Simulate a remote list + p2Stub := p2.Stub() + p2Stub.ModifyIndex = 50 // Ignored, same index + p3Stub := p3.Stub() + p3Stub.ModifyIndex = 100 // Updated, higher index + p3Stub.Hash = []byte{0, 1, 2, 3} + p4 := mock.ACLPolicy() + remoteList := []*structs.ACLPolicyListStub{ + p2Stub, + p3Stub, + p4.Stub(), + } + delete, update := diffACLPolicies(state, 50, remoteList) + + // P1 does not exist on the remote side, should delete + assert.Equal(t, []string{p1.Name}, delete) + + // P2 is un-modified - ignore. P3 modified, P4 new. + assert.Equal(t, []string{p3.Name, p4.Name}, update) +} + +func TestLeader_ReplicateACLTokens(t *testing.T) { + t.Parallel() + s1, root := testACLServer(t, func(c *Config) { + c.Region = "region1" + c.AuthoritativeRegion = "region1" + c.ACLEnabled = true + }) + defer s1.Shutdown() + s2, _ := testACLServer(t, func(c *Config) { + c.Region = "region2" + c.AuthoritativeRegion = "region1" + c.ACLEnabled = true + c.ReplicationBackoff = 20 * time.Millisecond + c.ReplicationToken = root.SecretID + }) + defer s2.Shutdown() + testJoin(t, s1, s2) + testutil.WaitForLeader(t, s1.RPC) + testutil.WaitForLeader(t, s2.RPC) + + // Write a token to the authoritative region + p1 := mock.ACLToken() + p1.Global = true + if err := s1.State().UpsertACLTokens(100, []*structs.ACLToken{p1}); err != nil { + t.Fatalf("bad: %v", err) + } + + // Wait for the token to replicate + testutil.WaitForResult(func() (bool, error) { + state := s2.State() + out, err := state.ACLTokenByAccessorID(nil, p1.AccessorID) + return out != nil, err + }, func(err error) { + t.Fatalf("should replicate token") + }) +} + +func TestLeader_DiffACLTokens(t *testing.T) { + t.Parallel() + + state, err := state.NewStateStore(os.Stderr) + if err != nil { + t.Fatalf("err: %v", err) + } + + // Populate the local state + p0 := mock.ACLToken() + p1 := mock.ACLToken() + p1.Global = true + p2 := mock.ACLToken() + p2.Global = true + p3 := mock.ACLToken() + p3.Global = true + err = state.UpsertACLTokens(100, []*structs.ACLToken{p0, p1, p2, p3}) + assert.Nil(t, err) + + // Simulate a remote list + p2Stub := p2.Stub() + p2Stub.ModifyIndex = 50 // Ignored, same index + p3Stub := p3.Stub() + p3Stub.ModifyIndex = 100 // Updated, higher index + p3Stub.Hash = []byte{0, 1, 2, 3} + p4 := mock.ACLToken() + p4.Global = true + remoteList := []*structs.ACLTokenListStub{ + p2Stub, + p3Stub, + p4.Stub(), + } + delete, update := diffACLTokens(state, 50, remoteList) + + // P0 is local and should be ignored + // P1 does not exist on the remote side, should delete + assert.Equal(t, []string{p1.AccessorID}, delete) + + // P2 is un-modified - ignore. P3 modified, P4 new. + assert.Equal(t, []string{p3.AccessorID, p4.AccessorID}, update) +} diff --git a/nomad/mock/mock.go b/nomad/mock/mock.go index 883b3e4de..115021e96 100644 --- a/nomad/mock/mock.go +++ b/nomad/mock/mock.go @@ -1,6 +1,7 @@ package mock import ( + "fmt" "time" "github.com/hashicorp/nomad/nomad/structs" @@ -336,3 +337,54 @@ func Plan() *structs.Plan { func PlanResult() *structs.PlanResult { return &structs.PlanResult{} } + +func ACLPolicy() *structs.ACLPolicy { + ap := &structs.ACLPolicy{ + Name: fmt.Sprintf("policy-%s", structs.GenerateUUID()), + Description: "Super cool policy!", + Rules: ` + namespace "default" { + policy = "write" + } + node { + policy = "read" + } + agent { + policy = "read" + } + `, + CreateIndex: 10, + ModifyIndex: 20, + } + ap.SetHash() + return ap +} + +func ACLToken() *structs.ACLToken { + tk := &structs.ACLToken{ + AccessorID: structs.GenerateUUID(), + SecretID: structs.GenerateUUID(), + Name: "my cool token " + structs.GenerateUUID(), + Type: "client", + Policies: []string{"foo", "bar"}, + Global: false, + CreateTime: time.Now().UTC(), + CreateIndex: 10, + ModifyIndex: 20, + } + tk.SetHash() + return tk +} + +func ACLManagementToken() *structs.ACLToken { + return &structs.ACLToken{ + AccessorID: structs.GenerateUUID(), + SecretID: structs.GenerateUUID(), + Name: "management " + structs.GenerateUUID(), + Type: "management", + Global: true, + CreateTime: time.Now().UTC(), + CreateIndex: 10, + ModifyIndex: 20, + } +} diff --git a/nomad/server.go b/nomad/server.go index 0a0806590..0455fe1d0 100644 --- a/nomad/server.go +++ b/nomad/server.go @@ -20,6 +20,7 @@ import ( consulapi "github.com/hashicorp/consul/api" "github.com/hashicorp/consul/lib" "github.com/hashicorp/go-multierror" + lru "github.com/hashicorp/golang-lru" "github.com/hashicorp/nomad/command/agent/consul" "github.com/hashicorp/nomad/helper/tlsutil" "github.com/hashicorp/nomad/nomad/deploymentwatcher" @@ -72,6 +73,10 @@ const ( // defaultConsulDiscoveryIntervalRetry is how often to poll Consul for // new servers if there is no leader and the last Consul query failed. defaultConsulDiscoveryIntervalRetry time.Duration = 9 * time.Second + + // aclCacheSize is the number of ACL objects to keep cached. ACLs have a parsing and + // construction cost, so we keep the hot objects cached to reduce the ACL token resolution time. + aclCacheSize = 512 ) // Server is Nomad server which manages the job queues, @@ -158,6 +163,9 @@ type Server struct { // Worker used for processing workers []*Worker + // aclCache is used to maintain the parsed ACL objects + aclCache *lru.TwoQueueCache + left bool shutdown bool shutdownCh chan struct{} @@ -178,6 +186,7 @@ type endpoints struct { Periodic *Periodic System *System Operator *Operator + ACL *ACL } // NewServer is used to construct a new Nomad server from the @@ -225,6 +234,12 @@ func NewServer(config *Config, consulCatalog consul.CatalogAPI, logger *log.Logg incomingTLS = itls } + // Create the ACL object cache + aclCache, err := lru.New2Q(aclCacheSize) + if err != nil { + return nil, err + } + // Create the server s := &Server{ config: config, @@ -240,6 +255,7 @@ func NewServer(config *Config, consulCatalog consul.CatalogAPI, logger *log.Logg blockedEvals: blockedEvals, planQueue: planQueue, rpcTLS: incomingTLS, + aclCache: aclCache, shutdownCh: make(chan struct{}), } @@ -707,6 +723,7 @@ func (s *Server) setupVaultClient() error { // setupRPC is used to setup the RPC listener func (s *Server) setupRPC(tlsWrap tlsutil.RegionWrapper) error { // Create endpoints + s.endpoints.ACL = &ACL{s} s.endpoints.Alloc = &Alloc{s} s.endpoints.Eval = &Eval{s} s.endpoints.Job = &Job{s} @@ -721,6 +738,7 @@ func (s *Server) setupRPC(tlsWrap tlsutil.RegionWrapper) error { s.endpoints.Search = &Search{s} // Register the handlers + s.rpcServer.Register(s.endpoints.ACL) s.rpcServer.Register(s.endpoints.Alloc) s.rpcServer.Register(s.endpoints.Eval) s.rpcServer.Register(s.endpoints.Job) @@ -1129,6 +1147,12 @@ func (s *Server) GetConfig() *Config { return s.config } +// ReplicationToken returns the token used for replication. We use a method to support +// dynamic reloading of this value later. +func (s *Server) ReplicationToken() string { + return s.config.ReplicationToken +} + // peersInfoContent is used to help operators understand what happened to the // peers.json file. This is written to a file called peers.info in the same // location. diff --git a/nomad/server_test.go b/nomad/server_test.go index 56726e2a4..70f809260 100644 --- a/nomad/server_test.go +++ b/nomad/server_test.go @@ -13,6 +13,7 @@ import ( "time" "github.com/hashicorp/nomad/command/agent/consul" + "github.com/hashicorp/nomad/nomad/mock" "github.com/hashicorp/nomad/nomad/structs" "github.com/hashicorp/nomad/nomad/structs/config" "github.com/hashicorp/nomad/testutil" @@ -38,6 +39,21 @@ func tmpDir(t *testing.T) string { return dir } +func testACLServer(t *testing.T, cb func(*Config)) (*Server, *structs.ACLToken) { + server := testServer(t, func(c *Config) { + c.ACLEnabled = true + if cb != nil { + cb(c) + } + }) + token := mock.ACLManagementToken() + err := server.State().BootstrapACLTokens(1, token) + if err != nil { + t.Fatalf("failed to bootstrap ACL token: %v", err) + } + return server, token +} + func testServer(t *testing.T, cb func(*Config)) *Server { // Setup the default settings config := DefaultConfig() diff --git a/nomad/state/schema.go b/nomad/state/schema.go index 6d9675c86..89b71f212 100644 --- a/nomad/state/schema.go +++ b/nomad/state/schema.go @@ -26,6 +26,8 @@ func stateStoreSchema() *memdb.DBSchema { evalTableSchema, allocTableSchema, vaultAccessorTableSchema, + aclPolicyTableSchema, + aclTokenTableSchema, } // Add each of the tables @@ -430,3 +432,55 @@ func vaultAccessorTableSchema() *memdb.TableSchema { }, } } + +// aclPolicyTableSchema returns the MemDB schema for the policy table. +// This table is used to store the policies which are refrenced by tokens +func aclPolicyTableSchema() *memdb.TableSchema { + return &memdb.TableSchema{ + Name: "acl_policy", + Indexes: map[string]*memdb.IndexSchema{ + "id": &memdb.IndexSchema{ + Name: "id", + AllowMissing: false, + Unique: true, + Indexer: &memdb.StringFieldIndex{ + Field: "Name", + }, + }, + }, + } +} + +// aclTokenTableSchema returns the MemDB schema for the tokens table. +// This table is used to store the bearer tokens which are used to authenticate +func aclTokenTableSchema() *memdb.TableSchema { + return &memdb.TableSchema{ + Name: "acl_token", + Indexes: map[string]*memdb.IndexSchema{ + "id": &memdb.IndexSchema{ + Name: "id", + AllowMissing: false, + Unique: true, + Indexer: &memdb.UUIDFieldIndex{ + Field: "AccessorID", + }, + }, + "secret": &memdb.IndexSchema{ + Name: "secret", + AllowMissing: false, + Unique: true, + Indexer: &memdb.UUIDFieldIndex{ + Field: "SecretID", + }, + }, + "global": &memdb.IndexSchema{ + Name: "global", + AllowMissing: false, + Unique: false, + Indexer: &memdb.FieldSetIndex{ + Field: "Global", + }, + }, + }, + } +} diff --git a/nomad/state/state_store.go b/nomad/state/state_store.go index b1d157fff..1005571cf 100644 --- a/nomad/state/state_store.go +++ b/nomad/state/state_store.go @@ -2788,6 +2788,286 @@ func (s *StateStore) addEphemeralDiskToTaskGroups(job *structs.Job) { } } +// UpsertACLPolicies is used to create or update a set of ACL policies +func (s *StateStore) UpsertACLPolicies(index uint64, policies []*structs.ACLPolicy) error { + txn := s.db.Txn(true) + defer txn.Abort() + + for _, policy := range policies { + // Ensure the policy hash is non-nil. This should be done outside the state store + // for performance reasons, but we check here for defense in depth. + if len(policy.Hash) == 0 { + policy.SetHash() + } + + // Check if the policy already exists + existing, err := txn.First("acl_policy", "id", policy.Name) + if err != nil { + return fmt.Errorf("policy lookup failed: %v", err) + } + + // Update all the indexes + if existing != nil { + policy.CreateIndex = existing.(*structs.ACLPolicy).CreateIndex + policy.ModifyIndex = index + } else { + policy.CreateIndex = index + policy.ModifyIndex = index + } + + // Update the policy + if err := txn.Insert("acl_policy", policy); err != nil { + return fmt.Errorf("upserting policy failed: %v", err) + } + } + + // Update the indexes tabl + if err := txn.Insert("index", &IndexEntry{"acl_policy", index}); err != nil { + return fmt.Errorf("index update failed: %v", err) + } + + txn.Commit() + return nil +} + +// DeleteACLPolicies deletes the policies with the given names +func (s *StateStore) DeleteACLPolicies(index uint64, names []string) error { + txn := s.db.Txn(true) + defer txn.Abort() + + // Delete the policy + for _, name := range names { + if _, err := txn.DeleteAll("acl_policy", "id", name); err != nil { + return fmt.Errorf("deleting acl policy failed: %v", err) + } + } + if err := txn.Insert("index", &IndexEntry{"acl_policy", index}); err != nil { + return fmt.Errorf("index update failed: %v", err) + } + txn.Commit() + return nil +} + +// ACLPolicyByName is used to lookup a policy by name +func (s *StateStore) ACLPolicyByName(ws memdb.WatchSet, name string) (*structs.ACLPolicy, error) { + txn := s.db.Txn(false) + + watchCh, existing, err := txn.FirstWatch("acl_policy", "id", name) + if err != nil { + return nil, fmt.Errorf("acl policy lookup failed: %v", err) + } + ws.Add(watchCh) + + if existing != nil { + return existing.(*structs.ACLPolicy), nil + } + return nil, nil +} + +// ACLPolicyByNamePrefix is used to lookup policies by prefix +func (s *StateStore) ACLPolicyByNamePrefix(ws memdb.WatchSet, prefix string) (memdb.ResultIterator, error) { + txn := s.db.Txn(false) + + iter, err := txn.Get("acl_policy", "id_prefix", prefix) + if err != nil { + return nil, fmt.Errorf("acl policy lookup failed: %v", err) + } + ws.Add(iter.WatchCh()) + + return iter, nil +} + +// ACLPolicies returns an iterator over all the acl policies +func (s *StateStore) ACLPolicies(ws memdb.WatchSet) (memdb.ResultIterator, error) { + txn := s.db.Txn(false) + + // Walk the entire table + iter, err := txn.Get("acl_policy", "id") + if err != nil { + return nil, err + } + ws.Add(iter.WatchCh()) + return iter, nil +} + +// UpsertACLTokens is used to create or update a set of ACL tokens +func (s *StateStore) UpsertACLTokens(index uint64, tokens []*structs.ACLToken) error { + txn := s.db.Txn(true) + defer txn.Abort() + + for _, token := range tokens { + // Ensure the policy hash is non-nil. This should be done outside the state store + // for performance reasons, but we check here for defense in depth. + if len(token.Hash) == 0 { + token.SetHash() + } + + // Check if the token already exists + existing, err := txn.First("acl_token", "id", token.AccessorID) + if err != nil { + return fmt.Errorf("token lookup failed: %v", err) + } + + // Update all the indexes + if existing != nil { + existTK := existing.(*structs.ACLToken) + token.CreateIndex = existTK.CreateIndex + token.ModifyIndex = index + + // Do not allow SecretID or create time to change + token.SecretID = existTK.SecretID + token.CreateTime = existTK.CreateTime + + } else { + token.CreateIndex = index + token.ModifyIndex = index + } + + // Update the token + if err := txn.Insert("acl_token", token); err != nil { + return fmt.Errorf("upserting token failed: %v", err) + } + } + + // Update the indexes table + if err := txn.Insert("index", &IndexEntry{"acl_token", index}); err != nil { + return fmt.Errorf("index update failed: %v", err) + } + txn.Commit() + return nil +} + +// DeleteACLTokens deletes the tokens with the given accessor ids +func (s *StateStore) DeleteACLTokens(index uint64, ids []string) error { + txn := s.db.Txn(true) + defer txn.Abort() + + // Delete the tokens + for _, id := range ids { + if _, err := txn.DeleteAll("acl_token", "id", id); err != nil { + return fmt.Errorf("deleting acl token failed: %v", err) + } + } + if err := txn.Insert("index", &IndexEntry{"acl_token", index}); err != nil { + return fmt.Errorf("index update failed: %v", err) + } + txn.Commit() + return nil +} + +// ACLTokenByAccessorID is used to lookup a token by accessor ID +func (s *StateStore) ACLTokenByAccessorID(ws memdb.WatchSet, id string) (*structs.ACLToken, error) { + txn := s.db.Txn(false) + + watchCh, existing, err := txn.FirstWatch("acl_token", "id", id) + if err != nil { + return nil, fmt.Errorf("acl token lookup failed: %v", err) + } + ws.Add(watchCh) + + if existing != nil { + return existing.(*structs.ACLToken), nil + } + return nil, nil +} + +// ACLTokenBySecretID is used to lookup a token by secret ID +func (s *StateStore) ACLTokenBySecretID(ws memdb.WatchSet, secretID string) (*structs.ACLToken, error) { + txn := s.db.Txn(false) + + watchCh, existing, err := txn.FirstWatch("acl_token", "secret", secretID) + if err != nil { + return nil, fmt.Errorf("acl token lookup failed: %v", err) + } + ws.Add(watchCh) + + if existing != nil { + return existing.(*structs.ACLToken), nil + } + return nil, nil +} + +// ACLTokenByAccessorIDPrefix is used to lookup tokens by prefix +func (s *StateStore) ACLTokenByAccessorIDPrefix(ws memdb.WatchSet, prefix string) (memdb.ResultIterator, error) { + txn := s.db.Txn(false) + + iter, err := txn.Get("acl_token", "id_prefix", prefix) + if err != nil { + return nil, fmt.Errorf("acl token lookup failed: %v", err) + } + ws.Add(iter.WatchCh()) + return iter, nil +} + +// ACLTokens returns an iterator over all the tokens +func (s *StateStore) ACLTokens(ws memdb.WatchSet) (memdb.ResultIterator, error) { + txn := s.db.Txn(false) + + // Walk the entire table + iter, err := txn.Get("acl_token", "id") + if err != nil { + return nil, err + } + ws.Add(iter.WatchCh()) + return iter, nil +} + +// ACLTokensByGlobal returns an iterator over all the tokens filtered by global value +func (s *StateStore) ACLTokensByGlobal(ws memdb.WatchSet, globalVal bool) (memdb.ResultIterator, error) { + txn := s.db.Txn(false) + + // Walk the entire table + iter, err := txn.Get("acl_token", "global", globalVal) + if err != nil { + return nil, err + } + ws.Add(iter.WatchCh()) + return iter, nil +} + +// CanBootstrapACLToken checks if bootstrapping is possible +func (s *StateStore) CanBootstrapACLToken() (bool, error) { + txn := s.db.Txn(false) + + // Lookup the bootstrap sentinel + out, err := txn.First("index", "id", "acl_token_bootstrap") + return out == nil, err +} + +// BootstrapACLToken is used to create an initial ACL token +func (s *StateStore) BootstrapACLTokens(index uint64, token *structs.ACLToken) error { + txn := s.db.Txn(true) + defer txn.Abort() + + // Check if we have already done a bootstrap + existing, err := txn.First("index", "id", "acl_token_bootstrap") + if err != nil { + return fmt.Errorf("bootstrap check failed: %v", err) + } + if existing != nil { + return fmt.Errorf("ACL bootstrap already done") + } + + // Update the Create/Modify time + token.CreateIndex = index + token.ModifyIndex = index + + // Insert the token + if err := txn.Insert("acl_token", token); err != nil { + return fmt.Errorf("upserting token failed: %v", err) + } + + // Update the indexes table, prevents future bootstrap + if err := txn.Insert("index", &IndexEntry{"acl_token", index}); err != nil { + return fmt.Errorf("index update failed: %v", err) + } + if err := txn.Insert("index", &IndexEntry{"acl_token_bootstrap", index}); err != nil { + return fmt.Errorf("index update failed: %v", err) + } + txn.Commit() + return nil +} + // StateSnapshot is used to provide a point-in-time snapshot type StateSnapshot struct { StateStore @@ -2907,6 +3187,22 @@ func (r *StateRestore) VaultAccessorRestore(accessor *structs.VaultAccessor) err return nil } +// ACLPolicyRestore is used to restore an ACL policy +func (r *StateRestore) ACLPolicyRestore(policy *structs.ACLPolicy) error { + if err := r.txn.Insert("acl_policy", policy); err != nil { + return fmt.Errorf("inserting acl policy failed: %v", err) + } + return nil +} + +// ACLTokenRestore is used to restore an ACL token +func (r *StateRestore) ACLTokenRestore(token *structs.ACLToken) error { + if err := r.txn.Insert("acl_token", token); err != nil { + return fmt.Errorf("inserting acl token failed: %v", err) + } + return nil +} + // addEphemeralDiskToTaskGroups adds missing EphemeralDisk objects to TaskGroups func (r *StateRestore) addEphemeralDiskToTaskGroups(job *structs.Job) { for _, tg := range job.TaskGroups { diff --git a/nomad/state/state_store_test.go b/nomad/state/state_store_test.go index 306987367..29d6d135d 100644 --- a/nomad/state/state_store_test.go +++ b/nomad/state/state_store_test.go @@ -5825,6 +5825,501 @@ func TestStateStore_RestoreVaultAccessor(t *testing.T) { } } +func TestStateStore_UpsertACLPolicy(t *testing.T) { + state := testStateStore(t) + policy := mock.ACLPolicy() + policy2 := mock.ACLPolicy() + + ws := memdb.NewWatchSet() + if _, err := state.ACLPolicyByName(ws, policy.Name); err != nil { + t.Fatalf("err: %v", err) + } + if _, err := state.ACLPolicyByName(ws, policy2.Name); err != nil { + t.Fatalf("err: %v", err) + } + + if err := state.UpsertACLPolicies(1000, + []*structs.ACLPolicy{policy, policy2}); err != nil { + t.Fatalf("err: %v", err) + } + if !watchFired(ws) { + t.Fatalf("bad") + } + + ws = memdb.NewWatchSet() + out, err := state.ACLPolicyByName(ws, policy.Name) + assert.Equal(t, nil, err) + assert.Equal(t, policy, out) + + out, err = state.ACLPolicyByName(ws, policy2.Name) + assert.Equal(t, nil, err) + assert.Equal(t, policy2, out) + + iter, err := state.ACLPolicies(ws) + if err != nil { + t.Fatalf("err: %v", err) + } + + // Ensure we see both policies + count := 0 + for { + raw := iter.Next() + if raw == nil { + break + } + count++ + } + if count != 2 { + t.Fatalf("bad: %d", count) + } + + index, err := state.Index("acl_policy") + if err != nil { + t.Fatalf("err: %v", err) + } + if index != 1000 { + t.Fatalf("bad: %d", index) + } + + if watchFired(ws) { + t.Fatalf("bad") + } +} + +func TestStateStore_DeleteACLPolicy(t *testing.T) { + state := testStateStore(t) + policy := mock.ACLPolicy() + policy2 := mock.ACLPolicy() + + // Create the policy + if err := state.UpsertACLPolicies(1000, + []*structs.ACLPolicy{policy, policy2}); err != nil { + t.Fatalf("err: %v", err) + } + + // Create a watcher + ws := memdb.NewWatchSet() + if _, err := state.ACLPolicyByName(ws, policy.Name); err != nil { + t.Fatalf("err: %v", err) + } + + // Delete the policy + if err := state.DeleteACLPolicies(1001, + []string{policy.Name, policy2.Name}); err != nil { + t.Fatalf("err: %v", err) + } + + // Ensure watching triggered + if !watchFired(ws) { + t.Fatalf("bad") + } + + // Ensure we don't get the object back + ws = memdb.NewWatchSet() + out, err := state.ACLPolicyByName(ws, policy.Name) + assert.Equal(t, nil, err) + if out != nil { + t.Fatalf("bad: %#v", out) + } + + iter, err := state.ACLPolicies(ws) + if err != nil { + t.Fatalf("err: %v", err) + } + + // Ensure we see both policies + count := 0 + for { + raw := iter.Next() + if raw == nil { + break + } + count++ + } + if count != 0 { + t.Fatalf("bad: %d", count) + } + + index, err := state.Index("acl_policy") + if err != nil { + t.Fatalf("err: %v", err) + } + if index != 1001 { + t.Fatalf("bad: %d", index) + } + + if watchFired(ws) { + t.Fatalf("bad") + } +} + +func TestStateStore_ACLPolicyByNamePrefix(t *testing.T) { + state := testStateStore(t) + names := []string{ + "foo", + "bar", + "foobar", + "foozip", + "zip", + } + + // Create the policies + var baseIndex uint64 = 1000 + for _, name := range names { + p := mock.ACLPolicy() + p.Name = name + if err := state.UpsertACLPolicies(baseIndex, []*structs.ACLPolicy{p}); err != nil { + t.Fatalf("err: %v", err) + } + baseIndex++ + } + + // Scan by prefix + iter, err := state.ACLPolicyByNamePrefix(nil, "foo") + if err != nil { + t.Fatalf("err: %v", err) + } + + // Ensure we see both policies + count := 0 + out := []string{} + for { + raw := iter.Next() + if raw == nil { + break + } + count++ + out = append(out, raw.(*structs.ACLPolicy).Name) + } + if count != 3 { + t.Fatalf("bad: %d %v", count, out) + } + sort.Strings(out) + + expect := []string{"foo", "foobar", "foozip"} + assert.Equal(t, expect, out) +} + +func TestStateStore_BootstrapACLTokens(t *testing.T) { + state := testStateStore(t) + tk1 := mock.ACLToken() + tk2 := mock.ACLToken() + + ok, err := state.CanBootstrapACLToken() + assert.Nil(t, err) + assert.Equal(t, true, ok) + + if err := state.BootstrapACLTokens(1000, tk1); err != nil { + t.Fatalf("err: %v", err) + } + + out, err := state.ACLTokenByAccessorID(nil, tk1.AccessorID) + assert.Equal(t, nil, err) + assert.Equal(t, tk1, out) + + ok, err = state.CanBootstrapACLToken() + assert.Nil(t, err) + assert.Equal(t, false, ok) + + if err := state.BootstrapACLTokens(1001, tk2); err == nil { + t.Fatalf("expected error") + } + + iter, err := state.ACLTokens(nil) + if err != nil { + t.Fatalf("err: %v", err) + } + + // Ensure we see both policies + count := 0 + for { + raw := iter.Next() + if raw == nil { + break + } + count++ + } + if count != 1 { + t.Fatalf("bad: %d", count) + } + + index, err := state.Index("acl_token") + if err != nil { + t.Fatalf("err: %v", err) + } + if index != 1000 { + t.Fatalf("bad: %d", index) + } + index, err = state.Index("acl_token_bootstrap") + if err != nil { + t.Fatalf("err: %v", err) + } + if index != 1000 { + t.Fatalf("bad: %d", index) + } +} + +func TestStateStore_UpsertACLTokens(t *testing.T) { + state := testStateStore(t) + tk1 := mock.ACLToken() + tk2 := mock.ACLToken() + + ws := memdb.NewWatchSet() + if _, err := state.ACLTokenByAccessorID(ws, tk1.AccessorID); err != nil { + t.Fatalf("err: %v", err) + } + if _, err := state.ACLTokenByAccessorID(ws, tk2.AccessorID); err != nil { + t.Fatalf("err: %v", err) + } + + if err := state.UpsertACLTokens(1000, + []*structs.ACLToken{tk1, tk2}); err != nil { + t.Fatalf("err: %v", err) + } + if !watchFired(ws) { + t.Fatalf("bad") + } + + ws = memdb.NewWatchSet() + out, err := state.ACLTokenByAccessorID(ws, tk1.AccessorID) + assert.Equal(t, nil, err) + assert.Equal(t, tk1, out) + + out, err = state.ACLTokenByAccessorID(ws, tk2.AccessorID) + assert.Equal(t, nil, err) + assert.Equal(t, tk2, out) + + out, err = state.ACLTokenBySecretID(ws, tk1.SecretID) + assert.Equal(t, nil, err) + assert.Equal(t, tk1, out) + + out, err = state.ACLTokenBySecretID(ws, tk2.SecretID) + assert.Equal(t, nil, err) + assert.Equal(t, tk2, out) + + iter, err := state.ACLTokens(ws) + if err != nil { + t.Fatalf("err: %v", err) + } + + // Ensure we see both policies + count := 0 + for { + raw := iter.Next() + if raw == nil { + break + } + count++ + } + if count != 2 { + t.Fatalf("bad: %d", count) + } + + index, err := state.Index("acl_token") + if err != nil { + t.Fatalf("err: %v", err) + } + if index != 1000 { + t.Fatalf("bad: %d", index) + } + + if watchFired(ws) { + t.Fatalf("bad") + } +} + +func TestStateStore_DeleteACLTokens(t *testing.T) { + state := testStateStore(t) + tk1 := mock.ACLToken() + tk2 := mock.ACLToken() + + // Create the tokens + if err := state.UpsertACLTokens(1000, + []*structs.ACLToken{tk1, tk2}); err != nil { + t.Fatalf("err: %v", err) + } + + // Create a watcher + ws := memdb.NewWatchSet() + if _, err := state.ACLTokenByAccessorID(ws, tk1.AccessorID); err != nil { + t.Fatalf("err: %v", err) + } + + // Delete the token + if err := state.DeleteACLTokens(1001, + []string{tk1.AccessorID, tk2.AccessorID}); err != nil { + t.Fatalf("err: %v", err) + } + + // Ensure watching triggered + if !watchFired(ws) { + t.Fatalf("bad") + } + + // Ensure we don't get the object back + ws = memdb.NewWatchSet() + out, err := state.ACLTokenByAccessorID(ws, tk1.AccessorID) + assert.Equal(t, nil, err) + if out != nil { + t.Fatalf("bad: %#v", out) + } + + iter, err := state.ACLTokens(ws) + if err != nil { + t.Fatalf("err: %v", err) + } + + // Ensure we see both policies + count := 0 + for { + raw := iter.Next() + if raw == nil { + break + } + count++ + } + if count != 0 { + t.Fatalf("bad: %d", count) + } + + index, err := state.Index("acl_token") + if err != nil { + t.Fatalf("err: %v", err) + } + if index != 1001 { + t.Fatalf("bad: %d", index) + } + + if watchFired(ws) { + t.Fatalf("bad") + } +} + +func TestStateStore_ACLTokenByAccessorIDPrefix(t *testing.T) { + state := testStateStore(t) + prefixes := []string{ + "aaaa", + "aabb", + "bbbb", + "bbcc", + "ffff", + } + + // Create the tokens + var baseIndex uint64 = 1000 + for _, prefix := range prefixes { + tk := mock.ACLToken() + tk.AccessorID = prefix + tk.AccessorID[4:] + if err := state.UpsertACLTokens(baseIndex, []*structs.ACLToken{tk}); err != nil { + t.Fatalf("err: %v", err) + } + baseIndex++ + } + + // Scan by prefix + iter, err := state.ACLTokenByAccessorIDPrefix(nil, "aa") + if err != nil { + t.Fatalf("err: %v", err) + } + + // Ensure we see both tokens + count := 0 + out := []string{} + for { + raw := iter.Next() + if raw == nil { + break + } + count++ + out = append(out, raw.(*structs.ACLToken).AccessorID[:4]) + } + if count != 2 { + t.Fatalf("bad: %d %v", count, out) + } + sort.Strings(out) + + expect := []string{"aaaa", "aabb"} + assert.Equal(t, expect, out) +} + +func TestStateStore_RestoreACLPolicy(t *testing.T) { + state := testStateStore(t) + policy := mock.ACLPolicy() + + restore, err := state.Restore() + if err != nil { + t.Fatalf("err: %v", err) + } + + err = restore.ACLPolicyRestore(policy) + if err != nil { + t.Fatalf("err: %v", err) + } + restore.Commit() + + ws := memdb.NewWatchSet() + out, err := state.ACLPolicyByName(ws, policy.Name) + if err != nil { + t.Fatalf("err: %v", err) + } + assert.Equal(t, policy, out) +} + +func TestStateStore_ACLTokensByGlobal(t *testing.T) { + state := testStateStore(t) + tk1 := mock.ACLToken() + tk2 := mock.ACLToken() + tk3 := mock.ACLToken() + tk4 := mock.ACLToken() + tk3.Global = true + + if err := state.UpsertACLTokens(1000, + []*structs.ACLToken{tk1, tk2, tk3, tk4}); err != nil { + t.Fatalf("err: %v", err) + } + + iter, err := state.ACLTokensByGlobal(nil, true) + if err != nil { + t.Fatalf("err: %v", err) + } + + // Ensure we see the one global policies + count := 0 + for { + raw := iter.Next() + if raw == nil { + break + } + count++ + } + if count != 1 { + t.Fatalf("bad: %d", count) + } +} + +func TestStateStore_RestoreACLToken(t *testing.T) { + state := testStateStore(t) + token := mock.ACLToken() + + restore, err := state.Restore() + if err != nil { + t.Fatalf("err: %v", err) + } + + err = restore.ACLTokenRestore(token) + if err != nil { + t.Fatalf("err: %v", err) + } + restore.Commit() + + ws := memdb.NewWatchSet() + out, err := state.ACLTokenByAccessorID(ws, token.AccessorID) + if err != nil { + t.Fatalf("err: %v", err) + } + assert.Equal(t, token, out) +} + func TestStateStore_Abandon(t *testing.T) { s := testStateStore(t) abandonCh := s.AbandonCh() diff --git a/nomad/structs/funcs.go b/nomad/structs/funcs.go index 56b26d510..b0fe90080 100644 --- a/nomad/structs/funcs.go +++ b/nomad/structs/funcs.go @@ -2,11 +2,17 @@ package structs import ( crand "crypto/rand" + "encoding/binary" "fmt" "math" + "sort" "strings" + "golang.org/x/crypto/blake2b" + multierror "github.com/hashicorp/go-multierror" + lru "github.com/hashicorp/golang-lru" + "github.com/hashicorp/nomad/acl" ) // MergeMultierrorWarnings takes job warnings and canonicalize warnings and @@ -255,3 +261,52 @@ func DenormalizeAllocationJobs(job *Job, allocs []*Allocation) { func AllocName(job, group string, idx uint) string { return fmt.Sprintf("%s.%s[%d]", job, group, idx) } + +// ACLPolicyListHash returns a consistent hash for a set of policies. +func ACLPolicyListHash(policies []*ACLPolicy) string { + cacheKeyHash, err := blake2b.New256(nil) + if err != nil { + panic(err) + } + for _, policy := range policies { + cacheKeyHash.Write([]byte(policy.Name)) + binary.Write(cacheKeyHash, binary.BigEndian, policy.ModifyIndex) + } + cacheKey := string(cacheKeyHash.Sum(nil)) + return cacheKey +} + +// CompileACLObject compiles a set of ACL policies into an ACL object with a cache +func CompileACLObject(cache *lru.TwoQueueCache, policies []*ACLPolicy) (*acl.ACL, error) { + // Sort the policies to ensure consistent ordering + sort.Slice(policies, func(i, j int) bool { + return policies[i].Name < policies[j].Name + }) + + // Determine the cache key + cacheKey := ACLPolicyListHash(policies) + aclRaw, ok := cache.Get(cacheKey) + if ok { + return aclRaw.(*acl.ACL), nil + } + + // Parse the policies + parsed := make([]*acl.Policy, 0, len(policies)) + for _, policy := range policies { + p, err := acl.Parse(policy.Rules) + if err != nil { + return nil, fmt.Errorf("failed to parse %q: %v", policy.Name, err) + } + parsed = append(parsed, p) + } + + // Create the ACL object + aclObj, err := acl.NewACL(false, parsed) + if err != nil { + return nil, fmt.Errorf("failed to construct ACL: %v", err) + } + + // Update the cache + cache.Add(cacheKey, aclObj) + return aclObj, nil +} diff --git a/nomad/structs/funcs_test.go b/nomad/structs/funcs_test.go index 9377a8a6c..7ae921fc0 100644 --- a/nomad/structs/funcs_test.go +++ b/nomad/structs/funcs_test.go @@ -4,6 +4,9 @@ import ( "fmt" "regexp" "testing" + + lru "github.com/hashicorp/golang-lru" + "github.com/stretchr/testify/assert" ) func TestRemoveAllocs(t *testing.T) { @@ -269,3 +272,106 @@ func TestGenerateUUID(t *testing.T) { } } } + +func TestACLPolicyListHash(t *testing.T) { + h1 := ACLPolicyListHash(nil) + assert.NotEqual(t, "", h1) + + p1 := &ACLPolicy{ + Name: fmt.Sprintf("policy-%s", GenerateUUID()), + Description: "Super cool policy!", + Rules: ` + namespace "default" { + policy = "write" + } + node { + policy = "read" + } + agent { + policy = "read" + } + `, + CreateIndex: 10, + ModifyIndex: 20, + } + + h2 := ACLPolicyListHash([]*ACLPolicy{p1}) + assert.NotEqual(t, "", h2) + assert.NotEqual(t, h1, h2) + + // Create P2 as copy of P1 with new name + p2 := &ACLPolicy{} + *p2 = *p1 + p2.Name = fmt.Sprintf("policy-%s", GenerateUUID()) + + h3 := ACLPolicyListHash([]*ACLPolicy{p1, p2}) + assert.NotEqual(t, "", h3) + assert.NotEqual(t, h2, h3) + + h4 := ACLPolicyListHash([]*ACLPolicy{p2}) + assert.NotEqual(t, "", h4) + assert.NotEqual(t, h3, h4) + + // ModifyIndex should change the hash + p2.ModifyIndex++ + h5 := ACLPolicyListHash([]*ACLPolicy{p2}) + assert.NotEqual(t, "", h5) + assert.NotEqual(t, h4, h5) +} + +func TestCompileACLObject(t *testing.T) { + p1 := &ACLPolicy{ + Name: fmt.Sprintf("policy-%s", GenerateUUID()), + Description: "Super cool policy!", + Rules: ` + namespace "default" { + policy = "write" + } + node { + policy = "read" + } + agent { + policy = "read" + } + `, + CreateIndex: 10, + ModifyIndex: 20, + } + + // Create P2 as copy of P1 with new name + p2 := &ACLPolicy{} + *p2 = *p1 + p2.Name = fmt.Sprintf("policy-%s", GenerateUUID()) + + // Create a small cache + cache, err := lru.New2Q(16) + assert.Nil(t, err) + + // Test compilation + aclObj, err := CompileACLObject(cache, []*ACLPolicy{p1}) + assert.Nil(t, err) + assert.NotNil(t, aclObj) + + // Should get the same object + aclObj2, err := CompileACLObject(cache, []*ACLPolicy{p1}) + assert.Nil(t, err) + if aclObj != aclObj2 { + t.Fatalf("expected the same object") + } + + // Should get another object + aclObj3, err := CompileACLObject(cache, []*ACLPolicy{p1, p2}) + assert.Nil(t, err) + assert.NotNil(t, aclObj3) + if aclObj == aclObj3 { + t.Fatalf("unexpected same object") + } + + // Should be order independent + aclObj4, err := CompileACLObject(cache, []*ACLPolicy{p2, p1}) + assert.Nil(t, err) + assert.NotNil(t, aclObj4) + if aclObj3 != aclObj4 { + t.Fatalf("expected same object") + } +} diff --git a/nomad/structs/structs.generated.go b/nomad/structs/structs.generated.go deleted file mode 100644 index 982255d98..000000000 --- a/nomad/structs/structs.generated.go +++ /dev/null @@ -1,59601 +0,0 @@ -// ************************************************************ -// DO NOT EDIT. -// THIS FILE IS AUTO-GENERATED BY codecgen. -// ************************************************************ - -package structs - -import ( - "errors" - "fmt" - codec1978 "github.com/ugorji/go/codec" - net "net" - "reflect" - "runtime" - time "time" -) - -const ( - // ----- content types ---- - codecSelferC_UTF85247 = 1 - codecSelferC_RAW5247 = 0 - // ----- value types used ---- - codecSelferValueTypeArray5247 = 10 - codecSelferValueTypeMap5247 = 9 - // ----- containerStateValues ---- - codecSelfer_containerMapKey5247 = 2 - codecSelfer_containerMapValue5247 = 3 - codecSelfer_containerMapEnd5247 = 4 - codecSelfer_containerArrayElem5247 = 6 - codecSelfer_containerArrayEnd5247 = 7 -) - -var ( - codecSelferBitsize5247 = uint8(reflect.TypeOf(uint(0)).Bits()) - codecSelferOnlyMapOrArrayEncodeToStructErr5247 = errors.New(`only encoded map or array can be decoded into a struct`) -) - -type codecSelfer5247 struct{} - -func init() { - if codec1978.GenVersion != 5 { - _, file, _, _ := runtime.Caller(0) - err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v", - 5, codec1978.GenVersion, file) - panic(err) - } - if false { // reference the types, but skip this branch at build/run time - var v0 net.IP - var v1 time.Duration - _, _ = v0, v1 - } -} - -func (x MessageType) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - r.EncodeUint(uint64(x)) - } -} - -func (x *MessageType) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - *((*uint8)(x)) = uint8(r.DecodeUint(8)) - } -} - -func (x Context) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x)) - } -} - -func (x *Context) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - *((*string)(x)) = r.DecodeString() - } -} - -func (x *QueryOptions) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) - } else { - yynn2 = 5 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MinQueryIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MaxQueryTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllowStale")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Prefix")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *QueryOptions) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *QueryOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv4 := &x.Region - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "MinQueryIndex": - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv6 := &x.MinQueryIndex - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "MaxQueryTime": - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv8 := &x.MaxQueryTime - yym9 := z.DecBinary() - _ = yym9 - if false { - } else if z.HasExtensions() && z.DecExt(yyv8) { - } else { - *((*int64)(yyv8)) = int64(r.DecodeInt(64)) - } - } - case "AllowStale": - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv10 := &x.AllowStale - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv12 := &x.Prefix - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *QueryOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj14 int - var yyb14 bool - var yyhl14 bool = l >= 0 - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv15 := &x.Region - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv17 := &x.MinQueryIndex - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*uint64)(yyv17)) = uint64(r.DecodeUint(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv19 := &x.MaxQueryTime - yym20 := z.DecBinary() - _ = yym20 - if false { - } else if z.HasExtensions() && z.DecExt(yyv19) { - } else { - *((*int64)(yyv19)) = int64(r.DecodeInt(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv21 := &x.AllowStale - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*bool)(yyv21)) = r.DecodeBool() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv23 := &x.Prefix - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*string)(yyv23)) = r.DecodeString() - } - } - for { - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj14-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *WriteRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [1]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(1) - } else { - yynn2 = 1 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *WriteRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *WriteRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv4 := &x.Region - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *WriteRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj6 int - var yyb6 bool - var yyhl6 bool = l >= 0 - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv7 := &x.Region - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - *((*string)(yyv7)) = r.DecodeString() - } - } - for { - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj6-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *QueryMeta) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *QueryMeta) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *QueryMeta) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv4 := &x.Index - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*uint64)(yyv4)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv6 := &x.LastContact - yym7 := z.DecBinary() - _ = yym7 - if false { - } else if z.HasExtensions() && z.DecExt(yyv6) { - } else { - *((*int64)(yyv6)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv8 := &x.KnownLeader - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*bool)(yyv8)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *QueryMeta) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv11 := &x.Index - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*uint64)(yyv11)) = uint64(r.DecodeUint(64)) - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv13 := &x.LastContact - yym14 := z.DecBinary() - _ = yym14 - if false { - } else if z.HasExtensions() && z.DecExt(yyv13) { - } else { - *((*int64)(yyv13)) = int64(r.DecodeInt(64)) - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv15 := &x.KnownLeader - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*bool)(yyv15)) = r.DecodeBool() - } - } - for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj10-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *WriteMeta) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [1]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(1) - } else { - yynn2 = 1 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *WriteMeta) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *WriteMeta) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv4 := &x.Index - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*uint64)(yyv4)) = uint64(r.DecodeUint(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *WriteMeta) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj6 int - var yyb6 bool - var yyhl6 bool = l >= 0 - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv7 := &x.Index - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - *((*uint64)(yyv7)) = uint64(r.DecodeUint(64)) - } - } - for { - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj6-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *NodeRegisterRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Node == nil { - r.EncodeNil() - } else { - x.Node.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Node")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Node == nil { - r.EncodeNil() - } else { - x.Node.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *NodeRegisterRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *NodeRegisterRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Node": - if r.TryDecodeAsNil() { - if x.Node != nil { - x.Node = nil - } - } else { - if x.Node == nil { - x.Node = new(Node) - } - x.Node.CodecDecodeSelf(d) - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv5 := &x.Region - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - *((*string)(yyv5)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *NodeRegisterRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj7 int - var yyb7 bool - var yyhl7 bool = l >= 0 - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Node != nil { - x.Node = nil - } - } else { - if x.Node == nil { - x.Node = new(Node) - } - x.Node.CodecDecodeSelf(d) - } - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv9 := &x.Region - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*string)(yyv9)) = r.DecodeString() - } - } - for { - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj7-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *NodeDeregisterRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodeID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *NodeDeregisterRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *NodeDeregisterRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "NodeID": - if r.TryDecodeAsNil() { - x.NodeID = "" - } else { - yyv4 := &x.NodeID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv6 := &x.Region - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *NodeDeregisterRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj8 int - var yyb8 bool - var yyhl8 bool = l >= 0 - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodeID = "" - } else { - yyv9 := &x.NodeID - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*string)(yyv9)) = r.DecodeString() - } - } - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv11 := &x.Region - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*string)(yyv11)) = r.DecodeString() - } - } - for { - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj8-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *NodeServerInfo) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.RPCAdvertiseAddr)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("RPCAdvertiseAddr")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.RPCAdvertiseAddr)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeInt(int64(x.RPCMajorVersion)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("RPCMajorVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeInt(int64(x.RPCMajorVersion)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeInt(int64(x.RPCMinorVersion)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("RPCMinorVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeInt(int64(x.RPCMinorVersion)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Datacenter)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Datacenter")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Datacenter)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *NodeServerInfo) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *NodeServerInfo) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "RPCAdvertiseAddr": - if r.TryDecodeAsNil() { - x.RPCAdvertiseAddr = "" - } else { - yyv4 := &x.RPCAdvertiseAddr - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "RPCMajorVersion": - if r.TryDecodeAsNil() { - x.RPCMajorVersion = 0 - } else { - yyv6 := &x.RPCMajorVersion - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*int32)(yyv6)) = int32(r.DecodeInt(32)) - } - } - case "RPCMinorVersion": - if r.TryDecodeAsNil() { - x.RPCMinorVersion = 0 - } else { - yyv8 := &x.RPCMinorVersion - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*int32)(yyv8)) = int32(r.DecodeInt(32)) - } - } - case "Datacenter": - if r.TryDecodeAsNil() { - x.Datacenter = "" - } else { - yyv10 := &x.Datacenter - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *NodeServerInfo) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.RPCAdvertiseAddr = "" - } else { - yyv13 := &x.RPCAdvertiseAddr - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*string)(yyv13)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.RPCMajorVersion = 0 - } else { - yyv15 := &x.RPCMajorVersion - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*int32)(yyv15)) = int32(r.DecodeInt(32)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.RPCMinorVersion = 0 - } else { - yyv17 := &x.RPCMinorVersion - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*int32)(yyv17)) = int32(r.DecodeInt(32)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Datacenter = "" - } else { - yyv19 := &x.Datacenter - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *NodeUpdateStatusRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodeID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Status)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Status")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Status)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *NodeUpdateStatusRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *NodeUpdateStatusRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "NodeID": - if r.TryDecodeAsNil() { - x.NodeID = "" - } else { - yyv4 := &x.NodeID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Status": - if r.TryDecodeAsNil() { - x.Status = "" - } else { - yyv6 := &x.Status - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv8 := &x.Region - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *NodeUpdateStatusRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodeID = "" - } else { - yyv11 := &x.NodeID - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*string)(yyv11)) = r.DecodeString() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Status = "" - } else { - yyv13 := &x.Status - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*string)(yyv13)) = r.DecodeString() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv15 := &x.Region - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj10-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *NodeUpdateDrainRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodeID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeBool(bool(x.Drain)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Drain")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeBool(bool(x.Drain)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *NodeUpdateDrainRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *NodeUpdateDrainRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "NodeID": - if r.TryDecodeAsNil() { - x.NodeID = "" - } else { - yyv4 := &x.NodeID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Drain": - if r.TryDecodeAsNil() { - x.Drain = false - } else { - yyv6 := &x.Drain - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*bool)(yyv6)) = r.DecodeBool() - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv8 := &x.Region - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *NodeUpdateDrainRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodeID = "" - } else { - yyv11 := &x.NodeID - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*string)(yyv11)) = r.DecodeString() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Drain = false - } else { - yyv13 := &x.Drain - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*bool)(yyv13)) = r.DecodeBool() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv15 := &x.Region - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj10-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *NodeEvaluateRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodeID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *NodeEvaluateRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *NodeEvaluateRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "NodeID": - if r.TryDecodeAsNil() { - x.NodeID = "" - } else { - yyv4 := &x.NodeID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv6 := &x.Region - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *NodeEvaluateRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj8 int - var yyb8 bool - var yyhl8 bool = l >= 0 - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodeID = "" - } else { - yyv9 := &x.NodeID - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*string)(yyv9)) = r.DecodeString() - } - } - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv11 := &x.Region - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*string)(yyv11)) = r.DecodeString() - } - } - for { - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj8-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *NodeSpecificRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [7]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(7) - } else { - yynn2 = 7 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodeID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.SecretID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("SecretID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.SecretID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MinQueryIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MaxQueryTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllowStale")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Prefix")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *NodeSpecificRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *NodeSpecificRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "NodeID": - if r.TryDecodeAsNil() { - x.NodeID = "" - } else { - yyv4 := &x.NodeID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "SecretID": - if r.TryDecodeAsNil() { - x.SecretID = "" - } else { - yyv6 := &x.SecretID - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv8 := &x.Region - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "MinQueryIndex": - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv10 := &x.MinQueryIndex - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*uint64)(yyv10)) = uint64(r.DecodeUint(64)) - } - } - case "MaxQueryTime": - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv12 := &x.MaxQueryTime - yym13 := z.DecBinary() - _ = yym13 - if false { - } else if z.HasExtensions() && z.DecExt(yyv12) { - } else { - *((*int64)(yyv12)) = int64(r.DecodeInt(64)) - } - } - case "AllowStale": - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv14 := &x.AllowStale - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*bool)(yyv14)) = r.DecodeBool() - } - } - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv16 := &x.Prefix - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*string)(yyv16)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *NodeSpecificRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj18 int - var yyb18 bool - var yyhl18 bool = l >= 0 - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodeID = "" - } else { - yyv19 := &x.NodeID - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.SecretID = "" - } else { - yyv21 := &x.SecretID - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*string)(yyv21)) = r.DecodeString() - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv23 := &x.Region - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*string)(yyv23)) = r.DecodeString() - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv25 := &x.MinQueryIndex - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*uint64)(yyv25)) = uint64(r.DecodeUint(64)) - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv27 := &x.MaxQueryTime - yym28 := z.DecBinary() - _ = yym28 - if false { - } else if z.HasExtensions() && z.DecExt(yyv27) { - } else { - *((*int64)(yyv27)) = int64(r.DecodeInt(64)) - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv29 := &x.AllowStale - yym30 := z.DecBinary() - _ = yym30 - if false { - } else { - *((*bool)(yyv29)) = r.DecodeBool() - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv31 := &x.Prefix - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - *((*string)(yyv31)) = r.DecodeString() - } - } - for { - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj18-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *SearchResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) - } else { - yynn2 = 5 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Matches == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encMapContextSlicestring((map[Context][]string)(x.Matches), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Matches")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Matches == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encMapContextSlicestring((map[Context][]string)(x.Matches), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Truncations == nil { - r.EncodeNil() - } else { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - h.encMapContextbool((map[Context]bool)(x.Truncations), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Truncations")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Truncations == nil { - r.EncodeNil() - } else { - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - h.encMapContextbool((map[Context]bool)(x.Truncations), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *SearchResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *SearchResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Matches": - if r.TryDecodeAsNil() { - x.Matches = nil - } else { - yyv4 := &x.Matches - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decMapContextSlicestring((*map[Context][]string)(yyv4), d) - } - } - case "Truncations": - if r.TryDecodeAsNil() { - x.Truncations = nil - } else { - yyv6 := &x.Truncations - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - h.decMapContextbool((*map[Context]bool)(yyv6), d) - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv8 := &x.Index - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint64)(yyv8)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv10 := &x.LastContact - yym11 := z.DecBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.DecExt(yyv10) { - } else { - *((*int64)(yyv10)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv12 := &x.KnownLeader - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*bool)(yyv12)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *SearchResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj14 int - var yyb14 bool - var yyhl14 bool = l >= 0 - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Matches = nil - } else { - yyv15 := &x.Matches - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - h.decMapContextSlicestring((*map[Context][]string)(yyv15), d) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Truncations = nil - } else { - yyv17 := &x.Truncations - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - h.decMapContextbool((*map[Context]bool)(yyv17), d) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv19 := &x.Index - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*uint64)(yyv19)) = uint64(r.DecodeUint(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv21 := &x.LastContact - yym22 := z.DecBinary() - _ = yym22 - if false { - } else if z.HasExtensions() && z.DecExt(yyv21) { - } else { - *((*int64)(yyv21)) = int64(r.DecodeInt(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv23 := &x.KnownLeader - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*bool)(yyv23)) = r.DecodeBool() - } - } - for { - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj14-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *SearchRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [6]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(6) - } else { - yynn2 = 6 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Prefix")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - x.Context.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Context")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - x.Context.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MinQueryIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MaxQueryTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllowStale")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *SearchRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *SearchRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv4 := &x.Prefix - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Context": - if r.TryDecodeAsNil() { - x.Context = "" - } else { - yyv6 := &x.Context - yyv6.CodecDecodeSelf(d) - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv7 := &x.Region - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - *((*string)(yyv7)) = r.DecodeString() - } - } - case "MinQueryIndex": - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv9 := &x.MinQueryIndex - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*uint64)(yyv9)) = uint64(r.DecodeUint(64)) - } - } - case "MaxQueryTime": - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv11 := &x.MaxQueryTime - yym12 := z.DecBinary() - _ = yym12 - if false { - } else if z.HasExtensions() && z.DecExt(yyv11) { - } else { - *((*int64)(yyv11)) = int64(r.DecodeInt(64)) - } - } - case "AllowStale": - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv13 := &x.AllowStale - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*bool)(yyv13)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *SearchRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj15 int - var yyb15 bool - var yyhl15 bool = l >= 0 - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv16 := &x.Prefix - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*string)(yyv16)) = r.DecodeString() - } - } - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Context = "" - } else { - yyv18 := &x.Context - yyv18.CodecDecodeSelf(d) - } - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv19 := &x.Region - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv21 := &x.MinQueryIndex - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*uint64)(yyv21)) = uint64(r.DecodeUint(64)) - } - } - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv23 := &x.MaxQueryTime - yym24 := z.DecBinary() - _ = yym24 - if false { - } else if z.HasExtensions() && z.DecExt(yyv23) { - } else { - *((*int64)(yyv23)) = int64(r.DecodeInt(64)) - } - } - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv25 := &x.AllowStale - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*bool)(yyv25)) = r.DecodeBool() - } - } - for { - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj15-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobRegisterRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Job == nil { - r.EncodeNil() - } else { - x.Job.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Job")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Job == nil { - r.EncodeNil() - } else { - x.Job.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeBool(bool(x.EnforceIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EnforceIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeBool(bool(x.EnforceIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.JobModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.JobModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobRegisterRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobRegisterRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Job": - if r.TryDecodeAsNil() { - if x.Job != nil { - x.Job = nil - } - } else { - if x.Job == nil { - x.Job = new(Job) - } - x.Job.CodecDecodeSelf(d) - } - case "EnforceIndex": - if r.TryDecodeAsNil() { - x.EnforceIndex = false - } else { - yyv5 := &x.EnforceIndex - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - *((*bool)(yyv5)) = r.DecodeBool() - } - } - case "JobModifyIndex": - if r.TryDecodeAsNil() { - x.JobModifyIndex = 0 - } else { - yyv7 := &x.JobModifyIndex - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - *((*uint64)(yyv7)) = uint64(r.DecodeUint(64)) - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv9 := &x.Region - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*string)(yyv9)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobRegisterRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj11 int - var yyb11 bool - var yyhl11 bool = l >= 0 - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Job != nil { - x.Job = nil - } - } else { - if x.Job == nil { - x.Job = new(Job) - } - x.Job.CodecDecodeSelf(d) - } - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EnforceIndex = false - } else { - yyv13 := &x.EnforceIndex - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*bool)(yyv13)) = r.DecodeBool() - } - } - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobModifyIndex = 0 - } else { - yyv15 := &x.JobModifyIndex - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*uint64)(yyv15)) = uint64(r.DecodeUint(64)) - } - } - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv17 := &x.Region - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(yyv17)) = r.DecodeString() - } - } - for { - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj11-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobDeregisterRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeBool(bool(x.Purge)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Purge")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeBool(bool(x.Purge)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobDeregisterRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobDeregisterRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "JobID": - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv4 := &x.JobID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Purge": - if r.TryDecodeAsNil() { - x.Purge = false - } else { - yyv6 := &x.Purge - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*bool)(yyv6)) = r.DecodeBool() - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv8 := &x.Region - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobDeregisterRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv11 := &x.JobID - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*string)(yyv11)) = r.DecodeString() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Purge = false - } else { - yyv13 := &x.Purge - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*bool)(yyv13)) = r.DecodeBool() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv15 := &x.Region - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj10-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobEvaluateRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobEvaluateRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobEvaluateRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "JobID": - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv4 := &x.JobID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv6 := &x.Region - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobEvaluateRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj8 int - var yyb8 bool - var yyhl8 bool = l >= 0 - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv9 := &x.JobID - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*string)(yyv9)) = r.DecodeString() - } - } - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv11 := &x.Region - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*string)(yyv11)) = r.DecodeString() - } - } - for { - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj8-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobSpecificRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [7]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(7) - } else { - yynn2 = 7 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeBool(bool(x.AllAllocs)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllAllocs")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeBool(bool(x.AllAllocs)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MinQueryIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MaxQueryTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllowStale")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Prefix")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobSpecificRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobSpecificRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "JobID": - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv4 := &x.JobID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "AllAllocs": - if r.TryDecodeAsNil() { - x.AllAllocs = false - } else { - yyv6 := &x.AllAllocs - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*bool)(yyv6)) = r.DecodeBool() - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv8 := &x.Region - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "MinQueryIndex": - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv10 := &x.MinQueryIndex - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*uint64)(yyv10)) = uint64(r.DecodeUint(64)) - } - } - case "MaxQueryTime": - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv12 := &x.MaxQueryTime - yym13 := z.DecBinary() - _ = yym13 - if false { - } else if z.HasExtensions() && z.DecExt(yyv12) { - } else { - *((*int64)(yyv12)) = int64(r.DecodeInt(64)) - } - } - case "AllowStale": - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv14 := &x.AllowStale - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*bool)(yyv14)) = r.DecodeBool() - } - } - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv16 := &x.Prefix - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*string)(yyv16)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobSpecificRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj18 int - var yyb18 bool - var yyhl18 bool = l >= 0 - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv19 := &x.JobID - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllAllocs = false - } else { - yyv21 := &x.AllAllocs - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*bool)(yyv21)) = r.DecodeBool() - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv23 := &x.Region - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*string)(yyv23)) = r.DecodeString() - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv25 := &x.MinQueryIndex - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*uint64)(yyv25)) = uint64(r.DecodeUint(64)) - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv27 := &x.MaxQueryTime - yym28 := z.DecBinary() - _ = yym28 - if false { - } else if z.HasExtensions() && z.DecExt(yyv27) { - } else { - *((*int64)(yyv27)) = int64(r.DecodeInt(64)) - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv29 := &x.AllowStale - yym30 := z.DecBinary() - _ = yym30 - if false { - } else { - *((*bool)(yyv29)) = r.DecodeBool() - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv31 := &x.Prefix - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - *((*string)(yyv31)) = r.DecodeString() - } - } - for { - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj18-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobListRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) - } else { - yynn2 = 5 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MinQueryIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MaxQueryTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllowStale")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Prefix")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobListRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobListRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv4 := &x.Region - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "MinQueryIndex": - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv6 := &x.MinQueryIndex - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "MaxQueryTime": - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv8 := &x.MaxQueryTime - yym9 := z.DecBinary() - _ = yym9 - if false { - } else if z.HasExtensions() && z.DecExt(yyv8) { - } else { - *((*int64)(yyv8)) = int64(r.DecodeInt(64)) - } - } - case "AllowStale": - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv10 := &x.AllowStale - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv12 := &x.Prefix - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobListRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj14 int - var yyb14 bool - var yyhl14 bool = l >= 0 - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv15 := &x.Region - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv17 := &x.MinQueryIndex - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*uint64)(yyv17)) = uint64(r.DecodeUint(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv19 := &x.MaxQueryTime - yym20 := z.DecBinary() - _ = yym20 - if false { - } else if z.HasExtensions() && z.DecExt(yyv19) { - } else { - *((*int64)(yyv19)) = int64(r.DecodeInt(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv21 := &x.AllowStale - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*bool)(yyv21)) = r.DecodeBool() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv23 := &x.Prefix - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*string)(yyv23)) = r.DecodeString() - } - } - for { - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj14-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobPlanRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Job == nil { - r.EncodeNil() - } else { - x.Job.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Job")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Job == nil { - r.EncodeNil() - } else { - x.Job.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeBool(bool(x.Diff)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Diff")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeBool(bool(x.Diff)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobPlanRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobPlanRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Job": - if r.TryDecodeAsNil() { - if x.Job != nil { - x.Job = nil - } - } else { - if x.Job == nil { - x.Job = new(Job) - } - x.Job.CodecDecodeSelf(d) - } - case "Diff": - if r.TryDecodeAsNil() { - x.Diff = false - } else { - yyv5 := &x.Diff - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - *((*bool)(yyv5)) = r.DecodeBool() - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv7 := &x.Region - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - *((*string)(yyv7)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobPlanRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj9 int - var yyb9 bool - var yyhl9 bool = l >= 0 - yyj9++ - if yyhl9 { - yyb9 = yyj9 > l - } else { - yyb9 = r.CheckBreak() - } - if yyb9 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Job != nil { - x.Job = nil - } - } else { - if x.Job == nil { - x.Job = new(Job) - } - x.Job.CodecDecodeSelf(d) - } - yyj9++ - if yyhl9 { - yyb9 = yyj9 > l - } else { - yyb9 = r.CheckBreak() - } - if yyb9 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Diff = false - } else { - yyv11 := &x.Diff - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*bool)(yyv11)) = r.DecodeBool() - } - } - yyj9++ - if yyhl9 { - yyb9 = yyj9 > l - } else { - yyb9 = r.CheckBreak() - } - if yyb9 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv13 := &x.Region - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*string)(yyv13)) = r.DecodeString() - } - } - for { - yyj9++ - if yyhl9 { - yyb9 = yyj9 > l - } else { - yyb9 = r.CheckBreak() - } - if yyb9 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj9-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobSummaryRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [6]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(6) - } else { - yynn2 = 6 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MinQueryIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MaxQueryTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllowStale")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Prefix")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobSummaryRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobSummaryRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "JobID": - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv4 := &x.JobID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv6 := &x.Region - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "MinQueryIndex": - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv8 := &x.MinQueryIndex - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint64)(yyv8)) = uint64(r.DecodeUint(64)) - } - } - case "MaxQueryTime": - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv10 := &x.MaxQueryTime - yym11 := z.DecBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.DecExt(yyv10) { - } else { - *((*int64)(yyv10)) = int64(r.DecodeInt(64)) - } - } - case "AllowStale": - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv12 := &x.AllowStale - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*bool)(yyv12)) = r.DecodeBool() - } - } - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv14 := &x.Prefix - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*string)(yyv14)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobSummaryRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj16 int - var yyb16 bool - var yyhl16 bool = l >= 0 - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv17 := &x.JobID - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(yyv17)) = r.DecodeString() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv19 := &x.Region - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv21 := &x.MinQueryIndex - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*uint64)(yyv21)) = uint64(r.DecodeUint(64)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv23 := &x.MaxQueryTime - yym24 := z.DecBinary() - _ = yym24 - if false { - } else if z.HasExtensions() && z.DecExt(yyv23) { - } else { - *((*int64)(yyv23)) = int64(r.DecodeInt(64)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv25 := &x.AllowStale - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*bool)(yyv25)) = r.DecodeBool() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv27 := &x.Prefix - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*string)(yyv27)) = r.DecodeString() - } - } - for { - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj16-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobDispatchRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Payload == nil { - r.EncodeNil() - } else { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeStringBytes(codecSelferC_RAW5247, []byte(x.Payload)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Payload")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Payload == nil { - r.EncodeNil() - } else { - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeStringBytes(codecSelferC_RAW5247, []byte(x.Payload)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Meta == nil { - r.EncodeNil() - } else { - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - z.F.EncMapStringStringV(x.Meta, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Meta")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Meta == nil { - r.EncodeNil() - } else { - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - z.F.EncMapStringStringV(x.Meta, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobDispatchRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobDispatchRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "JobID": - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv4 := &x.JobID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Payload": - if r.TryDecodeAsNil() { - x.Payload = nil - } else { - yyv6 := &x.Payload - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *yyv6 = r.DecodeBytes(*(*[]byte)(yyv6), false, false) - } - } - case "Meta": - if r.TryDecodeAsNil() { - x.Meta = nil - } else { - yyv8 := &x.Meta - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - z.F.DecMapStringStringX(yyv8, false, d) - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv10 := &x.Region - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobDispatchRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv13 := &x.JobID - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*string)(yyv13)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Payload = nil - } else { - yyv15 := &x.Payload - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *yyv15 = r.DecodeBytes(*(*[]byte)(yyv15), false, false) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Meta = nil - } else { - yyv17 := &x.Meta - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - z.F.DecMapStringStringX(yyv17, false, d) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv19 := &x.Region - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobValidateRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Job == nil { - r.EncodeNil() - } else { - x.Job.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Job")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Job == nil { - r.EncodeNil() - } else { - x.Job.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobValidateRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobValidateRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Job": - if r.TryDecodeAsNil() { - if x.Job != nil { - x.Job = nil - } - } else { - if x.Job == nil { - x.Job = new(Job) - } - x.Job.CodecDecodeSelf(d) - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv5 := &x.Region - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - *((*string)(yyv5)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobValidateRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj7 int - var yyb7 bool - var yyhl7 bool = l >= 0 - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Job != nil { - x.Job = nil - } - } else { - if x.Job == nil { - x.Job = new(Job) - } - x.Job.CodecDecodeSelf(d) - } - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv9 := &x.Region - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*string)(yyv9)) = r.DecodeString() - } - } - for { - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj7-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobRevertRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.JobVersion)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.JobVersion)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.EnforcePriorVersion == nil { - r.EncodeNil() - } else { - yy10 := *x.EnforcePriorVersion - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(yy10)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EnforcePriorVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.EnforcePriorVersion == nil { - r.EncodeNil() - } else { - yy12 := *x.EnforcePriorVersion - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeUint(uint64(yy12)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym15 := z.EncBinary() - _ = yym15 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobRevertRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobRevertRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "JobID": - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv4 := &x.JobID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "JobVersion": - if r.TryDecodeAsNil() { - x.JobVersion = 0 - } else { - yyv6 := &x.JobVersion - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "EnforcePriorVersion": - if r.TryDecodeAsNil() { - if x.EnforcePriorVersion != nil { - x.EnforcePriorVersion = nil - } - } else { - if x.EnforcePriorVersion == nil { - x.EnforcePriorVersion = new(uint64) - } - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint64)(x.EnforcePriorVersion)) = uint64(r.DecodeUint(64)) - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv10 := &x.Region - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobRevertRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv13 := &x.JobID - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*string)(yyv13)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobVersion = 0 - } else { - yyv15 := &x.JobVersion - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*uint64)(yyv15)) = uint64(r.DecodeUint(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.EnforcePriorVersion != nil { - x.EnforcePriorVersion = nil - } - } else { - if x.EnforcePriorVersion == nil { - x.EnforcePriorVersion = new(uint64) - } - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*uint64)(x.EnforcePriorVersion)) = uint64(r.DecodeUint(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv19 := &x.Region - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobStabilityRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.JobVersion)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.JobVersion)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeBool(bool(x.Stable)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Stable")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeBool(bool(x.Stable)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobStabilityRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobStabilityRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "JobID": - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv4 := &x.JobID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "JobVersion": - if r.TryDecodeAsNil() { - x.JobVersion = 0 - } else { - yyv6 := &x.JobVersion - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "Stable": - if r.TryDecodeAsNil() { - x.Stable = false - } else { - yyv8 := &x.Stable - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*bool)(yyv8)) = r.DecodeBool() - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv10 := &x.Region - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobStabilityRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv13 := &x.JobID - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*string)(yyv13)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobVersion = 0 - } else { - yyv15 := &x.JobVersion - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*uint64)(yyv15)) = uint64(r.DecodeUint(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Stable = false - } else { - yyv17 := &x.Stable - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*bool)(yyv17)) = r.DecodeBool() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv19 := &x.Region - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobStabilityResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [1]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(1) - } else { - yynn2 = 1 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobStabilityResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobStabilityResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv4 := &x.Index - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*uint64)(yyv4)) = uint64(r.DecodeUint(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobStabilityResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj6 int - var yyb6 bool - var yyhl6 bool = l >= 0 - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv7 := &x.Index - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - *((*uint64)(yyv7)) = uint64(r.DecodeUint(64)) - } - } - for { - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj6-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *NodeListRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) - } else { - yynn2 = 5 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MinQueryIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MaxQueryTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllowStale")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Prefix")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *NodeListRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *NodeListRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv4 := &x.Region - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "MinQueryIndex": - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv6 := &x.MinQueryIndex - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "MaxQueryTime": - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv8 := &x.MaxQueryTime - yym9 := z.DecBinary() - _ = yym9 - if false { - } else if z.HasExtensions() && z.DecExt(yyv8) { - } else { - *((*int64)(yyv8)) = int64(r.DecodeInt(64)) - } - } - case "AllowStale": - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv10 := &x.AllowStale - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv12 := &x.Prefix - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *NodeListRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj14 int - var yyb14 bool - var yyhl14 bool = l >= 0 - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv15 := &x.Region - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv17 := &x.MinQueryIndex - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*uint64)(yyv17)) = uint64(r.DecodeUint(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv19 := &x.MaxQueryTime - yym20 := z.DecBinary() - _ = yym20 - if false { - } else if z.HasExtensions() && z.DecExt(yyv19) { - } else { - *((*int64)(yyv19)) = int64(r.DecodeInt(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv21 := &x.AllowStale - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*bool)(yyv21)) = r.DecodeBool() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv23 := &x.Prefix - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*string)(yyv23)) = r.DecodeString() - } - } - for { - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj14-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *EvalUpdateRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Evals == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSlicePtrtoEvaluation(([]*Evaluation)(x.Evals), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Evals")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Evals == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSlicePtrtoEvaluation(([]*Evaluation)(x.Evals), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalToken)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EvalToken")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalToken)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *EvalUpdateRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *EvalUpdateRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Evals": - if r.TryDecodeAsNil() { - x.Evals = nil - } else { - yyv4 := &x.Evals - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSlicePtrtoEvaluation((*[]*Evaluation)(yyv4), d) - } - } - case "EvalToken": - if r.TryDecodeAsNil() { - x.EvalToken = "" - } else { - yyv6 := &x.EvalToken - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv8 := &x.Region - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *EvalUpdateRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Evals = nil - } else { - yyv11 := &x.Evals - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - h.decSlicePtrtoEvaluation((*[]*Evaluation)(yyv11), d) - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EvalToken = "" - } else { - yyv13 := &x.EvalToken - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*string)(yyv13)) = r.DecodeString() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv15 := &x.Region - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj10-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *EvalDeleteRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Evals == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - z.F.EncSliceStringV(x.Evals, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Evals")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Evals == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - z.F.EncSliceStringV(x.Evals, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Allocs == nil { - r.EncodeNil() - } else { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - z.F.EncSliceStringV(x.Allocs, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Allocs")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Allocs == nil { - r.EncodeNil() - } else { - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - z.F.EncSliceStringV(x.Allocs, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *EvalDeleteRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *EvalDeleteRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Evals": - if r.TryDecodeAsNil() { - x.Evals = nil - } else { - yyv4 := &x.Evals - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - z.F.DecSliceStringX(yyv4, false, d) - } - } - case "Allocs": - if r.TryDecodeAsNil() { - x.Allocs = nil - } else { - yyv6 := &x.Allocs - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - z.F.DecSliceStringX(yyv6, false, d) - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv8 := &x.Region - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *EvalDeleteRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Evals = nil - } else { - yyv11 := &x.Evals - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - z.F.DecSliceStringX(yyv11, false, d) - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Allocs = nil - } else { - yyv13 := &x.Allocs - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - z.F.DecSliceStringX(yyv13, false, d) - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv15 := &x.Region - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj10-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *EvalSpecificRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [6]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(6) - } else { - yynn2 = 6 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EvalID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MinQueryIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MaxQueryTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllowStale")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Prefix")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *EvalSpecificRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *EvalSpecificRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "EvalID": - if r.TryDecodeAsNil() { - x.EvalID = "" - } else { - yyv4 := &x.EvalID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv6 := &x.Region - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "MinQueryIndex": - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv8 := &x.MinQueryIndex - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint64)(yyv8)) = uint64(r.DecodeUint(64)) - } - } - case "MaxQueryTime": - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv10 := &x.MaxQueryTime - yym11 := z.DecBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.DecExt(yyv10) { - } else { - *((*int64)(yyv10)) = int64(r.DecodeInt(64)) - } - } - case "AllowStale": - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv12 := &x.AllowStale - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*bool)(yyv12)) = r.DecodeBool() - } - } - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv14 := &x.Prefix - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*string)(yyv14)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *EvalSpecificRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj16 int - var yyb16 bool - var yyhl16 bool = l >= 0 - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EvalID = "" - } else { - yyv17 := &x.EvalID - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(yyv17)) = r.DecodeString() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv19 := &x.Region - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv21 := &x.MinQueryIndex - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*uint64)(yyv21)) = uint64(r.DecodeUint(64)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv23 := &x.MaxQueryTime - yym24 := z.DecBinary() - _ = yym24 - if false { - } else if z.HasExtensions() && z.DecExt(yyv23) { - } else { - *((*int64)(yyv23)) = int64(r.DecodeInt(64)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv25 := &x.AllowStale - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*bool)(yyv25)) = r.DecodeBool() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv27 := &x.Prefix - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*string)(yyv27)) = r.DecodeString() - } - } - for { - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj16-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *EvalAckRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EvalID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Token)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Token")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Token)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *EvalAckRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *EvalAckRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "EvalID": - if r.TryDecodeAsNil() { - x.EvalID = "" - } else { - yyv4 := &x.EvalID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Token": - if r.TryDecodeAsNil() { - x.Token = "" - } else { - yyv6 := &x.Token - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv8 := &x.Region - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *EvalAckRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EvalID = "" - } else { - yyv11 := &x.EvalID - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*string)(yyv11)) = r.DecodeString() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Token = "" - } else { - yyv13 := &x.Token - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*string)(yyv13)) = r.DecodeString() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv15 := &x.Region - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj10-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *EvalDequeueRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Schedulers == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - z.F.EncSliceStringV(x.Schedulers, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Schedulers")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Schedulers == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - z.F.EncSliceStringV(x.Schedulers, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else if z.HasExtensions() && z.EncExt(x.Timeout) { - } else { - r.EncodeInt(int64(x.Timeout)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Timeout")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else if z.HasExtensions() && z.EncExt(x.Timeout) { - } else { - r.EncodeInt(int64(x.Timeout)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.SchedulerVersion)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("SchedulerVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.SchedulerVersion)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *EvalDequeueRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *EvalDequeueRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Schedulers": - if r.TryDecodeAsNil() { - x.Schedulers = nil - } else { - yyv4 := &x.Schedulers - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - z.F.DecSliceStringX(yyv4, false, d) - } - } - case "Timeout": - if r.TryDecodeAsNil() { - x.Timeout = 0 - } else { - yyv6 := &x.Timeout - yym7 := z.DecBinary() - _ = yym7 - if false { - } else if z.HasExtensions() && z.DecExt(yyv6) { - } else { - *((*int64)(yyv6)) = int64(r.DecodeInt(64)) - } - } - case "SchedulerVersion": - if r.TryDecodeAsNil() { - x.SchedulerVersion = 0 - } else { - yyv8 := &x.SchedulerVersion - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint16)(yyv8)) = uint16(r.DecodeUint(16)) - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv10 := &x.Region - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *EvalDequeueRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Schedulers = nil - } else { - yyv13 := &x.Schedulers - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - z.F.DecSliceStringX(yyv13, false, d) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Timeout = 0 - } else { - yyv15 := &x.Timeout - yym16 := z.DecBinary() - _ = yym16 - if false { - } else if z.HasExtensions() && z.DecExt(yyv15) { - } else { - *((*int64)(yyv15)) = int64(r.DecodeInt(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.SchedulerVersion = 0 - } else { - yyv17 := &x.SchedulerVersion - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*uint16)(yyv17)) = uint16(r.DecodeUint(16)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv19 := &x.Region - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *EvalListRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) - } else { - yynn2 = 5 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MinQueryIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MaxQueryTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllowStale")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Prefix")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *EvalListRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *EvalListRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv4 := &x.Region - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "MinQueryIndex": - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv6 := &x.MinQueryIndex - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "MaxQueryTime": - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv8 := &x.MaxQueryTime - yym9 := z.DecBinary() - _ = yym9 - if false { - } else if z.HasExtensions() && z.DecExt(yyv8) { - } else { - *((*int64)(yyv8)) = int64(r.DecodeInt(64)) - } - } - case "AllowStale": - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv10 := &x.AllowStale - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv12 := &x.Prefix - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *EvalListRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj14 int - var yyb14 bool - var yyhl14 bool = l >= 0 - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv15 := &x.Region - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv17 := &x.MinQueryIndex - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*uint64)(yyv17)) = uint64(r.DecodeUint(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv19 := &x.MaxQueryTime - yym20 := z.DecBinary() - _ = yym20 - if false { - } else if z.HasExtensions() && z.DecExt(yyv19) { - } else { - *((*int64)(yyv19)) = int64(r.DecodeInt(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv21 := &x.AllowStale - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*bool)(yyv21)) = r.DecodeBool() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv23 := &x.Prefix - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*string)(yyv23)) = r.DecodeString() - } - } - for { - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj14-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *PlanRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Plan == nil { - r.EncodeNil() - } else { - x.Plan.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Plan")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Plan == nil { - r.EncodeNil() - } else { - x.Plan.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *PlanRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *PlanRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Plan": - if r.TryDecodeAsNil() { - if x.Plan != nil { - x.Plan = nil - } - } else { - if x.Plan == nil { - x.Plan = new(Plan) - } - x.Plan.CodecDecodeSelf(d) - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv5 := &x.Region - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - *((*string)(yyv5)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *PlanRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj7 int - var yyb7 bool - var yyhl7 bool = l >= 0 - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Plan != nil { - x.Plan = nil - } - } else { - if x.Plan == nil { - x.Plan = new(Plan) - } - x.Plan.CodecDecodeSelf(d) - } - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv9 := &x.Region - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*string)(yyv9)) = r.DecodeString() - } - } - for { - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj7-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *ApplyPlanResultsRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) - } else { - yynn2 = 5 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Alloc == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSlicePtrtoAllocation(([]*Allocation)(x.Alloc), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Alloc")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Alloc == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSlicePtrtoAllocation(([]*Allocation)(x.Alloc), e) - } - } - } - var yyn6 bool - if x.AllocUpdateRequest.Job == nil { - yyn6 = true - goto LABEL6 - } - LABEL6: - if yyr2 || yy2arr2 { - if yyn6 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Job == nil { - r.EncodeNil() - } else { - x.Job.CodecEncodeSelf(e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Job")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if yyn6 { - r.EncodeNil() - } else { - if x.Job == nil { - r.EncodeNil() - } else { - x.Job.CodecEncodeSelf(e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Deployment == nil { - r.EncodeNil() - } else { - x.Deployment.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Deployment")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Deployment == nil { - r.EncodeNil() - } else { - x.Deployment.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.DeploymentUpdates == nil { - r.EncodeNil() - } else { - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - h.encSlicePtrtoDeploymentStatusUpdate(([]*DeploymentStatusUpdate)(x.DeploymentUpdates), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DeploymentUpdates")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.DeploymentUpdates == nil { - r.EncodeNil() - } else { - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - h.encSlicePtrtoDeploymentStatusUpdate(([]*DeploymentStatusUpdate)(x.DeploymentUpdates), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *ApplyPlanResultsRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *ApplyPlanResultsRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Alloc": - if r.TryDecodeAsNil() { - x.Alloc = nil - } else { - yyv4 := &x.Alloc - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSlicePtrtoAllocation((*[]*Allocation)(yyv4), d) - } - } - case "Job": - if x.AllocUpdateRequest.Job == nil { - x.AllocUpdateRequest.Job = new(Job) - } - if r.TryDecodeAsNil() { - if x.Job != nil { - x.Job = nil - } - } else { - if x.Job == nil { - x.Job = new(Job) - } - x.Job.CodecDecodeSelf(d) - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv7 := &x.Region - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - *((*string)(yyv7)) = r.DecodeString() - } - } - case "Deployment": - if r.TryDecodeAsNil() { - if x.Deployment != nil { - x.Deployment = nil - } - } else { - if x.Deployment == nil { - x.Deployment = new(Deployment) - } - x.Deployment.CodecDecodeSelf(d) - } - case "DeploymentUpdates": - if r.TryDecodeAsNil() { - x.DeploymentUpdates = nil - } else { - yyv10 := &x.DeploymentUpdates - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - h.decSlicePtrtoDeploymentStatusUpdate((*[]*DeploymentStatusUpdate)(yyv10), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *ApplyPlanResultsRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Alloc = nil - } else { - yyv13 := &x.Alloc - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - h.decSlicePtrtoAllocation((*[]*Allocation)(yyv13), d) - } - } - if x.AllocUpdateRequest.Job == nil { - x.AllocUpdateRequest.Job = new(Job) - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Job != nil { - x.Job = nil - } - } else { - if x.Job == nil { - x.Job = new(Job) - } - x.Job.CodecDecodeSelf(d) - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv16 := &x.Region - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*string)(yyv16)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Deployment != nil { - x.Deployment = nil - } - } else { - if x.Deployment == nil { - x.Deployment = new(Deployment) - } - x.Deployment.CodecDecodeSelf(d) - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DeploymentUpdates = nil - } else { - yyv19 := &x.DeploymentUpdates - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - h.decSlicePtrtoDeploymentStatusUpdate((*[]*DeploymentStatusUpdate)(yyv19), d) - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *AllocUpdateRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Alloc == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSlicePtrtoAllocation(([]*Allocation)(x.Alloc), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Alloc")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Alloc == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSlicePtrtoAllocation(([]*Allocation)(x.Alloc), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Job == nil { - r.EncodeNil() - } else { - x.Job.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Job")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Job == nil { - r.EncodeNil() - } else { - x.Job.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *AllocUpdateRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *AllocUpdateRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Alloc": - if r.TryDecodeAsNil() { - x.Alloc = nil - } else { - yyv4 := &x.Alloc - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSlicePtrtoAllocation((*[]*Allocation)(yyv4), d) - } - } - case "Job": - if r.TryDecodeAsNil() { - if x.Job != nil { - x.Job = nil - } - } else { - if x.Job == nil { - x.Job = new(Job) - } - x.Job.CodecDecodeSelf(d) - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv7 := &x.Region - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - *((*string)(yyv7)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *AllocUpdateRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj9 int - var yyb9 bool - var yyhl9 bool = l >= 0 - yyj9++ - if yyhl9 { - yyb9 = yyj9 > l - } else { - yyb9 = r.CheckBreak() - } - if yyb9 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Alloc = nil - } else { - yyv10 := &x.Alloc - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - h.decSlicePtrtoAllocation((*[]*Allocation)(yyv10), d) - } - } - yyj9++ - if yyhl9 { - yyb9 = yyj9 > l - } else { - yyb9 = r.CheckBreak() - } - if yyb9 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Job != nil { - x.Job = nil - } - } else { - if x.Job == nil { - x.Job = new(Job) - } - x.Job.CodecDecodeSelf(d) - } - yyj9++ - if yyhl9 { - yyb9 = yyj9 > l - } else { - yyb9 = r.CheckBreak() - } - if yyb9 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv13 := &x.Region - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*string)(yyv13)) = r.DecodeString() - } - } - for { - yyj9++ - if yyhl9 { - yyb9 = yyj9 > l - } else { - yyb9 = r.CheckBreak() - } - if yyb9 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj9-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *AllocListRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) - } else { - yynn2 = 5 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MinQueryIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MaxQueryTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllowStale")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Prefix")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *AllocListRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *AllocListRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv4 := &x.Region - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "MinQueryIndex": - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv6 := &x.MinQueryIndex - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "MaxQueryTime": - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv8 := &x.MaxQueryTime - yym9 := z.DecBinary() - _ = yym9 - if false { - } else if z.HasExtensions() && z.DecExt(yyv8) { - } else { - *((*int64)(yyv8)) = int64(r.DecodeInt(64)) - } - } - case "AllowStale": - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv10 := &x.AllowStale - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv12 := &x.Prefix - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *AllocListRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj14 int - var yyb14 bool - var yyhl14 bool = l >= 0 - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv15 := &x.Region - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv17 := &x.MinQueryIndex - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*uint64)(yyv17)) = uint64(r.DecodeUint(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv19 := &x.MaxQueryTime - yym20 := z.DecBinary() - _ = yym20 - if false { - } else if z.HasExtensions() && z.DecExt(yyv19) { - } else { - *((*int64)(yyv19)) = int64(r.DecodeInt(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv21 := &x.AllowStale - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*bool)(yyv21)) = r.DecodeBool() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv23 := &x.Prefix - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*string)(yyv23)) = r.DecodeString() - } - } - for { - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj14-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *AllocSpecificRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [6]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(6) - } else { - yynn2 = 6 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.AllocID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllocID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.AllocID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MinQueryIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MaxQueryTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllowStale")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Prefix")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *AllocSpecificRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *AllocSpecificRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "AllocID": - if r.TryDecodeAsNil() { - x.AllocID = "" - } else { - yyv4 := &x.AllocID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv6 := &x.Region - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "MinQueryIndex": - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv8 := &x.MinQueryIndex - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint64)(yyv8)) = uint64(r.DecodeUint(64)) - } - } - case "MaxQueryTime": - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv10 := &x.MaxQueryTime - yym11 := z.DecBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.DecExt(yyv10) { - } else { - *((*int64)(yyv10)) = int64(r.DecodeInt(64)) - } - } - case "AllowStale": - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv12 := &x.AllowStale - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*bool)(yyv12)) = r.DecodeBool() - } - } - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv14 := &x.Prefix - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*string)(yyv14)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *AllocSpecificRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj16 int - var yyb16 bool - var yyhl16 bool = l >= 0 - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllocID = "" - } else { - yyv17 := &x.AllocID - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(yyv17)) = r.DecodeString() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv19 := &x.Region - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv21 := &x.MinQueryIndex - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*uint64)(yyv21)) = uint64(r.DecodeUint(64)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv23 := &x.MaxQueryTime - yym24 := z.DecBinary() - _ = yym24 - if false { - } else if z.HasExtensions() && z.DecExt(yyv23) { - } else { - *((*int64)(yyv23)) = int64(r.DecodeInt(64)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv25 := &x.AllowStale - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*bool)(yyv25)) = r.DecodeBool() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv27 := &x.Prefix - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*string)(yyv27)) = r.DecodeString() - } - } - for { - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj16-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *AllocsGetRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [6]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(6) - } else { - yynn2 = 6 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.AllocIDs == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - z.F.EncSliceStringV(x.AllocIDs, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllocIDs")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.AllocIDs == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - z.F.EncSliceStringV(x.AllocIDs, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MinQueryIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MaxQueryTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllowStale")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Prefix")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *AllocsGetRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *AllocsGetRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "AllocIDs": - if r.TryDecodeAsNil() { - x.AllocIDs = nil - } else { - yyv4 := &x.AllocIDs - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - z.F.DecSliceStringX(yyv4, false, d) - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv6 := &x.Region - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "MinQueryIndex": - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv8 := &x.MinQueryIndex - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint64)(yyv8)) = uint64(r.DecodeUint(64)) - } - } - case "MaxQueryTime": - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv10 := &x.MaxQueryTime - yym11 := z.DecBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.DecExt(yyv10) { - } else { - *((*int64)(yyv10)) = int64(r.DecodeInt(64)) - } - } - case "AllowStale": - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv12 := &x.AllowStale - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*bool)(yyv12)) = r.DecodeBool() - } - } - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv14 := &x.Prefix - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*string)(yyv14)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *AllocsGetRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj16 int - var yyb16 bool - var yyhl16 bool = l >= 0 - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllocIDs = nil - } else { - yyv17 := &x.AllocIDs - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - z.F.DecSliceStringX(yyv17, false, d) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv19 := &x.Region - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv21 := &x.MinQueryIndex - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*uint64)(yyv21)) = uint64(r.DecodeUint(64)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv23 := &x.MaxQueryTime - yym24 := z.DecBinary() - _ = yym24 - if false { - } else if z.HasExtensions() && z.DecExt(yyv23) { - } else { - *((*int64)(yyv23)) = int64(r.DecodeInt(64)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv25 := &x.AllowStale - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*bool)(yyv25)) = r.DecodeBool() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv27 := &x.Prefix - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*string)(yyv27)) = r.DecodeString() - } - } - for { - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj16-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *PeriodicForceRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *PeriodicForceRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *PeriodicForceRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "JobID": - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv4 := &x.JobID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv6 := &x.Region - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *PeriodicForceRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj8 int - var yyb8 bool - var yyhl8 bool = l >= 0 - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv9 := &x.JobID - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*string)(yyv9)) = r.DecodeString() - } - } - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv11 := &x.Region - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*string)(yyv11)) = r.DecodeString() - } - } - for { - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj8-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *ServerMembersResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ServerName)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ServerName")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ServerName)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ServerRegion)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ServerRegion")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ServerRegion)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ServerDC)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ServerDC")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ServerDC)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Members == nil { - r.EncodeNil() - } else { - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - h.encSlicePtrtoServerMember(([]*ServerMember)(x.Members), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Members")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Members == nil { - r.EncodeNil() - } else { - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - h.encSlicePtrtoServerMember(([]*ServerMember)(x.Members), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *ServerMembersResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *ServerMembersResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "ServerName": - if r.TryDecodeAsNil() { - x.ServerName = "" - } else { - yyv4 := &x.ServerName - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "ServerRegion": - if r.TryDecodeAsNil() { - x.ServerRegion = "" - } else { - yyv6 := &x.ServerRegion - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "ServerDC": - if r.TryDecodeAsNil() { - x.ServerDC = "" - } else { - yyv8 := &x.ServerDC - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "Members": - if r.TryDecodeAsNil() { - x.Members = nil - } else { - yyv10 := &x.Members - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - h.decSlicePtrtoServerMember((*[]*ServerMember)(yyv10), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *ServerMembersResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ServerName = "" - } else { - yyv13 := &x.ServerName - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*string)(yyv13)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ServerRegion = "" - } else { - yyv15 := &x.ServerRegion - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ServerDC = "" - } else { - yyv17 := &x.ServerDC - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(yyv17)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Members = nil - } else { - yyv19 := &x.Members - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - h.decSlicePtrtoServerMember((*[]*ServerMember)(yyv19), d) - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *ServerMember) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [11]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(11) - } else { - yynn2 = 11 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Name")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Addr == nil { - r.EncodeNil() - } else { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else if z.HasExtensions() && z.EncExt(x.Addr) { - } else if !yym7 { - z.EncTextMarshal(x.Addr) - } else { - h.encnet_IP((net.IP)(x.Addr), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Addr")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Addr == nil { - r.EncodeNil() - } else { - yym8 := z.EncBinary() - _ = yym8 - if false { - } else if z.HasExtensions() && z.EncExt(x.Addr) { - } else if !yym8 { - z.EncTextMarshal(x.Addr) - } else { - h.encnet_IP((net.IP)(x.Addr), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.Port)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Port")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.Port)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Tags == nil { - r.EncodeNil() - } else { - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - z.F.EncMapStringStringV(x.Tags, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Tags")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Tags == nil { - r.EncodeNil() - } else { - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - z.F.EncMapStringStringV(x.Tags, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Status)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Status")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Status)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeUint(uint64(x.ProtocolMin)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ProtocolMin")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeUint(uint64(x.ProtocolMin)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeUint(uint64(x.ProtocolMax)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ProtocolMax")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeUint(uint64(x.ProtocolMax)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym25 := z.EncBinary() - _ = yym25 - if false { - } else { - r.EncodeUint(uint64(x.ProtocolCur)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ProtocolCur")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - r.EncodeUint(uint64(x.ProtocolCur)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym28 := z.EncBinary() - _ = yym28 - if false { - } else { - r.EncodeUint(uint64(x.DelegateMin)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DelegateMin")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym29 := z.EncBinary() - _ = yym29 - if false { - } else { - r.EncodeUint(uint64(x.DelegateMin)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym31 := z.EncBinary() - _ = yym31 - if false { - } else { - r.EncodeUint(uint64(x.DelegateMax)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DelegateMax")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym32 := z.EncBinary() - _ = yym32 - if false { - } else { - r.EncodeUint(uint64(x.DelegateMax)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym34 := z.EncBinary() - _ = yym34 - if false { - } else { - r.EncodeUint(uint64(x.DelegateCur)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DelegateCur")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym35 := z.EncBinary() - _ = yym35 - if false { - } else { - r.EncodeUint(uint64(x.DelegateCur)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *ServerMember) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *ServerMember) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv4 := &x.Name - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Addr": - if r.TryDecodeAsNil() { - x.Addr = nil - } else { - yyv6 := &x.Addr - yym7 := z.DecBinary() - _ = yym7 - if false { - } else if z.HasExtensions() && z.DecExt(yyv6) { - } else if !yym7 { - z.DecTextUnmarshal(yyv6) - } else { - h.decnet_IP((*net.IP)(yyv6), d) - } - } - case "Port": - if r.TryDecodeAsNil() { - x.Port = 0 - } else { - yyv8 := &x.Port - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint16)(yyv8)) = uint16(r.DecodeUint(16)) - } - } - case "Tags": - if r.TryDecodeAsNil() { - x.Tags = nil - } else { - yyv10 := &x.Tags - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - z.F.DecMapStringStringX(yyv10, false, d) - } - } - case "Status": - if r.TryDecodeAsNil() { - x.Status = "" - } else { - yyv12 := &x.Status - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - case "ProtocolMin": - if r.TryDecodeAsNil() { - x.ProtocolMin = 0 - } else { - yyv14 := &x.ProtocolMin - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*uint8)(yyv14)) = uint8(r.DecodeUint(8)) - } - } - case "ProtocolMax": - if r.TryDecodeAsNil() { - x.ProtocolMax = 0 - } else { - yyv16 := &x.ProtocolMax - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*uint8)(yyv16)) = uint8(r.DecodeUint(8)) - } - } - case "ProtocolCur": - if r.TryDecodeAsNil() { - x.ProtocolCur = 0 - } else { - yyv18 := &x.ProtocolCur - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - *((*uint8)(yyv18)) = uint8(r.DecodeUint(8)) - } - } - case "DelegateMin": - if r.TryDecodeAsNil() { - x.DelegateMin = 0 - } else { - yyv20 := &x.DelegateMin - yym21 := z.DecBinary() - _ = yym21 - if false { - } else { - *((*uint8)(yyv20)) = uint8(r.DecodeUint(8)) - } - } - case "DelegateMax": - if r.TryDecodeAsNil() { - x.DelegateMax = 0 - } else { - yyv22 := &x.DelegateMax - yym23 := z.DecBinary() - _ = yym23 - if false { - } else { - *((*uint8)(yyv22)) = uint8(r.DecodeUint(8)) - } - } - case "DelegateCur": - if r.TryDecodeAsNil() { - x.DelegateCur = 0 - } else { - yyv24 := &x.DelegateCur - yym25 := z.DecBinary() - _ = yym25 - if false { - } else { - *((*uint8)(yyv24)) = uint8(r.DecodeUint(8)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *ServerMember) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj26 int - var yyb26 bool - var yyhl26 bool = l >= 0 - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv27 := &x.Name - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*string)(yyv27)) = r.DecodeString() - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Addr = nil - } else { - yyv29 := &x.Addr - yym30 := z.DecBinary() - _ = yym30 - if false { - } else if z.HasExtensions() && z.DecExt(yyv29) { - } else if !yym30 { - z.DecTextUnmarshal(yyv29) - } else { - h.decnet_IP((*net.IP)(yyv29), d) - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Port = 0 - } else { - yyv31 := &x.Port - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - *((*uint16)(yyv31)) = uint16(r.DecodeUint(16)) - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Tags = nil - } else { - yyv33 := &x.Tags - yym34 := z.DecBinary() - _ = yym34 - if false { - } else { - z.F.DecMapStringStringX(yyv33, false, d) - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Status = "" - } else { - yyv35 := &x.Status - yym36 := z.DecBinary() - _ = yym36 - if false { - } else { - *((*string)(yyv35)) = r.DecodeString() - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ProtocolMin = 0 - } else { - yyv37 := &x.ProtocolMin - yym38 := z.DecBinary() - _ = yym38 - if false { - } else { - *((*uint8)(yyv37)) = uint8(r.DecodeUint(8)) - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ProtocolMax = 0 - } else { - yyv39 := &x.ProtocolMax - yym40 := z.DecBinary() - _ = yym40 - if false { - } else { - *((*uint8)(yyv39)) = uint8(r.DecodeUint(8)) - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ProtocolCur = 0 - } else { - yyv41 := &x.ProtocolCur - yym42 := z.DecBinary() - _ = yym42 - if false { - } else { - *((*uint8)(yyv41)) = uint8(r.DecodeUint(8)) - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DelegateMin = 0 - } else { - yyv43 := &x.DelegateMin - yym44 := z.DecBinary() - _ = yym44 - if false { - } else { - *((*uint8)(yyv43)) = uint8(r.DecodeUint(8)) - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DelegateMax = 0 - } else { - yyv45 := &x.DelegateMax - yym46 := z.DecBinary() - _ = yym46 - if false { - } else { - *((*uint8)(yyv45)) = uint8(r.DecodeUint(8)) - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DelegateCur = 0 - } else { - yyv47 := &x.DelegateCur - yym48 := z.DecBinary() - _ = yym48 - if false { - } else { - *((*uint8)(yyv47)) = uint8(r.DecodeUint(8)) - } - } - for { - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj26-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *DeriveVaultTokenRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [9]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(9) - } else { - yynn2 = 9 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodeID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.SecretID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("SecretID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.SecretID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.AllocID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllocID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.AllocID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Tasks == nil { - r.EncodeNil() - } else { - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - z.F.EncSliceStringV(x.Tasks, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Tasks")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Tasks == nil { - r.EncodeNil() - } else { - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - z.F.EncSliceStringV(x.Tasks, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MinQueryIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MaxQueryTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym25 := z.EncBinary() - _ = yym25 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllowStale")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym28 := z.EncBinary() - _ = yym28 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Prefix")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym29 := z.EncBinary() - _ = yym29 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *DeriveVaultTokenRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *DeriveVaultTokenRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "NodeID": - if r.TryDecodeAsNil() { - x.NodeID = "" - } else { - yyv4 := &x.NodeID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "SecretID": - if r.TryDecodeAsNil() { - x.SecretID = "" - } else { - yyv6 := &x.SecretID - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "AllocID": - if r.TryDecodeAsNil() { - x.AllocID = "" - } else { - yyv8 := &x.AllocID - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "Tasks": - if r.TryDecodeAsNil() { - x.Tasks = nil - } else { - yyv10 := &x.Tasks - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - z.F.DecSliceStringX(yyv10, false, d) - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv12 := &x.Region - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - case "MinQueryIndex": - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv14 := &x.MinQueryIndex - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*uint64)(yyv14)) = uint64(r.DecodeUint(64)) - } - } - case "MaxQueryTime": - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv16 := &x.MaxQueryTime - yym17 := z.DecBinary() - _ = yym17 - if false { - } else if z.HasExtensions() && z.DecExt(yyv16) { - } else { - *((*int64)(yyv16)) = int64(r.DecodeInt(64)) - } - } - case "AllowStale": - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv18 := &x.AllowStale - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - *((*bool)(yyv18)) = r.DecodeBool() - } - } - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv20 := &x.Prefix - yym21 := z.DecBinary() - _ = yym21 - if false { - } else { - *((*string)(yyv20)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *DeriveVaultTokenRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj22 int - var yyb22 bool - var yyhl22 bool = l >= 0 - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodeID = "" - } else { - yyv23 := &x.NodeID - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*string)(yyv23)) = r.DecodeString() - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.SecretID = "" - } else { - yyv25 := &x.SecretID - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*string)(yyv25)) = r.DecodeString() - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllocID = "" - } else { - yyv27 := &x.AllocID - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*string)(yyv27)) = r.DecodeString() - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Tasks = nil - } else { - yyv29 := &x.Tasks - yym30 := z.DecBinary() - _ = yym30 - if false { - } else { - z.F.DecSliceStringX(yyv29, false, d) - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv31 := &x.Region - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - *((*string)(yyv31)) = r.DecodeString() - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv33 := &x.MinQueryIndex - yym34 := z.DecBinary() - _ = yym34 - if false { - } else { - *((*uint64)(yyv33)) = uint64(r.DecodeUint(64)) - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv35 := &x.MaxQueryTime - yym36 := z.DecBinary() - _ = yym36 - if false { - } else if z.HasExtensions() && z.DecExt(yyv35) { - } else { - *((*int64)(yyv35)) = int64(r.DecodeInt(64)) - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv37 := &x.AllowStale - yym38 := z.DecBinary() - _ = yym38 - if false { - } else { - *((*bool)(yyv37)) = r.DecodeBool() - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv39 := &x.Prefix - yym40 := z.DecBinary() - _ = yym40 - if false { - } else { - *((*string)(yyv39)) = r.DecodeString() - } - } - for { - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj22-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *VaultAccessorsRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [1]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(1) - } else { - yynn2 = 1 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Accessors == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSlicePtrtoVaultAccessor(([]*VaultAccessor)(x.Accessors), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Accessors")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Accessors == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSlicePtrtoVaultAccessor(([]*VaultAccessor)(x.Accessors), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *VaultAccessorsRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *VaultAccessorsRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Accessors": - if r.TryDecodeAsNil() { - x.Accessors = nil - } else { - yyv4 := &x.Accessors - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSlicePtrtoVaultAccessor((*[]*VaultAccessor)(yyv4), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *VaultAccessorsRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj6 int - var yyb6 bool - var yyhl6 bool = l >= 0 - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Accessors = nil - } else { - yyv7 := &x.Accessors - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - h.decSlicePtrtoVaultAccessor((*[]*VaultAccessor)(yyv7), d) - } - } - for { - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj6-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *VaultAccessor) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [6]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(6) - } else { - yynn2 = 6 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.AllocID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllocID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.AllocID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Task)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Task")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Task)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodeID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Accessor)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Accessor")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Accessor)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeInt(int64(x.CreationTTL)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("CreationTTL")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeInt(int64(x.CreationTTL)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("CreateIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *VaultAccessor) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *VaultAccessor) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "AllocID": - if r.TryDecodeAsNil() { - x.AllocID = "" - } else { - yyv4 := &x.AllocID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Task": - if r.TryDecodeAsNil() { - x.Task = "" - } else { - yyv6 := &x.Task - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "NodeID": - if r.TryDecodeAsNil() { - x.NodeID = "" - } else { - yyv8 := &x.NodeID - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "Accessor": - if r.TryDecodeAsNil() { - x.Accessor = "" - } else { - yyv10 := &x.Accessor - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - case "CreationTTL": - if r.TryDecodeAsNil() { - x.CreationTTL = 0 - } else { - yyv12 := &x.CreationTTL - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*int)(yyv12)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "CreateIndex": - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv14 := &x.CreateIndex - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*uint64)(yyv14)) = uint64(r.DecodeUint(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *VaultAccessor) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj16 int - var yyb16 bool - var yyhl16 bool = l >= 0 - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllocID = "" - } else { - yyv17 := &x.AllocID - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(yyv17)) = r.DecodeString() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Task = "" - } else { - yyv19 := &x.Task - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodeID = "" - } else { - yyv21 := &x.NodeID - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*string)(yyv21)) = r.DecodeString() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Accessor = "" - } else { - yyv23 := &x.Accessor - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*string)(yyv23)) = r.DecodeString() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.CreationTTL = 0 - } else { - yyv25 := &x.CreationTTL - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*int)(yyv25)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv27 := &x.CreateIndex - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*uint64)(yyv27)) = uint64(r.DecodeUint(64)) - } - } - for { - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj16-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *DeriveVaultTokenResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) - } else { - yynn2 = 5 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Tasks == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - z.F.EncMapStringStringV(x.Tasks, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Tasks")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Tasks == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - z.F.EncMapStringStringV(x.Tasks, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Error == nil { - r.EncodeNil() - } else { - x.Error.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Error")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Error == nil { - r.EncodeNil() - } else { - x.Error.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *DeriveVaultTokenResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *DeriveVaultTokenResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Tasks": - if r.TryDecodeAsNil() { - x.Tasks = nil - } else { - yyv4 := &x.Tasks - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - z.F.DecMapStringStringX(yyv4, false, d) - } - } - case "Error": - if r.TryDecodeAsNil() { - if x.Error != nil { - x.Error = nil - } - } else { - if x.Error == nil { - x.Error = new(RecoverableError) - } - x.Error.CodecDecodeSelf(d) - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv7 := &x.Index - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - *((*uint64)(yyv7)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv9 := &x.LastContact - yym10 := z.DecBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.DecExt(yyv9) { - } else { - *((*int64)(yyv9)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv11 := &x.KnownLeader - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*bool)(yyv11)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *DeriveVaultTokenResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj13 int - var yyb13 bool - var yyhl13 bool = l >= 0 - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Tasks = nil - } else { - yyv14 := &x.Tasks - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - z.F.DecMapStringStringX(yyv14, false, d) - } - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Error != nil { - x.Error = nil - } - } else { - if x.Error == nil { - x.Error = new(RecoverableError) - } - x.Error.CodecDecodeSelf(d) - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv17 := &x.Index - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*uint64)(yyv17)) = uint64(r.DecodeUint(64)) - } - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv19 := &x.LastContact - yym20 := z.DecBinary() - _ = yym20 - if false { - } else if z.HasExtensions() && z.DecExt(yyv19) { - } else { - *((*int64)(yyv19)) = int64(r.DecodeInt(64)) - } - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv21 := &x.KnownLeader - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*bool)(yyv21)) = r.DecodeBool() - } - } - for { - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj13-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *GenericRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) - } else { - yynn2 = 5 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MinQueryIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MaxQueryTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllowStale")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Prefix")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *GenericRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *GenericRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv4 := &x.Region - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "MinQueryIndex": - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv6 := &x.MinQueryIndex - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "MaxQueryTime": - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv8 := &x.MaxQueryTime - yym9 := z.DecBinary() - _ = yym9 - if false { - } else if z.HasExtensions() && z.DecExt(yyv8) { - } else { - *((*int64)(yyv8)) = int64(r.DecodeInt(64)) - } - } - case "AllowStale": - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv10 := &x.AllowStale - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv12 := &x.Prefix - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *GenericRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj14 int - var yyb14 bool - var yyhl14 bool = l >= 0 - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv15 := &x.Region - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv17 := &x.MinQueryIndex - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*uint64)(yyv17)) = uint64(r.DecodeUint(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv19 := &x.MaxQueryTime - yym20 := z.DecBinary() - _ = yym20 - if false { - } else if z.HasExtensions() && z.DecExt(yyv19) { - } else { - *((*int64)(yyv19)) = int64(r.DecodeInt(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv21 := &x.AllowStale - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*bool)(yyv21)) = r.DecodeBool() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv23 := &x.Prefix - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*string)(yyv23)) = r.DecodeString() - } - } - for { - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj14-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *DeploymentListRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) - } else { - yynn2 = 5 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MinQueryIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MaxQueryTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllowStale")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Prefix")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *DeploymentListRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *DeploymentListRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv4 := &x.Region - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "MinQueryIndex": - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv6 := &x.MinQueryIndex - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "MaxQueryTime": - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv8 := &x.MaxQueryTime - yym9 := z.DecBinary() - _ = yym9 - if false { - } else if z.HasExtensions() && z.DecExt(yyv8) { - } else { - *((*int64)(yyv8)) = int64(r.DecodeInt(64)) - } - } - case "AllowStale": - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv10 := &x.AllowStale - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv12 := &x.Prefix - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *DeploymentListRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj14 int - var yyb14 bool - var yyhl14 bool = l >= 0 - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv15 := &x.Region - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv17 := &x.MinQueryIndex - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*uint64)(yyv17)) = uint64(r.DecodeUint(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv19 := &x.MaxQueryTime - yym20 := z.DecBinary() - _ = yym20 - if false { - } else if z.HasExtensions() && z.DecExt(yyv19) { - } else { - *((*int64)(yyv19)) = int64(r.DecodeInt(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv21 := &x.AllowStale - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*bool)(yyv21)) = r.DecodeBool() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv23 := &x.Prefix - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*string)(yyv23)) = r.DecodeString() - } - } - for { - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj14-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *DeploymentDeleteRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Deployments == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - z.F.EncSliceStringV(x.Deployments, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Deployments")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Deployments == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - z.F.EncSliceStringV(x.Deployments, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *DeploymentDeleteRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *DeploymentDeleteRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Deployments": - if r.TryDecodeAsNil() { - x.Deployments = nil - } else { - yyv4 := &x.Deployments - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - z.F.DecSliceStringX(yyv4, false, d) - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv6 := &x.Region - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *DeploymentDeleteRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj8 int - var yyb8 bool - var yyhl8 bool = l >= 0 - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Deployments = nil - } else { - yyv9 := &x.Deployments - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - z.F.DecSliceStringX(yyv9, false, d) - } - } - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv11 := &x.Region - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*string)(yyv11)) = r.DecodeString() - } - } - for { - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj8-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *DeploymentStatusUpdateRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Eval == nil { - r.EncodeNil() - } else { - x.Eval.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Eval")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Eval == nil { - r.EncodeNil() - } else { - x.Eval.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.DeploymentUpdate == nil { - r.EncodeNil() - } else { - x.DeploymentUpdate.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DeploymentUpdate")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.DeploymentUpdate == nil { - r.EncodeNil() - } else { - x.DeploymentUpdate.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Job == nil { - r.EncodeNil() - } else { - x.Job.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Job")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Job == nil { - r.EncodeNil() - } else { - x.Job.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *DeploymentStatusUpdateRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *DeploymentStatusUpdateRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Eval": - if r.TryDecodeAsNil() { - if x.Eval != nil { - x.Eval = nil - } - } else { - if x.Eval == nil { - x.Eval = new(Evaluation) - } - x.Eval.CodecDecodeSelf(d) - } - case "DeploymentUpdate": - if r.TryDecodeAsNil() { - if x.DeploymentUpdate != nil { - x.DeploymentUpdate = nil - } - } else { - if x.DeploymentUpdate == nil { - x.DeploymentUpdate = new(DeploymentStatusUpdate) - } - x.DeploymentUpdate.CodecDecodeSelf(d) - } - case "Job": - if r.TryDecodeAsNil() { - if x.Job != nil { - x.Job = nil - } - } else { - if x.Job == nil { - x.Job = new(Job) - } - x.Job.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *DeploymentStatusUpdateRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj7 int - var yyb7 bool - var yyhl7 bool = l >= 0 - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Eval != nil { - x.Eval = nil - } - } else { - if x.Eval == nil { - x.Eval = new(Evaluation) - } - x.Eval.CodecDecodeSelf(d) - } - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.DeploymentUpdate != nil { - x.DeploymentUpdate = nil - } - } else { - if x.DeploymentUpdate == nil { - x.DeploymentUpdate = new(DeploymentStatusUpdate) - } - x.DeploymentUpdate.CodecDecodeSelf(d) - } - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Job != nil { - x.Job = nil - } - } else { - if x.Job == nil { - x.Job = new(Job) - } - x.Job.CodecDecodeSelf(d) - } - for { - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj7-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *DeploymentAllocHealthRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DeploymentID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DeploymentID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DeploymentID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.HealthyAllocationIDs == nil { - r.EncodeNil() - } else { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - z.F.EncSliceStringV(x.HealthyAllocationIDs, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("HealthyAllocationIDs")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.HealthyAllocationIDs == nil { - r.EncodeNil() - } else { - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - z.F.EncSliceStringV(x.HealthyAllocationIDs, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.UnhealthyAllocationIDs == nil { - r.EncodeNil() - } else { - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - z.F.EncSliceStringV(x.UnhealthyAllocationIDs, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("UnhealthyAllocationIDs")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.UnhealthyAllocationIDs == nil { - r.EncodeNil() - } else { - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - z.F.EncSliceStringV(x.UnhealthyAllocationIDs, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *DeploymentAllocHealthRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *DeploymentAllocHealthRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "DeploymentID": - if r.TryDecodeAsNil() { - x.DeploymentID = "" - } else { - yyv4 := &x.DeploymentID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "HealthyAllocationIDs": - if r.TryDecodeAsNil() { - x.HealthyAllocationIDs = nil - } else { - yyv6 := &x.HealthyAllocationIDs - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - z.F.DecSliceStringX(yyv6, false, d) - } - } - case "UnhealthyAllocationIDs": - if r.TryDecodeAsNil() { - x.UnhealthyAllocationIDs = nil - } else { - yyv8 := &x.UnhealthyAllocationIDs - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - z.F.DecSliceStringX(yyv8, false, d) - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv10 := &x.Region - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *DeploymentAllocHealthRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DeploymentID = "" - } else { - yyv13 := &x.DeploymentID - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*string)(yyv13)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.HealthyAllocationIDs = nil - } else { - yyv15 := &x.HealthyAllocationIDs - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - z.F.DecSliceStringX(yyv15, false, d) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.UnhealthyAllocationIDs = nil - } else { - yyv17 := &x.UnhealthyAllocationIDs - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - z.F.DecSliceStringX(yyv17, false, d) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv19 := &x.Region - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *ApplyDeploymentAllocHealthRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [7]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(7) - } else { - yynn2 = 7 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DeploymentID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DeploymentID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DeploymentID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.HealthyAllocationIDs == nil { - r.EncodeNil() - } else { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - z.F.EncSliceStringV(x.HealthyAllocationIDs, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("HealthyAllocationIDs")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.HealthyAllocationIDs == nil { - r.EncodeNil() - } else { - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - z.F.EncSliceStringV(x.HealthyAllocationIDs, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.UnhealthyAllocationIDs == nil { - r.EncodeNil() - } else { - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - z.F.EncSliceStringV(x.UnhealthyAllocationIDs, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("UnhealthyAllocationIDs")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.UnhealthyAllocationIDs == nil { - r.EncodeNil() - } else { - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - z.F.EncSliceStringV(x.UnhealthyAllocationIDs, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.DeploymentUpdate == nil { - r.EncodeNil() - } else { - x.DeploymentUpdate.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DeploymentUpdate")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.DeploymentUpdate == nil { - r.EncodeNil() - } else { - x.DeploymentUpdate.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Job == nil { - r.EncodeNil() - } else { - x.Job.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Job")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Job == nil { - r.EncodeNil() - } else { - x.Job.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Eval == nil { - r.EncodeNil() - } else { - x.Eval.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Eval")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Eval == nil { - r.EncodeNil() - } else { - x.Eval.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *ApplyDeploymentAllocHealthRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *ApplyDeploymentAllocHealthRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "DeploymentID": - if r.TryDecodeAsNil() { - x.DeploymentID = "" - } else { - yyv4 := &x.DeploymentID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "HealthyAllocationIDs": - if r.TryDecodeAsNil() { - x.HealthyAllocationIDs = nil - } else { - yyv6 := &x.HealthyAllocationIDs - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - z.F.DecSliceStringX(yyv6, false, d) - } - } - case "UnhealthyAllocationIDs": - if r.TryDecodeAsNil() { - x.UnhealthyAllocationIDs = nil - } else { - yyv8 := &x.UnhealthyAllocationIDs - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - z.F.DecSliceStringX(yyv8, false, d) - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv10 := &x.Region - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - case "DeploymentUpdate": - if r.TryDecodeAsNil() { - if x.DeploymentUpdate != nil { - x.DeploymentUpdate = nil - } - } else { - if x.DeploymentUpdate == nil { - x.DeploymentUpdate = new(DeploymentStatusUpdate) - } - x.DeploymentUpdate.CodecDecodeSelf(d) - } - case "Job": - if r.TryDecodeAsNil() { - if x.Job != nil { - x.Job = nil - } - } else { - if x.Job == nil { - x.Job = new(Job) - } - x.Job.CodecDecodeSelf(d) - } - case "Eval": - if r.TryDecodeAsNil() { - if x.Eval != nil { - x.Eval = nil - } - } else { - if x.Eval == nil { - x.Eval = new(Evaluation) - } - x.Eval.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *ApplyDeploymentAllocHealthRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj15 int - var yyb15 bool - var yyhl15 bool = l >= 0 - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DeploymentID = "" - } else { - yyv16 := &x.DeploymentID - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*string)(yyv16)) = r.DecodeString() - } - } - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.HealthyAllocationIDs = nil - } else { - yyv18 := &x.HealthyAllocationIDs - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - z.F.DecSliceStringX(yyv18, false, d) - } - } - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.UnhealthyAllocationIDs = nil - } else { - yyv20 := &x.UnhealthyAllocationIDs - yym21 := z.DecBinary() - _ = yym21 - if false { - } else { - z.F.DecSliceStringX(yyv20, false, d) - } - } - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv22 := &x.Region - yym23 := z.DecBinary() - _ = yym23 - if false { - } else { - *((*string)(yyv22)) = r.DecodeString() - } - } - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.DeploymentUpdate != nil { - x.DeploymentUpdate = nil - } - } else { - if x.DeploymentUpdate == nil { - x.DeploymentUpdate = new(DeploymentStatusUpdate) - } - x.DeploymentUpdate.CodecDecodeSelf(d) - } - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Job != nil { - x.Job = nil - } - } else { - if x.Job == nil { - x.Job = new(Job) - } - x.Job.CodecDecodeSelf(d) - } - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Eval != nil { - x.Eval = nil - } - } else { - if x.Eval == nil { - x.Eval = new(Evaluation) - } - x.Eval.CodecDecodeSelf(d) - } - for { - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj15-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *DeploymentPromoteRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DeploymentID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DeploymentID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DeploymentID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeBool(bool(x.All)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("All")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeBool(bool(x.All)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Groups == nil { - r.EncodeNil() - } else { - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - z.F.EncSliceStringV(x.Groups, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Groups")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Groups == nil { - r.EncodeNil() - } else { - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - z.F.EncSliceStringV(x.Groups, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *DeploymentPromoteRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *DeploymentPromoteRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "DeploymentID": - if r.TryDecodeAsNil() { - x.DeploymentID = "" - } else { - yyv4 := &x.DeploymentID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "All": - if r.TryDecodeAsNil() { - x.All = false - } else { - yyv6 := &x.All - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*bool)(yyv6)) = r.DecodeBool() - } - } - case "Groups": - if r.TryDecodeAsNil() { - x.Groups = nil - } else { - yyv8 := &x.Groups - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - z.F.DecSliceStringX(yyv8, false, d) - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv10 := &x.Region - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *DeploymentPromoteRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DeploymentID = "" - } else { - yyv13 := &x.DeploymentID - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*string)(yyv13)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.All = false - } else { - yyv15 := &x.All - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*bool)(yyv15)) = r.DecodeBool() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Groups = nil - } else { - yyv17 := &x.Groups - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - z.F.DecSliceStringX(yyv17, false, d) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv19 := &x.Region - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *ApplyDeploymentPromoteRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) - } else { - yynn2 = 5 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DeploymentID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DeploymentID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DeploymentID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeBool(bool(x.All)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("All")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeBool(bool(x.All)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Groups == nil { - r.EncodeNil() - } else { - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - z.F.EncSliceStringV(x.Groups, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Groups")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Groups == nil { - r.EncodeNil() - } else { - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - z.F.EncSliceStringV(x.Groups, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Eval == nil { - r.EncodeNil() - } else { - x.Eval.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Eval")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Eval == nil { - r.EncodeNil() - } else { - x.Eval.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *ApplyDeploymentPromoteRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *ApplyDeploymentPromoteRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "DeploymentID": - if r.TryDecodeAsNil() { - x.DeploymentID = "" - } else { - yyv4 := &x.DeploymentID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "All": - if r.TryDecodeAsNil() { - x.All = false - } else { - yyv6 := &x.All - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*bool)(yyv6)) = r.DecodeBool() - } - } - case "Groups": - if r.TryDecodeAsNil() { - x.Groups = nil - } else { - yyv8 := &x.Groups - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - z.F.DecSliceStringX(yyv8, false, d) - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv10 := &x.Region - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - case "Eval": - if r.TryDecodeAsNil() { - if x.Eval != nil { - x.Eval = nil - } - } else { - if x.Eval == nil { - x.Eval = new(Evaluation) - } - x.Eval.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *ApplyDeploymentPromoteRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj13 int - var yyb13 bool - var yyhl13 bool = l >= 0 - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DeploymentID = "" - } else { - yyv14 := &x.DeploymentID - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*string)(yyv14)) = r.DecodeString() - } - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.All = false - } else { - yyv16 := &x.All - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*bool)(yyv16)) = r.DecodeBool() - } - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Groups = nil - } else { - yyv18 := &x.Groups - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - z.F.DecSliceStringX(yyv18, false, d) - } - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv20 := &x.Region - yym21 := z.DecBinary() - _ = yym21 - if false { - } else { - *((*string)(yyv20)) = r.DecodeString() - } - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Eval != nil { - x.Eval = nil - } - } else { - if x.Eval == nil { - x.Eval = new(Evaluation) - } - x.Eval.CodecDecodeSelf(d) - } - for { - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj13-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *DeploymentPauseRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DeploymentID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DeploymentID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DeploymentID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeBool(bool(x.Pause)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Pause")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeBool(bool(x.Pause)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *DeploymentPauseRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *DeploymentPauseRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "DeploymentID": - if r.TryDecodeAsNil() { - x.DeploymentID = "" - } else { - yyv4 := &x.DeploymentID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Pause": - if r.TryDecodeAsNil() { - x.Pause = false - } else { - yyv6 := &x.Pause - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*bool)(yyv6)) = r.DecodeBool() - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv8 := &x.Region - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *DeploymentPauseRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DeploymentID = "" - } else { - yyv11 := &x.DeploymentID - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*string)(yyv11)) = r.DecodeString() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Pause = false - } else { - yyv13 := &x.Pause - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*bool)(yyv13)) = r.DecodeBool() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv15 := &x.Region - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj10-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *DeploymentSpecificRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [6]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(6) - } else { - yynn2 = 6 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DeploymentID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DeploymentID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DeploymentID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MinQueryIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MaxQueryTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllowStale")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Prefix")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *DeploymentSpecificRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *DeploymentSpecificRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "DeploymentID": - if r.TryDecodeAsNil() { - x.DeploymentID = "" - } else { - yyv4 := &x.DeploymentID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv6 := &x.Region - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "MinQueryIndex": - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv8 := &x.MinQueryIndex - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint64)(yyv8)) = uint64(r.DecodeUint(64)) - } - } - case "MaxQueryTime": - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv10 := &x.MaxQueryTime - yym11 := z.DecBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.DecExt(yyv10) { - } else { - *((*int64)(yyv10)) = int64(r.DecodeInt(64)) - } - } - case "AllowStale": - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv12 := &x.AllowStale - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*bool)(yyv12)) = r.DecodeBool() - } - } - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv14 := &x.Prefix - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*string)(yyv14)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *DeploymentSpecificRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj16 int - var yyb16 bool - var yyhl16 bool = l >= 0 - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DeploymentID = "" - } else { - yyv17 := &x.DeploymentID - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(yyv17)) = r.DecodeString() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv19 := &x.Region - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv21 := &x.MinQueryIndex - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*uint64)(yyv21)) = uint64(r.DecodeUint(64)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv23 := &x.MaxQueryTime - yym24 := z.DecBinary() - _ = yym24 - if false { - } else if z.HasExtensions() && z.DecExt(yyv23) { - } else { - *((*int64)(yyv23)) = int64(r.DecodeInt(64)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv25 := &x.AllowStale - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*bool)(yyv25)) = r.DecodeBool() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv27 := &x.Prefix - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*string)(yyv27)) = r.DecodeString() - } - } - for { - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj16-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *DeploymentFailRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DeploymentID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DeploymentID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DeploymentID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *DeploymentFailRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *DeploymentFailRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "DeploymentID": - if r.TryDecodeAsNil() { - x.DeploymentID = "" - } else { - yyv4 := &x.DeploymentID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv6 := &x.Region - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *DeploymentFailRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj8 int - var yyb8 bool - var yyhl8 bool = l >= 0 - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DeploymentID = "" - } else { - yyv9 := &x.DeploymentID - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*string)(yyv9)) = r.DecodeString() - } - } - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv11 := &x.Region - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*string)(yyv11)) = r.DecodeString() - } - } - for { - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj8-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *SingleDeploymentResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Deployment == nil { - r.EncodeNil() - } else { - x.Deployment.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Deployment")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Deployment == nil { - r.EncodeNil() - } else { - x.Deployment.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *SingleDeploymentResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *SingleDeploymentResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Deployment": - if r.TryDecodeAsNil() { - if x.Deployment != nil { - x.Deployment = nil - } - } else { - if x.Deployment == nil { - x.Deployment = new(Deployment) - } - x.Deployment.CodecDecodeSelf(d) - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv5 := &x.Index - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - *((*uint64)(yyv5)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv7 := &x.LastContact - yym8 := z.DecBinary() - _ = yym8 - if false { - } else if z.HasExtensions() && z.DecExt(yyv7) { - } else { - *((*int64)(yyv7)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv9 := &x.KnownLeader - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*bool)(yyv9)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *SingleDeploymentResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj11 int - var yyb11 bool - var yyhl11 bool = l >= 0 - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Deployment != nil { - x.Deployment = nil - } - } else { - if x.Deployment == nil { - x.Deployment = new(Deployment) - } - x.Deployment.CodecDecodeSelf(d) - } - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv13 := &x.Index - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*uint64)(yyv13)) = uint64(r.DecodeUint(64)) - } - } - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv15 := &x.LastContact - yym16 := z.DecBinary() - _ = yym16 - if false { - } else if z.HasExtensions() && z.DecExt(yyv15) { - } else { - *((*int64)(yyv15)) = int64(r.DecodeInt(64)) - } - } - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv17 := &x.KnownLeader - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*bool)(yyv17)) = r.DecodeBool() - } - } - for { - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj11-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *GenericResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [1]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(1) - } else { - yynn2 = 1 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *GenericResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *GenericResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv4 := &x.Index - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*uint64)(yyv4)) = uint64(r.DecodeUint(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *GenericResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj6 int - var yyb6 bool - var yyhl6 bool = l >= 0 - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv7 := &x.Index - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - *((*uint64)(yyv7)) = uint64(r.DecodeUint(64)) - } - } - for { - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj6-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *VersionResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) - } else { - yynn2 = 5 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Build)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Build")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Build)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Versions == nil { - r.EncodeNil() - } else { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - z.F.EncMapStringIntV(x.Versions, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Versions")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Versions == nil { - r.EncodeNil() - } else { - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - z.F.EncMapStringIntV(x.Versions, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *VersionResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *VersionResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Build": - if r.TryDecodeAsNil() { - x.Build = "" - } else { - yyv4 := &x.Build - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Versions": - if r.TryDecodeAsNil() { - x.Versions = nil - } else { - yyv6 := &x.Versions - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - z.F.DecMapStringIntX(yyv6, false, d) - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv8 := &x.Index - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint64)(yyv8)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv10 := &x.LastContact - yym11 := z.DecBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.DecExt(yyv10) { - } else { - *((*int64)(yyv10)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv12 := &x.KnownLeader - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*bool)(yyv12)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *VersionResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj14 int - var yyb14 bool - var yyhl14 bool = l >= 0 - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Build = "" - } else { - yyv15 := &x.Build - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Versions = nil - } else { - yyv17 := &x.Versions - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - z.F.DecMapStringIntX(yyv17, false, d) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv19 := &x.Index - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*uint64)(yyv19)) = uint64(r.DecodeUint(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv21 := &x.LastContact - yym22 := z.DecBinary() - _ = yym22 - if false { - } else if z.HasExtensions() && z.DecExt(yyv21) { - } else { - *((*int64)(yyv21)) = int64(r.DecodeInt(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv23 := &x.KnownLeader - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*bool)(yyv23)) = r.DecodeBool() - } - } - for { - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj14-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobRegisterResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [7]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(7) - } else { - yynn2 = 7 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EvalID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.EvalCreateIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EvalCreateIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.EvalCreateIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.JobModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.JobModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Warnings)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Warnings")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Warnings)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobRegisterResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobRegisterResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "EvalID": - if r.TryDecodeAsNil() { - x.EvalID = "" - } else { - yyv4 := &x.EvalID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "EvalCreateIndex": - if r.TryDecodeAsNil() { - x.EvalCreateIndex = 0 - } else { - yyv6 := &x.EvalCreateIndex - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "JobModifyIndex": - if r.TryDecodeAsNil() { - x.JobModifyIndex = 0 - } else { - yyv8 := &x.JobModifyIndex - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint64)(yyv8)) = uint64(r.DecodeUint(64)) - } - } - case "Warnings": - if r.TryDecodeAsNil() { - x.Warnings = "" - } else { - yyv10 := &x.Warnings - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv12 := &x.Index - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*uint64)(yyv12)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv14 := &x.LastContact - yym15 := z.DecBinary() - _ = yym15 - if false { - } else if z.HasExtensions() && z.DecExt(yyv14) { - } else { - *((*int64)(yyv14)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv16 := &x.KnownLeader - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*bool)(yyv16)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobRegisterResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj18 int - var yyb18 bool - var yyhl18 bool = l >= 0 - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EvalID = "" - } else { - yyv19 := &x.EvalID - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EvalCreateIndex = 0 - } else { - yyv21 := &x.EvalCreateIndex - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*uint64)(yyv21)) = uint64(r.DecodeUint(64)) - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobModifyIndex = 0 - } else { - yyv23 := &x.JobModifyIndex - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*uint64)(yyv23)) = uint64(r.DecodeUint(64)) - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Warnings = "" - } else { - yyv25 := &x.Warnings - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*string)(yyv25)) = r.DecodeString() - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv27 := &x.Index - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*uint64)(yyv27)) = uint64(r.DecodeUint(64)) - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv29 := &x.LastContact - yym30 := z.DecBinary() - _ = yym30 - if false { - } else if z.HasExtensions() && z.DecExt(yyv29) { - } else { - *((*int64)(yyv29)) = int64(r.DecodeInt(64)) - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv31 := &x.KnownLeader - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - *((*bool)(yyv31)) = r.DecodeBool() - } - } - for { - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj18-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobDeregisterResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [6]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(6) - } else { - yynn2 = 6 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EvalID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.EvalCreateIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EvalCreateIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.EvalCreateIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.JobModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.JobModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobDeregisterResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobDeregisterResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "EvalID": - if r.TryDecodeAsNil() { - x.EvalID = "" - } else { - yyv4 := &x.EvalID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "EvalCreateIndex": - if r.TryDecodeAsNil() { - x.EvalCreateIndex = 0 - } else { - yyv6 := &x.EvalCreateIndex - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "JobModifyIndex": - if r.TryDecodeAsNil() { - x.JobModifyIndex = 0 - } else { - yyv8 := &x.JobModifyIndex - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint64)(yyv8)) = uint64(r.DecodeUint(64)) - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv10 := &x.Index - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*uint64)(yyv10)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv12 := &x.LastContact - yym13 := z.DecBinary() - _ = yym13 - if false { - } else if z.HasExtensions() && z.DecExt(yyv12) { - } else { - *((*int64)(yyv12)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv14 := &x.KnownLeader - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*bool)(yyv14)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobDeregisterResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj16 int - var yyb16 bool - var yyhl16 bool = l >= 0 - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EvalID = "" - } else { - yyv17 := &x.EvalID - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(yyv17)) = r.DecodeString() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EvalCreateIndex = 0 - } else { - yyv19 := &x.EvalCreateIndex - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*uint64)(yyv19)) = uint64(r.DecodeUint(64)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobModifyIndex = 0 - } else { - yyv21 := &x.JobModifyIndex - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*uint64)(yyv21)) = uint64(r.DecodeUint(64)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv23 := &x.Index - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*uint64)(yyv23)) = uint64(r.DecodeUint(64)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv25 := &x.LastContact - yym26 := z.DecBinary() - _ = yym26 - if false { - } else if z.HasExtensions() && z.DecExt(yyv25) { - } else { - *((*int64)(yyv25)) = int64(r.DecodeInt(64)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv27 := &x.KnownLeader - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*bool)(yyv27)) = r.DecodeBool() - } - } - for { - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj16-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobValidateResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeBool(bool(x.DriverConfigValidated)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DriverConfigValidated")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeBool(bool(x.DriverConfigValidated)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.ValidationErrors == nil { - r.EncodeNil() - } else { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - z.F.EncSliceStringV(x.ValidationErrors, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ValidationErrors")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.ValidationErrors == nil { - r.EncodeNil() - } else { - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - z.F.EncSliceStringV(x.ValidationErrors, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Error)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Error")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Error)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Warnings)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Warnings")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Warnings)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobValidateResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobValidateResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "DriverConfigValidated": - if r.TryDecodeAsNil() { - x.DriverConfigValidated = false - } else { - yyv4 := &x.DriverConfigValidated - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*bool)(yyv4)) = r.DecodeBool() - } - } - case "ValidationErrors": - if r.TryDecodeAsNil() { - x.ValidationErrors = nil - } else { - yyv6 := &x.ValidationErrors - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - z.F.DecSliceStringX(yyv6, false, d) - } - } - case "Error": - if r.TryDecodeAsNil() { - x.Error = "" - } else { - yyv8 := &x.Error - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "Warnings": - if r.TryDecodeAsNil() { - x.Warnings = "" - } else { - yyv10 := &x.Warnings - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobValidateResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DriverConfigValidated = false - } else { - yyv13 := &x.DriverConfigValidated - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*bool)(yyv13)) = r.DecodeBool() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ValidationErrors = nil - } else { - yyv15 := &x.ValidationErrors - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - z.F.DecSliceStringX(yyv15, false, d) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Error = "" - } else { - yyv17 := &x.Error - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(yyv17)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Warnings = "" - } else { - yyv19 := &x.Warnings - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *NodeUpdateResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [10]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(10) - } else { - yynn2 = 10 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else if z.HasExtensions() && z.EncExt(x.HeartbeatTTL) { - } else { - r.EncodeInt(int64(x.HeartbeatTTL)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("HeartbeatTTL")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else if z.HasExtensions() && z.EncExt(x.HeartbeatTTL) { - } else { - r.EncodeInt(int64(x.HeartbeatTTL)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.EvalIDs == nil { - r.EncodeNil() - } else { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - z.F.EncSliceStringV(x.EvalIDs, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EvalIDs")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.EvalIDs == nil { - r.EncodeNil() - } else { - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - z.F.EncSliceStringV(x.EvalIDs, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.EvalCreateIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EvalCreateIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.EvalCreateIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeUint(uint64(x.NodeModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodeModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeUint(uint64(x.NodeModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.LeaderRPCAddr)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LeaderRPCAddr")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.LeaderRPCAddr)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeInt(int64(x.NumNodes)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NumNodes")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeInt(int64(x.NumNodes)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Servers == nil { - r.EncodeNil() - } else { - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - h.encSlicePtrtoNodeServerInfo(([]*NodeServerInfo)(x.Servers), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Servers")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Servers == nil { - r.EncodeNil() - } else { - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - h.encSlicePtrtoNodeServerInfo(([]*NodeServerInfo)(x.Servers), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym25 := z.EncBinary() - _ = yym25 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym28 := z.EncBinary() - _ = yym28 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym29 := z.EncBinary() - _ = yym29 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym31 := z.EncBinary() - _ = yym31 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym32 := z.EncBinary() - _ = yym32 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *NodeUpdateResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *NodeUpdateResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "HeartbeatTTL": - if r.TryDecodeAsNil() { - x.HeartbeatTTL = 0 - } else { - yyv4 := &x.HeartbeatTTL - yym5 := z.DecBinary() - _ = yym5 - if false { - } else if z.HasExtensions() && z.DecExt(yyv4) { - } else { - *((*int64)(yyv4)) = int64(r.DecodeInt(64)) - } - } - case "EvalIDs": - if r.TryDecodeAsNil() { - x.EvalIDs = nil - } else { - yyv6 := &x.EvalIDs - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - z.F.DecSliceStringX(yyv6, false, d) - } - } - case "EvalCreateIndex": - if r.TryDecodeAsNil() { - x.EvalCreateIndex = 0 - } else { - yyv8 := &x.EvalCreateIndex - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint64)(yyv8)) = uint64(r.DecodeUint(64)) - } - } - case "NodeModifyIndex": - if r.TryDecodeAsNil() { - x.NodeModifyIndex = 0 - } else { - yyv10 := &x.NodeModifyIndex - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*uint64)(yyv10)) = uint64(r.DecodeUint(64)) - } - } - case "LeaderRPCAddr": - if r.TryDecodeAsNil() { - x.LeaderRPCAddr = "" - } else { - yyv12 := &x.LeaderRPCAddr - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - case "NumNodes": - if r.TryDecodeAsNil() { - x.NumNodes = 0 - } else { - yyv14 := &x.NumNodes - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*int32)(yyv14)) = int32(r.DecodeInt(32)) - } - } - case "Servers": - if r.TryDecodeAsNil() { - x.Servers = nil - } else { - yyv16 := &x.Servers - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - h.decSlicePtrtoNodeServerInfo((*[]*NodeServerInfo)(yyv16), d) - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv18 := &x.Index - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - *((*uint64)(yyv18)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv20 := &x.LastContact - yym21 := z.DecBinary() - _ = yym21 - if false { - } else if z.HasExtensions() && z.DecExt(yyv20) { - } else { - *((*int64)(yyv20)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv22 := &x.KnownLeader - yym23 := z.DecBinary() - _ = yym23 - if false { - } else { - *((*bool)(yyv22)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *NodeUpdateResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj24 int - var yyb24 bool - var yyhl24 bool = l >= 0 - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.HeartbeatTTL = 0 - } else { - yyv25 := &x.HeartbeatTTL - yym26 := z.DecBinary() - _ = yym26 - if false { - } else if z.HasExtensions() && z.DecExt(yyv25) { - } else { - *((*int64)(yyv25)) = int64(r.DecodeInt(64)) - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EvalIDs = nil - } else { - yyv27 := &x.EvalIDs - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - z.F.DecSliceStringX(yyv27, false, d) - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EvalCreateIndex = 0 - } else { - yyv29 := &x.EvalCreateIndex - yym30 := z.DecBinary() - _ = yym30 - if false { - } else { - *((*uint64)(yyv29)) = uint64(r.DecodeUint(64)) - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodeModifyIndex = 0 - } else { - yyv31 := &x.NodeModifyIndex - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - *((*uint64)(yyv31)) = uint64(r.DecodeUint(64)) - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LeaderRPCAddr = "" - } else { - yyv33 := &x.LeaderRPCAddr - yym34 := z.DecBinary() - _ = yym34 - if false { - } else { - *((*string)(yyv33)) = r.DecodeString() - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NumNodes = 0 - } else { - yyv35 := &x.NumNodes - yym36 := z.DecBinary() - _ = yym36 - if false { - } else { - *((*int32)(yyv35)) = int32(r.DecodeInt(32)) - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Servers = nil - } else { - yyv37 := &x.Servers - yym38 := z.DecBinary() - _ = yym38 - if false { - } else { - h.decSlicePtrtoNodeServerInfo((*[]*NodeServerInfo)(yyv37), d) - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv39 := &x.Index - yym40 := z.DecBinary() - _ = yym40 - if false { - } else { - *((*uint64)(yyv39)) = uint64(r.DecodeUint(64)) - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv41 := &x.LastContact - yym42 := z.DecBinary() - _ = yym42 - if false { - } else if z.HasExtensions() && z.DecExt(yyv41) { - } else { - *((*int64)(yyv41)) = int64(r.DecodeInt(64)) - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv43 := &x.KnownLeader - yym44 := z.DecBinary() - _ = yym44 - if false { - } else { - *((*bool)(yyv43)) = r.DecodeBool() - } - } - for { - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj24-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *NodeDrainUpdateResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [6]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(6) - } else { - yynn2 = 6 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.EvalIDs == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - z.F.EncSliceStringV(x.EvalIDs, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EvalIDs")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.EvalIDs == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - z.F.EncSliceStringV(x.EvalIDs, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.EvalCreateIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EvalCreateIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.EvalCreateIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.NodeModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodeModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.NodeModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *NodeDrainUpdateResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *NodeDrainUpdateResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "EvalIDs": - if r.TryDecodeAsNil() { - x.EvalIDs = nil - } else { - yyv4 := &x.EvalIDs - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - z.F.DecSliceStringX(yyv4, false, d) - } - } - case "EvalCreateIndex": - if r.TryDecodeAsNil() { - x.EvalCreateIndex = 0 - } else { - yyv6 := &x.EvalCreateIndex - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "NodeModifyIndex": - if r.TryDecodeAsNil() { - x.NodeModifyIndex = 0 - } else { - yyv8 := &x.NodeModifyIndex - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint64)(yyv8)) = uint64(r.DecodeUint(64)) - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv10 := &x.Index - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*uint64)(yyv10)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv12 := &x.LastContact - yym13 := z.DecBinary() - _ = yym13 - if false { - } else if z.HasExtensions() && z.DecExt(yyv12) { - } else { - *((*int64)(yyv12)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv14 := &x.KnownLeader - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*bool)(yyv14)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *NodeDrainUpdateResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj16 int - var yyb16 bool - var yyhl16 bool = l >= 0 - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EvalIDs = nil - } else { - yyv17 := &x.EvalIDs - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - z.F.DecSliceStringX(yyv17, false, d) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EvalCreateIndex = 0 - } else { - yyv19 := &x.EvalCreateIndex - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*uint64)(yyv19)) = uint64(r.DecodeUint(64)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodeModifyIndex = 0 - } else { - yyv21 := &x.NodeModifyIndex - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*uint64)(yyv21)) = uint64(r.DecodeUint(64)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv23 := &x.Index - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*uint64)(yyv23)) = uint64(r.DecodeUint(64)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv25 := &x.LastContact - yym26 := z.DecBinary() - _ = yym26 - if false { - } else if z.HasExtensions() && z.DecExt(yyv25) { - } else { - *((*int64)(yyv25)) = int64(r.DecodeInt(64)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv27 := &x.KnownLeader - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*bool)(yyv27)) = r.DecodeBool() - } - } - for { - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj16-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *NodeAllocsResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Allocs == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSlicePtrtoAllocation(([]*Allocation)(x.Allocs), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Allocs")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Allocs == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSlicePtrtoAllocation(([]*Allocation)(x.Allocs), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *NodeAllocsResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *NodeAllocsResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Allocs": - if r.TryDecodeAsNil() { - x.Allocs = nil - } else { - yyv4 := &x.Allocs - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSlicePtrtoAllocation((*[]*Allocation)(yyv4), d) - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv6 := &x.Index - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv8 := &x.LastContact - yym9 := z.DecBinary() - _ = yym9 - if false { - } else if z.HasExtensions() && z.DecExt(yyv8) { - } else { - *((*int64)(yyv8)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv10 := &x.KnownLeader - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *NodeAllocsResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Allocs = nil - } else { - yyv13 := &x.Allocs - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - h.decSlicePtrtoAllocation((*[]*Allocation)(yyv13), d) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv15 := &x.Index - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*uint64)(yyv15)) = uint64(r.DecodeUint(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv17 := &x.LastContact - yym18 := z.DecBinary() - _ = yym18 - if false { - } else if z.HasExtensions() && z.DecExt(yyv17) { - } else { - *((*int64)(yyv17)) = int64(r.DecodeInt(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv19 := &x.KnownLeader - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*bool)(yyv19)) = r.DecodeBool() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *NodeClientAllocsResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Allocs == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - z.F.EncMapStringUint64V(x.Allocs, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Allocs")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Allocs == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - z.F.EncMapStringUint64V(x.Allocs, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *NodeClientAllocsResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *NodeClientAllocsResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Allocs": - if r.TryDecodeAsNil() { - x.Allocs = nil - } else { - yyv4 := &x.Allocs - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - z.F.DecMapStringUint64X(yyv4, false, d) - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv6 := &x.Index - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv8 := &x.LastContact - yym9 := z.DecBinary() - _ = yym9 - if false { - } else if z.HasExtensions() && z.DecExt(yyv8) { - } else { - *((*int64)(yyv8)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv10 := &x.KnownLeader - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *NodeClientAllocsResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Allocs = nil - } else { - yyv13 := &x.Allocs - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - z.F.DecMapStringUint64X(yyv13, false, d) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv15 := &x.Index - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*uint64)(yyv15)) = uint64(r.DecodeUint(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv17 := &x.LastContact - yym18 := z.DecBinary() - _ = yym18 - if false { - } else if z.HasExtensions() && z.DecExt(yyv17) { - } else { - *((*int64)(yyv17)) = int64(r.DecodeInt(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv19 := &x.KnownLeader - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*bool)(yyv19)) = r.DecodeBool() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *SingleNodeResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Node == nil { - r.EncodeNil() - } else { - x.Node.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Node")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Node == nil { - r.EncodeNil() - } else { - x.Node.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *SingleNodeResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *SingleNodeResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Node": - if r.TryDecodeAsNil() { - if x.Node != nil { - x.Node = nil - } - } else { - if x.Node == nil { - x.Node = new(Node) - } - x.Node.CodecDecodeSelf(d) - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv5 := &x.Index - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - *((*uint64)(yyv5)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv7 := &x.LastContact - yym8 := z.DecBinary() - _ = yym8 - if false { - } else if z.HasExtensions() && z.DecExt(yyv7) { - } else { - *((*int64)(yyv7)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv9 := &x.KnownLeader - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*bool)(yyv9)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *SingleNodeResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj11 int - var yyb11 bool - var yyhl11 bool = l >= 0 - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Node != nil { - x.Node = nil - } - } else { - if x.Node == nil { - x.Node = new(Node) - } - x.Node.CodecDecodeSelf(d) - } - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv13 := &x.Index - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*uint64)(yyv13)) = uint64(r.DecodeUint(64)) - } - } - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv15 := &x.LastContact - yym16 := z.DecBinary() - _ = yym16 - if false { - } else if z.HasExtensions() && z.DecExt(yyv15) { - } else { - *((*int64)(yyv15)) = int64(r.DecodeInt(64)) - } - } - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv17 := &x.KnownLeader - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*bool)(yyv17)) = r.DecodeBool() - } - } - for { - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj11-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *NodeListResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Nodes == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSlicePtrtoNodeListStub(([]*NodeListStub)(x.Nodes), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Nodes")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Nodes == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSlicePtrtoNodeListStub(([]*NodeListStub)(x.Nodes), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *NodeListResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *NodeListResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Nodes": - if r.TryDecodeAsNil() { - x.Nodes = nil - } else { - yyv4 := &x.Nodes - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSlicePtrtoNodeListStub((*[]*NodeListStub)(yyv4), d) - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv6 := &x.Index - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv8 := &x.LastContact - yym9 := z.DecBinary() - _ = yym9 - if false { - } else if z.HasExtensions() && z.DecExt(yyv8) { - } else { - *((*int64)(yyv8)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv10 := &x.KnownLeader - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *NodeListResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Nodes = nil - } else { - yyv13 := &x.Nodes - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - h.decSlicePtrtoNodeListStub((*[]*NodeListStub)(yyv13), d) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv15 := &x.Index - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*uint64)(yyv15)) = uint64(r.DecodeUint(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv17 := &x.LastContact - yym18 := z.DecBinary() - _ = yym18 - if false { - } else if z.HasExtensions() && z.DecExt(yyv17) { - } else { - *((*int64)(yyv17)) = int64(r.DecodeInt(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv19 := &x.KnownLeader - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*bool)(yyv19)) = r.DecodeBool() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *SingleJobResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Job == nil { - r.EncodeNil() - } else { - x.Job.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Job")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Job == nil { - r.EncodeNil() - } else { - x.Job.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *SingleJobResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *SingleJobResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Job": - if r.TryDecodeAsNil() { - if x.Job != nil { - x.Job = nil - } - } else { - if x.Job == nil { - x.Job = new(Job) - } - x.Job.CodecDecodeSelf(d) - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv5 := &x.Index - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - *((*uint64)(yyv5)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv7 := &x.LastContact - yym8 := z.DecBinary() - _ = yym8 - if false { - } else if z.HasExtensions() && z.DecExt(yyv7) { - } else { - *((*int64)(yyv7)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv9 := &x.KnownLeader - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*bool)(yyv9)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *SingleJobResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj11 int - var yyb11 bool - var yyhl11 bool = l >= 0 - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Job != nil { - x.Job = nil - } - } else { - if x.Job == nil { - x.Job = new(Job) - } - x.Job.CodecDecodeSelf(d) - } - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv13 := &x.Index - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*uint64)(yyv13)) = uint64(r.DecodeUint(64)) - } - } - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv15 := &x.LastContact - yym16 := z.DecBinary() - _ = yym16 - if false { - } else if z.HasExtensions() && z.DecExt(yyv15) { - } else { - *((*int64)(yyv15)) = int64(r.DecodeInt(64)) - } - } - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv17 := &x.KnownLeader - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*bool)(yyv17)) = r.DecodeBool() - } - } - for { - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj11-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobSummaryResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.JobSummary == nil { - r.EncodeNil() - } else { - x.JobSummary.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobSummary")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.JobSummary == nil { - r.EncodeNil() - } else { - x.JobSummary.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobSummaryResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobSummaryResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "JobSummary": - if r.TryDecodeAsNil() { - if x.JobSummary != nil { - x.JobSummary = nil - } - } else { - if x.JobSummary == nil { - x.JobSummary = new(JobSummary) - } - x.JobSummary.CodecDecodeSelf(d) - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv5 := &x.Index - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - *((*uint64)(yyv5)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv7 := &x.LastContact - yym8 := z.DecBinary() - _ = yym8 - if false { - } else if z.HasExtensions() && z.DecExt(yyv7) { - } else { - *((*int64)(yyv7)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv9 := &x.KnownLeader - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*bool)(yyv9)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobSummaryResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj11 int - var yyb11 bool - var yyhl11 bool = l >= 0 - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.JobSummary != nil { - x.JobSummary = nil - } - } else { - if x.JobSummary == nil { - x.JobSummary = new(JobSummary) - } - x.JobSummary.CodecDecodeSelf(d) - } - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv13 := &x.Index - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*uint64)(yyv13)) = uint64(r.DecodeUint(64)) - } - } - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv15 := &x.LastContact - yym16 := z.DecBinary() - _ = yym16 - if false { - } else if z.HasExtensions() && z.DecExt(yyv15) { - } else { - *((*int64)(yyv15)) = int64(r.DecodeInt(64)) - } - } - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv17 := &x.KnownLeader - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*bool)(yyv17)) = r.DecodeBool() - } - } - for { - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj11-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobDispatchResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) - } else { - yynn2 = 5 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DispatchedJobID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DispatchedJobID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DispatchedJobID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EvalID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.EvalCreateIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EvalCreateIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.EvalCreateIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeUint(uint64(x.JobCreateIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobCreateIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeUint(uint64(x.JobCreateIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobDispatchResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobDispatchResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "DispatchedJobID": - if r.TryDecodeAsNil() { - x.DispatchedJobID = "" - } else { - yyv4 := &x.DispatchedJobID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "EvalID": - if r.TryDecodeAsNil() { - x.EvalID = "" - } else { - yyv6 := &x.EvalID - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "EvalCreateIndex": - if r.TryDecodeAsNil() { - x.EvalCreateIndex = 0 - } else { - yyv8 := &x.EvalCreateIndex - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint64)(yyv8)) = uint64(r.DecodeUint(64)) - } - } - case "JobCreateIndex": - if r.TryDecodeAsNil() { - x.JobCreateIndex = 0 - } else { - yyv10 := &x.JobCreateIndex - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*uint64)(yyv10)) = uint64(r.DecodeUint(64)) - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv12 := &x.Index - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*uint64)(yyv12)) = uint64(r.DecodeUint(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobDispatchResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj14 int - var yyb14 bool - var yyhl14 bool = l >= 0 - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DispatchedJobID = "" - } else { - yyv15 := &x.DispatchedJobID - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EvalID = "" - } else { - yyv17 := &x.EvalID - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(yyv17)) = r.DecodeString() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EvalCreateIndex = 0 - } else { - yyv19 := &x.EvalCreateIndex - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*uint64)(yyv19)) = uint64(r.DecodeUint(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobCreateIndex = 0 - } else { - yyv21 := &x.JobCreateIndex - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*uint64)(yyv21)) = uint64(r.DecodeUint(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv23 := &x.Index - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*uint64)(yyv23)) = uint64(r.DecodeUint(64)) - } - } - for { - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj14-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobListResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Jobs == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSlicePtrtoJobListStub(([]*JobListStub)(x.Jobs), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Jobs")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Jobs == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSlicePtrtoJobListStub(([]*JobListStub)(x.Jobs), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobListResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobListResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Jobs": - if r.TryDecodeAsNil() { - x.Jobs = nil - } else { - yyv4 := &x.Jobs - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSlicePtrtoJobListStub((*[]*JobListStub)(yyv4), d) - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv6 := &x.Index - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv8 := &x.LastContact - yym9 := z.DecBinary() - _ = yym9 - if false { - } else if z.HasExtensions() && z.DecExt(yyv8) { - } else { - *((*int64)(yyv8)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv10 := &x.KnownLeader - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobListResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Jobs = nil - } else { - yyv13 := &x.Jobs - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - h.decSlicePtrtoJobListStub((*[]*JobListStub)(yyv13), d) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv15 := &x.Index - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*uint64)(yyv15)) = uint64(r.DecodeUint(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv17 := &x.LastContact - yym18 := z.DecBinary() - _ = yym18 - if false { - } else if z.HasExtensions() && z.DecExt(yyv17) { - } else { - *((*int64)(yyv17)) = int64(r.DecodeInt(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv19 := &x.KnownLeader - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*bool)(yyv19)) = r.DecodeBool() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobVersionsRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [7]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(7) - } else { - yynn2 = 7 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeBool(bool(x.Diffs)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Diffs")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeBool(bool(x.Diffs)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MinQueryIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeUint(uint64(x.MinQueryIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MaxQueryTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else if z.HasExtensions() && z.EncExt(x.MaxQueryTime) { - } else { - r.EncodeInt(int64(x.MaxQueryTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllowStale")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeBool(bool(x.AllowStale)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Prefix")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobVersionsRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobVersionsRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "JobID": - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv4 := &x.JobID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Diffs": - if r.TryDecodeAsNil() { - x.Diffs = false - } else { - yyv6 := &x.Diffs - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*bool)(yyv6)) = r.DecodeBool() - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv8 := &x.Region - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "MinQueryIndex": - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv10 := &x.MinQueryIndex - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*uint64)(yyv10)) = uint64(r.DecodeUint(64)) - } - } - case "MaxQueryTime": - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv12 := &x.MaxQueryTime - yym13 := z.DecBinary() - _ = yym13 - if false { - } else if z.HasExtensions() && z.DecExt(yyv12) { - } else { - *((*int64)(yyv12)) = int64(r.DecodeInt(64)) - } - } - case "AllowStale": - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv14 := &x.AllowStale - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*bool)(yyv14)) = r.DecodeBool() - } - } - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv16 := &x.Prefix - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*string)(yyv16)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobVersionsRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj18 int - var yyb18 bool - var yyhl18 bool = l >= 0 - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv19 := &x.JobID - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Diffs = false - } else { - yyv21 := &x.Diffs - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*bool)(yyv21)) = r.DecodeBool() - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv23 := &x.Region - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*string)(yyv23)) = r.DecodeString() - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MinQueryIndex = 0 - } else { - yyv25 := &x.MinQueryIndex - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*uint64)(yyv25)) = uint64(r.DecodeUint(64)) - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MaxQueryTime = 0 - } else { - yyv27 := &x.MaxQueryTime - yym28 := z.DecBinary() - _ = yym28 - if false { - } else if z.HasExtensions() && z.DecExt(yyv27) { - } else { - *((*int64)(yyv27)) = int64(r.DecodeInt(64)) - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllowStale = false - } else { - yyv29 := &x.AllowStale - yym30 := z.DecBinary() - _ = yym30 - if false { - } else { - *((*bool)(yyv29)) = r.DecodeBool() - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv31 := &x.Prefix - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - *((*string)(yyv31)) = r.DecodeString() - } - } - for { - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj18-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobVersionsResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) - } else { - yynn2 = 5 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Versions == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSlicePtrtoJob(([]*Job)(x.Versions), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Versions")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Versions == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSlicePtrtoJob(([]*Job)(x.Versions), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Diffs == nil { - r.EncodeNil() - } else { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - h.encSlicePtrtoJobDiff(([]*JobDiff)(x.Diffs), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Diffs")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Diffs == nil { - r.EncodeNil() - } else { - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - h.encSlicePtrtoJobDiff(([]*JobDiff)(x.Diffs), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobVersionsResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobVersionsResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Versions": - if r.TryDecodeAsNil() { - x.Versions = nil - } else { - yyv4 := &x.Versions - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSlicePtrtoJob((*[]*Job)(yyv4), d) - } - } - case "Diffs": - if r.TryDecodeAsNil() { - x.Diffs = nil - } else { - yyv6 := &x.Diffs - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - h.decSlicePtrtoJobDiff((*[]*JobDiff)(yyv6), d) - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv8 := &x.Index - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint64)(yyv8)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv10 := &x.LastContact - yym11 := z.DecBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.DecExt(yyv10) { - } else { - *((*int64)(yyv10)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv12 := &x.KnownLeader - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*bool)(yyv12)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobVersionsResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj14 int - var yyb14 bool - var yyhl14 bool = l >= 0 - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Versions = nil - } else { - yyv15 := &x.Versions - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - h.decSlicePtrtoJob((*[]*Job)(yyv15), d) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Diffs = nil - } else { - yyv17 := &x.Diffs - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - h.decSlicePtrtoJobDiff((*[]*JobDiff)(yyv17), d) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv19 := &x.Index - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*uint64)(yyv19)) = uint64(r.DecodeUint(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv21 := &x.LastContact - yym22 := z.DecBinary() - _ = yym22 - if false { - } else if z.HasExtensions() && z.DecExt(yyv21) { - } else { - *((*int64)(yyv21)) = int64(r.DecodeInt(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv23 := &x.KnownLeader - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*bool)(yyv23)) = r.DecodeBool() - } - } - for { - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj14-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobPlanResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [8]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(8) - } else { - yynn2 = 8 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Annotations == nil { - r.EncodeNil() - } else { - x.Annotations.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Annotations")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Annotations == nil { - r.EncodeNil() - } else { - x.Annotations.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.FailedTGAllocs == nil { - r.EncodeNil() - } else { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - h.encMapstringPtrtoAllocMetric((map[string]*AllocMetric)(x.FailedTGAllocs), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("FailedTGAllocs")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.FailedTGAllocs == nil { - r.EncodeNil() - } else { - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - h.encMapstringPtrtoAllocMetric((map[string]*AllocMetric)(x.FailedTGAllocs), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.JobModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.JobModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.CreatedEvals == nil { - r.EncodeNil() - } else { - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - h.encSlicePtrtoEvaluation(([]*Evaluation)(x.CreatedEvals), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("CreatedEvals")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.CreatedEvals == nil { - r.EncodeNil() - } else { - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - h.encSlicePtrtoEvaluation(([]*Evaluation)(x.CreatedEvals), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Diff == nil { - r.EncodeNil() - } else { - yym16 := z.EncBinary() - _ = yym16 - if false { - } else if z.HasExtensions() && z.EncExt(x.Diff) { - } else { - z.EncFallback(x.Diff) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Diff")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Diff == nil { - r.EncodeNil() - } else { - yym17 := z.EncBinary() - _ = yym17 - if false { - } else if z.HasExtensions() && z.EncExt(x.Diff) { - } else { - z.EncFallback(x.Diff) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yy19 := &x.NextPeriodicLaunch - yym20 := z.EncBinary() - _ = yym20 - if false { - } else if yym21 := z.TimeRtidIfBinc(); yym21 != 0 { - r.EncodeBuiltin(yym21, yy19) - } else if z.HasExtensions() && z.EncExt(yy19) { - } else if yym20 { - z.EncBinaryMarshal(yy19) - } else if !yym20 && z.IsJSONHandle() { - z.EncJSONMarshal(yy19) - } else { - z.EncFallback(yy19) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NextPeriodicLaunch")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yy22 := &x.NextPeriodicLaunch - yym23 := z.EncBinary() - _ = yym23 - if false { - } else if yym24 := z.TimeRtidIfBinc(); yym24 != 0 { - r.EncodeBuiltin(yym24, yy22) - } else if z.HasExtensions() && z.EncExt(yy22) { - } else if yym23 { - z.EncBinaryMarshal(yy22) - } else if !yym23 && z.IsJSONHandle() { - z.EncJSONMarshal(yy22) - } else { - z.EncFallback(yy22) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Warnings)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Warnings")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym27 := z.EncBinary() - _ = yym27 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Warnings)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym29 := z.EncBinary() - _ = yym29 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym30 := z.EncBinary() - _ = yym30 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobPlanResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobPlanResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Annotations": - if r.TryDecodeAsNil() { - if x.Annotations != nil { - x.Annotations = nil - } - } else { - if x.Annotations == nil { - x.Annotations = new(PlanAnnotations) - } - x.Annotations.CodecDecodeSelf(d) - } - case "FailedTGAllocs": - if r.TryDecodeAsNil() { - x.FailedTGAllocs = nil - } else { - yyv5 := &x.FailedTGAllocs - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - h.decMapstringPtrtoAllocMetric((*map[string]*AllocMetric)(yyv5), d) - } - } - case "JobModifyIndex": - if r.TryDecodeAsNil() { - x.JobModifyIndex = 0 - } else { - yyv7 := &x.JobModifyIndex - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - *((*uint64)(yyv7)) = uint64(r.DecodeUint(64)) - } - } - case "CreatedEvals": - if r.TryDecodeAsNil() { - x.CreatedEvals = nil - } else { - yyv9 := &x.CreatedEvals - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - h.decSlicePtrtoEvaluation((*[]*Evaluation)(yyv9), d) - } - } - case "Diff": - if r.TryDecodeAsNil() { - if x.Diff != nil { - x.Diff = nil - } - } else { - if x.Diff == nil { - x.Diff = new(JobDiff) - } - yym12 := z.DecBinary() - _ = yym12 - if false { - } else if z.HasExtensions() && z.DecExt(x.Diff) { - } else { - z.DecFallback(x.Diff, false) - } - } - case "NextPeriodicLaunch": - if r.TryDecodeAsNil() { - x.NextPeriodicLaunch = time.Time{} - } else { - yyv13 := &x.NextPeriodicLaunch - yym14 := z.DecBinary() - _ = yym14 - if false { - } else if yym15 := z.TimeRtidIfBinc(); yym15 != 0 { - r.DecodeBuiltin(yym15, yyv13) - } else if z.HasExtensions() && z.DecExt(yyv13) { - } else if yym14 { - z.DecBinaryUnmarshal(yyv13) - } else if !yym14 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv13) - } else { - z.DecFallback(yyv13, false) - } - } - case "Warnings": - if r.TryDecodeAsNil() { - x.Warnings = "" - } else { - yyv16 := &x.Warnings - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*string)(yyv16)) = r.DecodeString() - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv18 := &x.Index - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - *((*uint64)(yyv18)) = uint64(r.DecodeUint(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobPlanResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj20 int - var yyb20 bool - var yyhl20 bool = l >= 0 - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Annotations != nil { - x.Annotations = nil - } - } else { - if x.Annotations == nil { - x.Annotations = new(PlanAnnotations) - } - x.Annotations.CodecDecodeSelf(d) - } - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.FailedTGAllocs = nil - } else { - yyv22 := &x.FailedTGAllocs - yym23 := z.DecBinary() - _ = yym23 - if false { - } else { - h.decMapstringPtrtoAllocMetric((*map[string]*AllocMetric)(yyv22), d) - } - } - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobModifyIndex = 0 - } else { - yyv24 := &x.JobModifyIndex - yym25 := z.DecBinary() - _ = yym25 - if false { - } else { - *((*uint64)(yyv24)) = uint64(r.DecodeUint(64)) - } - } - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.CreatedEvals = nil - } else { - yyv26 := &x.CreatedEvals - yym27 := z.DecBinary() - _ = yym27 - if false { - } else { - h.decSlicePtrtoEvaluation((*[]*Evaluation)(yyv26), d) - } - } - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Diff != nil { - x.Diff = nil - } - } else { - if x.Diff == nil { - x.Diff = new(JobDiff) - } - yym29 := z.DecBinary() - _ = yym29 - if false { - } else if z.HasExtensions() && z.DecExt(x.Diff) { - } else { - z.DecFallback(x.Diff, false) - } - } - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NextPeriodicLaunch = time.Time{} - } else { - yyv30 := &x.NextPeriodicLaunch - yym31 := z.DecBinary() - _ = yym31 - if false { - } else if yym32 := z.TimeRtidIfBinc(); yym32 != 0 { - r.DecodeBuiltin(yym32, yyv30) - } else if z.HasExtensions() && z.DecExt(yyv30) { - } else if yym31 { - z.DecBinaryUnmarshal(yyv30) - } else if !yym31 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv30) - } else { - z.DecFallback(yyv30, false) - } - } - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Warnings = "" - } else { - yyv33 := &x.Warnings - yym34 := z.DecBinary() - _ = yym34 - if false { - } else { - *((*string)(yyv33)) = r.DecodeString() - } - } - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv35 := &x.Index - yym36 := z.DecBinary() - _ = yym36 - if false { - } else { - *((*uint64)(yyv35)) = uint64(r.DecodeUint(64)) - } - } - for { - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj20-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *SingleAllocResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Alloc == nil { - r.EncodeNil() - } else { - x.Alloc.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Alloc")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Alloc == nil { - r.EncodeNil() - } else { - x.Alloc.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *SingleAllocResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *SingleAllocResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Alloc": - if r.TryDecodeAsNil() { - if x.Alloc != nil { - x.Alloc = nil - } - } else { - if x.Alloc == nil { - x.Alloc = new(Allocation) - } - x.Alloc.CodecDecodeSelf(d) - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv5 := &x.Index - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - *((*uint64)(yyv5)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv7 := &x.LastContact - yym8 := z.DecBinary() - _ = yym8 - if false { - } else if z.HasExtensions() && z.DecExt(yyv7) { - } else { - *((*int64)(yyv7)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv9 := &x.KnownLeader - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*bool)(yyv9)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *SingleAllocResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj11 int - var yyb11 bool - var yyhl11 bool = l >= 0 - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Alloc != nil { - x.Alloc = nil - } - } else { - if x.Alloc == nil { - x.Alloc = new(Allocation) - } - x.Alloc.CodecDecodeSelf(d) - } - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv13 := &x.Index - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*uint64)(yyv13)) = uint64(r.DecodeUint(64)) - } - } - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv15 := &x.LastContact - yym16 := z.DecBinary() - _ = yym16 - if false { - } else if z.HasExtensions() && z.DecExt(yyv15) { - } else { - *((*int64)(yyv15)) = int64(r.DecodeInt(64)) - } - } - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv17 := &x.KnownLeader - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*bool)(yyv17)) = r.DecodeBool() - } - } - for { - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj11-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *AllocsGetResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Allocs == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSlicePtrtoAllocation(([]*Allocation)(x.Allocs), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Allocs")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Allocs == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSlicePtrtoAllocation(([]*Allocation)(x.Allocs), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *AllocsGetResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *AllocsGetResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Allocs": - if r.TryDecodeAsNil() { - x.Allocs = nil - } else { - yyv4 := &x.Allocs - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSlicePtrtoAllocation((*[]*Allocation)(yyv4), d) - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv6 := &x.Index - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv8 := &x.LastContact - yym9 := z.DecBinary() - _ = yym9 - if false { - } else if z.HasExtensions() && z.DecExt(yyv8) { - } else { - *((*int64)(yyv8)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv10 := &x.KnownLeader - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *AllocsGetResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Allocs = nil - } else { - yyv13 := &x.Allocs - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - h.decSlicePtrtoAllocation((*[]*Allocation)(yyv13), d) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv15 := &x.Index - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*uint64)(yyv15)) = uint64(r.DecodeUint(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv17 := &x.LastContact - yym18 := z.DecBinary() - _ = yym18 - if false { - } else if z.HasExtensions() && z.DecExt(yyv17) { - } else { - *((*int64)(yyv17)) = int64(r.DecodeInt(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv19 := &x.KnownLeader - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*bool)(yyv19)) = r.DecodeBool() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobAllocationsResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Allocations == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSlicePtrtoAllocListStub(([]*AllocListStub)(x.Allocations), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Allocations")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Allocations == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSlicePtrtoAllocListStub(([]*AllocListStub)(x.Allocations), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobAllocationsResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobAllocationsResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Allocations": - if r.TryDecodeAsNil() { - x.Allocations = nil - } else { - yyv4 := &x.Allocations - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSlicePtrtoAllocListStub((*[]*AllocListStub)(yyv4), d) - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv6 := &x.Index - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv8 := &x.LastContact - yym9 := z.DecBinary() - _ = yym9 - if false { - } else if z.HasExtensions() && z.DecExt(yyv8) { - } else { - *((*int64)(yyv8)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv10 := &x.KnownLeader - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobAllocationsResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Allocations = nil - } else { - yyv13 := &x.Allocations - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - h.decSlicePtrtoAllocListStub((*[]*AllocListStub)(yyv13), d) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv15 := &x.Index - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*uint64)(yyv15)) = uint64(r.DecodeUint(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv17 := &x.LastContact - yym18 := z.DecBinary() - _ = yym18 - if false { - } else if z.HasExtensions() && z.DecExt(yyv17) { - } else { - *((*int64)(yyv17)) = int64(r.DecodeInt(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv19 := &x.KnownLeader - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*bool)(yyv19)) = r.DecodeBool() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobEvaluationsResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Evaluations == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSlicePtrtoEvaluation(([]*Evaluation)(x.Evaluations), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Evaluations")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Evaluations == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSlicePtrtoEvaluation(([]*Evaluation)(x.Evaluations), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobEvaluationsResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobEvaluationsResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Evaluations": - if r.TryDecodeAsNil() { - x.Evaluations = nil - } else { - yyv4 := &x.Evaluations - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSlicePtrtoEvaluation((*[]*Evaluation)(yyv4), d) - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv6 := &x.Index - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv8 := &x.LastContact - yym9 := z.DecBinary() - _ = yym9 - if false { - } else if z.HasExtensions() && z.DecExt(yyv8) { - } else { - *((*int64)(yyv8)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv10 := &x.KnownLeader - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobEvaluationsResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Evaluations = nil - } else { - yyv13 := &x.Evaluations - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - h.decSlicePtrtoEvaluation((*[]*Evaluation)(yyv13), d) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv15 := &x.Index - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*uint64)(yyv15)) = uint64(r.DecodeUint(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv17 := &x.LastContact - yym18 := z.DecBinary() - _ = yym18 - if false { - } else if z.HasExtensions() && z.DecExt(yyv17) { - } else { - *((*int64)(yyv17)) = int64(r.DecodeInt(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv19 := &x.KnownLeader - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*bool)(yyv19)) = r.DecodeBool() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *SingleEvalResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Eval == nil { - r.EncodeNil() - } else { - x.Eval.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Eval")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Eval == nil { - r.EncodeNil() - } else { - x.Eval.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *SingleEvalResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *SingleEvalResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Eval": - if r.TryDecodeAsNil() { - if x.Eval != nil { - x.Eval = nil - } - } else { - if x.Eval == nil { - x.Eval = new(Evaluation) - } - x.Eval.CodecDecodeSelf(d) - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv5 := &x.Index - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - *((*uint64)(yyv5)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv7 := &x.LastContact - yym8 := z.DecBinary() - _ = yym8 - if false { - } else if z.HasExtensions() && z.DecExt(yyv7) { - } else { - *((*int64)(yyv7)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv9 := &x.KnownLeader - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*bool)(yyv9)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *SingleEvalResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj11 int - var yyb11 bool - var yyhl11 bool = l >= 0 - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Eval != nil { - x.Eval = nil - } - } else { - if x.Eval == nil { - x.Eval = new(Evaluation) - } - x.Eval.CodecDecodeSelf(d) - } - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv13 := &x.Index - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*uint64)(yyv13)) = uint64(r.DecodeUint(64)) - } - } - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv15 := &x.LastContact - yym16 := z.DecBinary() - _ = yym16 - if false { - } else if z.HasExtensions() && z.DecExt(yyv15) { - } else { - *((*int64)(yyv15)) = int64(r.DecodeInt(64)) - } - } - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv17 := &x.KnownLeader - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*bool)(yyv17)) = r.DecodeBool() - } - } - for { - yyj11++ - if yyhl11 { - yyb11 = yyj11 > l - } else { - yyb11 = r.CheckBreak() - } - if yyb11 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj11-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *EvalDequeueResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) - } else { - yynn2 = 5 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Eval == nil { - r.EncodeNil() - } else { - x.Eval.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Eval")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Eval == nil { - r.EncodeNil() - } else { - x.Eval.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Token)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Token")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Token)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *EvalDequeueResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *EvalDequeueResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Eval": - if r.TryDecodeAsNil() { - if x.Eval != nil { - x.Eval = nil - } - } else { - if x.Eval == nil { - x.Eval = new(Evaluation) - } - x.Eval.CodecDecodeSelf(d) - } - case "Token": - if r.TryDecodeAsNil() { - x.Token = "" - } else { - yyv5 := &x.Token - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - *((*string)(yyv5)) = r.DecodeString() - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv7 := &x.Index - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - *((*uint64)(yyv7)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv9 := &x.LastContact - yym10 := z.DecBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.DecExt(yyv9) { - } else { - *((*int64)(yyv9)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv11 := &x.KnownLeader - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*bool)(yyv11)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *EvalDequeueResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj13 int - var yyb13 bool - var yyhl13 bool = l >= 0 - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Eval != nil { - x.Eval = nil - } - } else { - if x.Eval == nil { - x.Eval = new(Evaluation) - } - x.Eval.CodecDecodeSelf(d) - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Token = "" - } else { - yyv15 := &x.Token - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv17 := &x.Index - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*uint64)(yyv17)) = uint64(r.DecodeUint(64)) - } - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv19 := &x.LastContact - yym20 := z.DecBinary() - _ = yym20 - if false { - } else if z.HasExtensions() && z.DecExt(yyv19) { - } else { - *((*int64)(yyv19)) = int64(r.DecodeInt(64)) - } - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv21 := &x.KnownLeader - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*bool)(yyv21)) = r.DecodeBool() - } - } - for { - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj13-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *PlanResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Result == nil { - r.EncodeNil() - } else { - x.Result.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Result")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Result == nil { - r.EncodeNil() - } else { - x.Result.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *PlanResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *PlanResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Result": - if r.TryDecodeAsNil() { - if x.Result != nil { - x.Result = nil - } - } else { - if x.Result == nil { - x.Result = new(PlanResult) - } - x.Result.CodecDecodeSelf(d) - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv5 := &x.Index - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - *((*uint64)(yyv5)) = uint64(r.DecodeUint(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *PlanResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj7 int - var yyb7 bool - var yyhl7 bool = l >= 0 - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Result != nil { - x.Result = nil - } - } else { - if x.Result == nil { - x.Result = new(PlanResult) - } - x.Result.CodecDecodeSelf(d) - } - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv9 := &x.Index - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*uint64)(yyv9)) = uint64(r.DecodeUint(64)) - } - } - for { - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj7-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *AllocListResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Allocations == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSlicePtrtoAllocListStub(([]*AllocListStub)(x.Allocations), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Allocations")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Allocations == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSlicePtrtoAllocListStub(([]*AllocListStub)(x.Allocations), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *AllocListResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *AllocListResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Allocations": - if r.TryDecodeAsNil() { - x.Allocations = nil - } else { - yyv4 := &x.Allocations - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSlicePtrtoAllocListStub((*[]*AllocListStub)(yyv4), d) - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv6 := &x.Index - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv8 := &x.LastContact - yym9 := z.DecBinary() - _ = yym9 - if false { - } else if z.HasExtensions() && z.DecExt(yyv8) { - } else { - *((*int64)(yyv8)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv10 := &x.KnownLeader - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *AllocListResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Allocations = nil - } else { - yyv13 := &x.Allocations - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - h.decSlicePtrtoAllocListStub((*[]*AllocListStub)(yyv13), d) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv15 := &x.Index - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*uint64)(yyv15)) = uint64(r.DecodeUint(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv17 := &x.LastContact - yym18 := z.DecBinary() - _ = yym18 - if false { - } else if z.HasExtensions() && z.DecExt(yyv17) { - } else { - *((*int64)(yyv17)) = int64(r.DecodeInt(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv19 := &x.KnownLeader - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*bool)(yyv19)) = r.DecodeBool() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *DeploymentListResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Deployments == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSlicePtrtoDeployment(([]*Deployment)(x.Deployments), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Deployments")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Deployments == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSlicePtrtoDeployment(([]*Deployment)(x.Deployments), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *DeploymentListResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *DeploymentListResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Deployments": - if r.TryDecodeAsNil() { - x.Deployments = nil - } else { - yyv4 := &x.Deployments - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSlicePtrtoDeployment((*[]*Deployment)(yyv4), d) - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv6 := &x.Index - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv8 := &x.LastContact - yym9 := z.DecBinary() - _ = yym9 - if false { - } else if z.HasExtensions() && z.DecExt(yyv8) { - } else { - *((*int64)(yyv8)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv10 := &x.KnownLeader - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *DeploymentListResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Deployments = nil - } else { - yyv13 := &x.Deployments - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - h.decSlicePtrtoDeployment((*[]*Deployment)(yyv13), d) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv15 := &x.Index - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*uint64)(yyv15)) = uint64(r.DecodeUint(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv17 := &x.LastContact - yym18 := z.DecBinary() - _ = yym18 - if false { - } else if z.HasExtensions() && z.DecExt(yyv17) { - } else { - *((*int64)(yyv17)) = int64(r.DecodeInt(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv19 := &x.KnownLeader - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*bool)(yyv19)) = r.DecodeBool() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *EvalListResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Evaluations == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSlicePtrtoEvaluation(([]*Evaluation)(x.Evaluations), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Evaluations")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Evaluations == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSlicePtrtoEvaluation(([]*Evaluation)(x.Evaluations), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *EvalListResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *EvalListResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Evaluations": - if r.TryDecodeAsNil() { - x.Evaluations = nil - } else { - yyv4 := &x.Evaluations - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSlicePtrtoEvaluation((*[]*Evaluation)(yyv4), d) - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv6 := &x.Index - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv8 := &x.LastContact - yym9 := z.DecBinary() - _ = yym9 - if false { - } else if z.HasExtensions() && z.DecExt(yyv8) { - } else { - *((*int64)(yyv8)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv10 := &x.KnownLeader - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *EvalListResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Evaluations = nil - } else { - yyv13 := &x.Evaluations - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - h.decSlicePtrtoEvaluation((*[]*Evaluation)(yyv13), d) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv15 := &x.Index - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*uint64)(yyv15)) = uint64(r.DecodeUint(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv17 := &x.LastContact - yym18 := z.DecBinary() - _ = yym18 - if false { - } else if z.HasExtensions() && z.DecExt(yyv17) { - } else { - *((*int64)(yyv17)) = int64(r.DecodeInt(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv19 := &x.KnownLeader - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*bool)(yyv19)) = r.DecodeBool() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *EvalAllocationsResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Allocations == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSlicePtrtoAllocListStub(([]*AllocListStub)(x.Allocations), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Allocations")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Allocations == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSlicePtrtoAllocListStub(([]*AllocListStub)(x.Allocations), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastContact")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.LastContact) { - } else { - r.EncodeInt(int64(x.LastContact)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KnownLeader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.KnownLeader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *EvalAllocationsResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *EvalAllocationsResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Allocations": - if r.TryDecodeAsNil() { - x.Allocations = nil - } else { - yyv4 := &x.Allocations - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSlicePtrtoAllocListStub((*[]*AllocListStub)(yyv4), d) - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv6 := &x.Index - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "LastContact": - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv8 := &x.LastContact - yym9 := z.DecBinary() - _ = yym9 - if false { - } else if z.HasExtensions() && z.DecExt(yyv8) { - } else { - *((*int64)(yyv8)) = int64(r.DecodeInt(64)) - } - } - case "KnownLeader": - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv10 := &x.KnownLeader - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *EvalAllocationsResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Allocations = nil - } else { - yyv13 := &x.Allocations - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - h.decSlicePtrtoAllocListStub((*[]*AllocListStub)(yyv13), d) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv15 := &x.Index - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*uint64)(yyv15)) = uint64(r.DecodeUint(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastContact = 0 - } else { - yyv17 := &x.LastContact - yym18 := z.DecBinary() - _ = yym18 - if false { - } else if z.HasExtensions() && z.DecExt(yyv17) { - } else { - *((*int64)(yyv17)) = int64(r.DecodeInt(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KnownLeader = false - } else { - yyv19 := &x.KnownLeader - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*bool)(yyv19)) = r.DecodeBool() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *PeriodicForceResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EvalID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.EvalCreateIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EvalCreateIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.EvalCreateIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *PeriodicForceResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *PeriodicForceResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "EvalID": - if r.TryDecodeAsNil() { - x.EvalID = "" - } else { - yyv4 := &x.EvalID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "EvalCreateIndex": - if r.TryDecodeAsNil() { - x.EvalCreateIndex = 0 - } else { - yyv6 := &x.EvalCreateIndex - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv8 := &x.Index - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint64)(yyv8)) = uint64(r.DecodeUint(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *PeriodicForceResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EvalID = "" - } else { - yyv11 := &x.EvalID - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*string)(yyv11)) = r.DecodeString() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EvalCreateIndex = 0 - } else { - yyv13 := &x.EvalCreateIndex - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*uint64)(yyv13)) = uint64(r.DecodeUint(64)) - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv15 := &x.Index - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*uint64)(yyv15)) = uint64(r.DecodeUint(64)) - } - } - for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj10-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *DeploymentUpdateResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) - } else { - yynn2 = 5 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EvalID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.EvalCreateIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EvalCreateIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.EvalCreateIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.DeploymentModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DeploymentModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.DeploymentModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.RevertedJobVersion == nil { - r.EncodeNil() - } else { - yy13 := *x.RevertedJobVersion - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeUint(uint64(yy13)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("RevertedJobVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.RevertedJobVersion == nil { - r.EncodeNil() - } else { - yy15 := *x.RevertedJobVersion - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeUint(uint64(yy15)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym18 := z.EncBinary() - _ = yym18 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Index")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *DeploymentUpdateResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *DeploymentUpdateResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "EvalID": - if r.TryDecodeAsNil() { - x.EvalID = "" - } else { - yyv4 := &x.EvalID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "EvalCreateIndex": - if r.TryDecodeAsNil() { - x.EvalCreateIndex = 0 - } else { - yyv6 := &x.EvalCreateIndex - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "DeploymentModifyIndex": - if r.TryDecodeAsNil() { - x.DeploymentModifyIndex = 0 - } else { - yyv8 := &x.DeploymentModifyIndex - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint64)(yyv8)) = uint64(r.DecodeUint(64)) - } - } - case "RevertedJobVersion": - if r.TryDecodeAsNil() { - if x.RevertedJobVersion != nil { - x.RevertedJobVersion = nil - } - } else { - if x.RevertedJobVersion == nil { - x.RevertedJobVersion = new(uint64) - } - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*uint64)(x.RevertedJobVersion)) = uint64(r.DecodeUint(64)) - } - } - case "Index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv12 := &x.Index - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*uint64)(yyv12)) = uint64(r.DecodeUint(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *DeploymentUpdateResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj14 int - var yyb14 bool - var yyhl14 bool = l >= 0 - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EvalID = "" - } else { - yyv15 := &x.EvalID - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EvalCreateIndex = 0 - } else { - yyv17 := &x.EvalCreateIndex - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*uint64)(yyv17)) = uint64(r.DecodeUint(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DeploymentModifyIndex = 0 - } else { - yyv19 := &x.DeploymentModifyIndex - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*uint64)(yyv19)) = uint64(r.DecodeUint(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.RevertedJobVersion != nil { - x.RevertedJobVersion = nil - } - } else { - if x.RevertedJobVersion == nil { - x.RevertedJobVersion = new(uint64) - } - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*uint64)(x.RevertedJobVersion)) = uint64(r.DecodeUint(64)) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv23 := &x.Index - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*uint64)(yyv23)) = uint64(r.DecodeUint(64)) - } - } - for { - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj14-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *Node) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [19]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(19) - } else { - yynn2 = 19 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.SecretID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("SecretID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.SecretID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Datacenter)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Datacenter")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Datacenter)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Name")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.HTTPAddr)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("HTTPAddr")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.HTTPAddr)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeBool(bool(x.TLSEnabled)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("TLSEnabled")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeBool(bool(x.TLSEnabled)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Attributes == nil { - r.EncodeNil() - } else { - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - z.F.EncMapStringStringV(x.Attributes, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Attributes")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Attributes == nil { - r.EncodeNil() - } else { - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - z.F.EncMapStringStringV(x.Attributes, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Resources == nil { - r.EncodeNil() - } else { - x.Resources.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Resources")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Resources == nil { - r.EncodeNil() - } else { - x.Resources.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Reserved == nil { - r.EncodeNil() - } else { - x.Reserved.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Reserved")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Reserved == nil { - r.EncodeNil() - } else { - x.Reserved.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Links == nil { - r.EncodeNil() - } else { - yym31 := z.EncBinary() - _ = yym31 - if false { - } else { - z.F.EncMapStringStringV(x.Links, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Links")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Links == nil { - r.EncodeNil() - } else { - yym32 := z.EncBinary() - _ = yym32 - if false { - } else { - z.F.EncMapStringStringV(x.Links, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Meta == nil { - r.EncodeNil() - } else { - yym34 := z.EncBinary() - _ = yym34 - if false { - } else { - z.F.EncMapStringStringV(x.Meta, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Meta")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Meta == nil { - r.EncodeNil() - } else { - yym35 := z.EncBinary() - _ = yym35 - if false { - } else { - z.F.EncMapStringStringV(x.Meta, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym37 := z.EncBinary() - _ = yym37 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeClass)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodeClass")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym38 := z.EncBinary() - _ = yym38 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeClass)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym40 := z.EncBinary() - _ = yym40 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ComputedClass)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ComputedClass")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym41 := z.EncBinary() - _ = yym41 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ComputedClass)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym43 := z.EncBinary() - _ = yym43 - if false { - } else { - r.EncodeBool(bool(x.Drain)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Drain")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym44 := z.EncBinary() - _ = yym44 - if false { - } else { - r.EncodeBool(bool(x.Drain)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym46 := z.EncBinary() - _ = yym46 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Status)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Status")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym47 := z.EncBinary() - _ = yym47 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Status)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym49 := z.EncBinary() - _ = yym49 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.StatusDescription)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("StatusDescription")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym50 := z.EncBinary() - _ = yym50 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.StatusDescription)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym52 := z.EncBinary() - _ = yym52 - if false { - } else { - r.EncodeInt(int64(x.StatusUpdatedAt)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("StatusUpdatedAt")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym53 := z.EncBinary() - _ = yym53 - if false { - } else { - r.EncodeInt(int64(x.StatusUpdatedAt)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym55 := z.EncBinary() - _ = yym55 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("CreateIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym56 := z.EncBinary() - _ = yym56 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym58 := z.EncBinary() - _ = yym58 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym59 := z.EncBinary() - _ = yym59 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *Node) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *Node) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "ID": - if r.TryDecodeAsNil() { - x.ID = "" - } else { - yyv4 := &x.ID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "SecretID": - if r.TryDecodeAsNil() { - x.SecretID = "" - } else { - yyv6 := &x.SecretID - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "Datacenter": - if r.TryDecodeAsNil() { - x.Datacenter = "" - } else { - yyv8 := &x.Datacenter - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "Name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv10 := &x.Name - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - case "HTTPAddr": - if r.TryDecodeAsNil() { - x.HTTPAddr = "" - } else { - yyv12 := &x.HTTPAddr - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - case "TLSEnabled": - if r.TryDecodeAsNil() { - x.TLSEnabled = false - } else { - yyv14 := &x.TLSEnabled - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*bool)(yyv14)) = r.DecodeBool() - } - } - case "Attributes": - if r.TryDecodeAsNil() { - x.Attributes = nil - } else { - yyv16 := &x.Attributes - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - z.F.DecMapStringStringX(yyv16, false, d) - } - } - case "Resources": - if r.TryDecodeAsNil() { - if x.Resources != nil { - x.Resources = nil - } - } else { - if x.Resources == nil { - x.Resources = new(Resources) - } - x.Resources.CodecDecodeSelf(d) - } - case "Reserved": - if r.TryDecodeAsNil() { - if x.Reserved != nil { - x.Reserved = nil - } - } else { - if x.Reserved == nil { - x.Reserved = new(Resources) - } - x.Reserved.CodecDecodeSelf(d) - } - case "Links": - if r.TryDecodeAsNil() { - x.Links = nil - } else { - yyv20 := &x.Links - yym21 := z.DecBinary() - _ = yym21 - if false { - } else { - z.F.DecMapStringStringX(yyv20, false, d) - } - } - case "Meta": - if r.TryDecodeAsNil() { - x.Meta = nil - } else { - yyv22 := &x.Meta - yym23 := z.DecBinary() - _ = yym23 - if false { - } else { - z.F.DecMapStringStringX(yyv22, false, d) - } - } - case "NodeClass": - if r.TryDecodeAsNil() { - x.NodeClass = "" - } else { - yyv24 := &x.NodeClass - yym25 := z.DecBinary() - _ = yym25 - if false { - } else { - *((*string)(yyv24)) = r.DecodeString() - } - } - case "ComputedClass": - if r.TryDecodeAsNil() { - x.ComputedClass = "" - } else { - yyv26 := &x.ComputedClass - yym27 := z.DecBinary() - _ = yym27 - if false { - } else { - *((*string)(yyv26)) = r.DecodeString() - } - } - case "Drain": - if r.TryDecodeAsNil() { - x.Drain = false - } else { - yyv28 := &x.Drain - yym29 := z.DecBinary() - _ = yym29 - if false { - } else { - *((*bool)(yyv28)) = r.DecodeBool() - } - } - case "Status": - if r.TryDecodeAsNil() { - x.Status = "" - } else { - yyv30 := &x.Status - yym31 := z.DecBinary() - _ = yym31 - if false { - } else { - *((*string)(yyv30)) = r.DecodeString() - } - } - case "StatusDescription": - if r.TryDecodeAsNil() { - x.StatusDescription = "" - } else { - yyv32 := &x.StatusDescription - yym33 := z.DecBinary() - _ = yym33 - if false { - } else { - *((*string)(yyv32)) = r.DecodeString() - } - } - case "StatusUpdatedAt": - if r.TryDecodeAsNil() { - x.StatusUpdatedAt = 0 - } else { - yyv34 := &x.StatusUpdatedAt - yym35 := z.DecBinary() - _ = yym35 - if false { - } else { - *((*int64)(yyv34)) = int64(r.DecodeInt(64)) - } - } - case "CreateIndex": - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv36 := &x.CreateIndex - yym37 := z.DecBinary() - _ = yym37 - if false { - } else { - *((*uint64)(yyv36)) = uint64(r.DecodeUint(64)) - } - } - case "ModifyIndex": - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv38 := &x.ModifyIndex - yym39 := z.DecBinary() - _ = yym39 - if false { - } else { - *((*uint64)(yyv38)) = uint64(r.DecodeUint(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *Node) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj40 int - var yyb40 bool - var yyhl40 bool = l >= 0 - yyj40++ - if yyhl40 { - yyb40 = yyj40 > l - } else { - yyb40 = r.CheckBreak() - } - if yyb40 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ID = "" - } else { - yyv41 := &x.ID - yym42 := z.DecBinary() - _ = yym42 - if false { - } else { - *((*string)(yyv41)) = r.DecodeString() - } - } - yyj40++ - if yyhl40 { - yyb40 = yyj40 > l - } else { - yyb40 = r.CheckBreak() - } - if yyb40 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.SecretID = "" - } else { - yyv43 := &x.SecretID - yym44 := z.DecBinary() - _ = yym44 - if false { - } else { - *((*string)(yyv43)) = r.DecodeString() - } - } - yyj40++ - if yyhl40 { - yyb40 = yyj40 > l - } else { - yyb40 = r.CheckBreak() - } - if yyb40 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Datacenter = "" - } else { - yyv45 := &x.Datacenter - yym46 := z.DecBinary() - _ = yym46 - if false { - } else { - *((*string)(yyv45)) = r.DecodeString() - } - } - yyj40++ - if yyhl40 { - yyb40 = yyj40 > l - } else { - yyb40 = r.CheckBreak() - } - if yyb40 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv47 := &x.Name - yym48 := z.DecBinary() - _ = yym48 - if false { - } else { - *((*string)(yyv47)) = r.DecodeString() - } - } - yyj40++ - if yyhl40 { - yyb40 = yyj40 > l - } else { - yyb40 = r.CheckBreak() - } - if yyb40 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.HTTPAddr = "" - } else { - yyv49 := &x.HTTPAddr - yym50 := z.DecBinary() - _ = yym50 - if false { - } else { - *((*string)(yyv49)) = r.DecodeString() - } - } - yyj40++ - if yyhl40 { - yyb40 = yyj40 > l - } else { - yyb40 = r.CheckBreak() - } - if yyb40 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.TLSEnabled = false - } else { - yyv51 := &x.TLSEnabled - yym52 := z.DecBinary() - _ = yym52 - if false { - } else { - *((*bool)(yyv51)) = r.DecodeBool() - } - } - yyj40++ - if yyhl40 { - yyb40 = yyj40 > l - } else { - yyb40 = r.CheckBreak() - } - if yyb40 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Attributes = nil - } else { - yyv53 := &x.Attributes - yym54 := z.DecBinary() - _ = yym54 - if false { - } else { - z.F.DecMapStringStringX(yyv53, false, d) - } - } - yyj40++ - if yyhl40 { - yyb40 = yyj40 > l - } else { - yyb40 = r.CheckBreak() - } - if yyb40 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Resources != nil { - x.Resources = nil - } - } else { - if x.Resources == nil { - x.Resources = new(Resources) - } - x.Resources.CodecDecodeSelf(d) - } - yyj40++ - if yyhl40 { - yyb40 = yyj40 > l - } else { - yyb40 = r.CheckBreak() - } - if yyb40 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Reserved != nil { - x.Reserved = nil - } - } else { - if x.Reserved == nil { - x.Reserved = new(Resources) - } - x.Reserved.CodecDecodeSelf(d) - } - yyj40++ - if yyhl40 { - yyb40 = yyj40 > l - } else { - yyb40 = r.CheckBreak() - } - if yyb40 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Links = nil - } else { - yyv57 := &x.Links - yym58 := z.DecBinary() - _ = yym58 - if false { - } else { - z.F.DecMapStringStringX(yyv57, false, d) - } - } - yyj40++ - if yyhl40 { - yyb40 = yyj40 > l - } else { - yyb40 = r.CheckBreak() - } - if yyb40 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Meta = nil - } else { - yyv59 := &x.Meta - yym60 := z.DecBinary() - _ = yym60 - if false { - } else { - z.F.DecMapStringStringX(yyv59, false, d) - } - } - yyj40++ - if yyhl40 { - yyb40 = yyj40 > l - } else { - yyb40 = r.CheckBreak() - } - if yyb40 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodeClass = "" - } else { - yyv61 := &x.NodeClass - yym62 := z.DecBinary() - _ = yym62 - if false { - } else { - *((*string)(yyv61)) = r.DecodeString() - } - } - yyj40++ - if yyhl40 { - yyb40 = yyj40 > l - } else { - yyb40 = r.CheckBreak() - } - if yyb40 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ComputedClass = "" - } else { - yyv63 := &x.ComputedClass - yym64 := z.DecBinary() - _ = yym64 - if false { - } else { - *((*string)(yyv63)) = r.DecodeString() - } - } - yyj40++ - if yyhl40 { - yyb40 = yyj40 > l - } else { - yyb40 = r.CheckBreak() - } - if yyb40 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Drain = false - } else { - yyv65 := &x.Drain - yym66 := z.DecBinary() - _ = yym66 - if false { - } else { - *((*bool)(yyv65)) = r.DecodeBool() - } - } - yyj40++ - if yyhl40 { - yyb40 = yyj40 > l - } else { - yyb40 = r.CheckBreak() - } - if yyb40 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Status = "" - } else { - yyv67 := &x.Status - yym68 := z.DecBinary() - _ = yym68 - if false { - } else { - *((*string)(yyv67)) = r.DecodeString() - } - } - yyj40++ - if yyhl40 { - yyb40 = yyj40 > l - } else { - yyb40 = r.CheckBreak() - } - if yyb40 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.StatusDescription = "" - } else { - yyv69 := &x.StatusDescription - yym70 := z.DecBinary() - _ = yym70 - if false { - } else { - *((*string)(yyv69)) = r.DecodeString() - } - } - yyj40++ - if yyhl40 { - yyb40 = yyj40 > l - } else { - yyb40 = r.CheckBreak() - } - if yyb40 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.StatusUpdatedAt = 0 - } else { - yyv71 := &x.StatusUpdatedAt - yym72 := z.DecBinary() - _ = yym72 - if false { - } else { - *((*int64)(yyv71)) = int64(r.DecodeInt(64)) - } - } - yyj40++ - if yyhl40 { - yyb40 = yyj40 > l - } else { - yyb40 = r.CheckBreak() - } - if yyb40 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv73 := &x.CreateIndex - yym74 := z.DecBinary() - _ = yym74 - if false { - } else { - *((*uint64)(yyv73)) = uint64(r.DecodeUint(64)) - } - } - yyj40++ - if yyhl40 { - yyb40 = yyj40 > l - } else { - yyb40 = r.CheckBreak() - } - if yyb40 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv75 := &x.ModifyIndex - yym76 := z.DecBinary() - _ = yym76 - if false { - } else { - *((*uint64)(yyv75)) = uint64(r.DecodeUint(64)) - } - } - for { - yyj40++ - if yyhl40 { - yyb40 = yyj40 > l - } else { - yyb40 = r.CheckBreak() - } - if yyb40 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj40-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *NodeListStub) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [10]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(10) - } else { - yynn2 = 10 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Datacenter)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Datacenter")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Datacenter)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Name")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeClass)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodeClass")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeClass)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Version)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Version")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Version)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeBool(bool(x.Drain)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Drain")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeBool(bool(x.Drain)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Status)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Status")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Status)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym25 := z.EncBinary() - _ = yym25 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.StatusDescription)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("StatusDescription")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.StatusDescription)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym28 := z.EncBinary() - _ = yym28 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("CreateIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym29 := z.EncBinary() - _ = yym29 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym31 := z.EncBinary() - _ = yym31 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym32 := z.EncBinary() - _ = yym32 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *NodeListStub) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *NodeListStub) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "ID": - if r.TryDecodeAsNil() { - x.ID = "" - } else { - yyv4 := &x.ID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Datacenter": - if r.TryDecodeAsNil() { - x.Datacenter = "" - } else { - yyv6 := &x.Datacenter - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "Name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv8 := &x.Name - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "NodeClass": - if r.TryDecodeAsNil() { - x.NodeClass = "" - } else { - yyv10 := &x.NodeClass - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - case "Version": - if r.TryDecodeAsNil() { - x.Version = "" - } else { - yyv12 := &x.Version - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - case "Drain": - if r.TryDecodeAsNil() { - x.Drain = false - } else { - yyv14 := &x.Drain - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*bool)(yyv14)) = r.DecodeBool() - } - } - case "Status": - if r.TryDecodeAsNil() { - x.Status = "" - } else { - yyv16 := &x.Status - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*string)(yyv16)) = r.DecodeString() - } - } - case "StatusDescription": - if r.TryDecodeAsNil() { - x.StatusDescription = "" - } else { - yyv18 := &x.StatusDescription - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - *((*string)(yyv18)) = r.DecodeString() - } - } - case "CreateIndex": - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv20 := &x.CreateIndex - yym21 := z.DecBinary() - _ = yym21 - if false { - } else { - *((*uint64)(yyv20)) = uint64(r.DecodeUint(64)) - } - } - case "ModifyIndex": - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv22 := &x.ModifyIndex - yym23 := z.DecBinary() - _ = yym23 - if false { - } else { - *((*uint64)(yyv22)) = uint64(r.DecodeUint(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *NodeListStub) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj24 int - var yyb24 bool - var yyhl24 bool = l >= 0 - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ID = "" - } else { - yyv25 := &x.ID - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*string)(yyv25)) = r.DecodeString() - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Datacenter = "" - } else { - yyv27 := &x.Datacenter - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*string)(yyv27)) = r.DecodeString() - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv29 := &x.Name - yym30 := z.DecBinary() - _ = yym30 - if false { - } else { - *((*string)(yyv29)) = r.DecodeString() - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodeClass = "" - } else { - yyv31 := &x.NodeClass - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - *((*string)(yyv31)) = r.DecodeString() - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Version = "" - } else { - yyv33 := &x.Version - yym34 := z.DecBinary() - _ = yym34 - if false { - } else { - *((*string)(yyv33)) = r.DecodeString() - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Drain = false - } else { - yyv35 := &x.Drain - yym36 := z.DecBinary() - _ = yym36 - if false { - } else { - *((*bool)(yyv35)) = r.DecodeBool() - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Status = "" - } else { - yyv37 := &x.Status - yym38 := z.DecBinary() - _ = yym38 - if false { - } else { - *((*string)(yyv37)) = r.DecodeString() - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.StatusDescription = "" - } else { - yyv39 := &x.StatusDescription - yym40 := z.DecBinary() - _ = yym40 - if false { - } else { - *((*string)(yyv39)) = r.DecodeString() - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv41 := &x.CreateIndex - yym42 := z.DecBinary() - _ = yym42 - if false { - } else { - *((*uint64)(yyv41)) = uint64(r.DecodeUint(64)) - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv43 := &x.ModifyIndex - yym44 := z.DecBinary() - _ = yym44 - if false { - } else { - *((*uint64)(yyv43)) = uint64(r.DecodeUint(64)) - } - } - for { - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj24-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x Networks) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - h.encNetworks((Networks)(x), e) - } - } -} - -func (x *Networks) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - h.decNetworks((*Networks)(x), d) - } -} - -func (x *Resources) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) - } else { - yynn2 = 5 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeInt(int64(x.CPU)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("CPU")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeInt(int64(x.CPU)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeInt(int64(x.MemoryMB)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MemoryMB")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeInt(int64(x.MemoryMB)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeInt(int64(x.DiskMB)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DiskMB")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeInt(int64(x.DiskMB)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeInt(int64(x.IOPS)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("IOPS")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeInt(int64(x.IOPS)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Networks == nil { - r.EncodeNil() - } else { - x.Networks.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Networks")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Networks == nil { - r.EncodeNil() - } else { - x.Networks.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *Resources) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *Resources) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "CPU": - if r.TryDecodeAsNil() { - x.CPU = 0 - } else { - yyv4 := &x.CPU - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*int)(yyv4)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "MemoryMB": - if r.TryDecodeAsNil() { - x.MemoryMB = 0 - } else { - yyv6 := &x.MemoryMB - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*int)(yyv6)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "DiskMB": - if r.TryDecodeAsNil() { - x.DiskMB = 0 - } else { - yyv8 := &x.DiskMB - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*int)(yyv8)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "IOPS": - if r.TryDecodeAsNil() { - x.IOPS = 0 - } else { - yyv10 := &x.IOPS - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*int)(yyv10)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "Networks": - if r.TryDecodeAsNil() { - x.Networks = nil - } else { - yyv12 := &x.Networks - yyv12.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *Resources) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj13 int - var yyb13 bool - var yyhl13 bool = l >= 0 - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.CPU = 0 - } else { - yyv14 := &x.CPU - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*int)(yyv14)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MemoryMB = 0 - } else { - yyv16 := &x.MemoryMB - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*int)(yyv16)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DiskMB = 0 - } else { - yyv18 := &x.DiskMB - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - *((*int)(yyv18)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.IOPS = 0 - } else { - yyv20 := &x.IOPS - yym21 := z.DecBinary() - _ = yym21 - if false { - } else { - *((*int)(yyv20)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Networks = nil - } else { - yyv22 := &x.Networks - yyv22.CodecDecodeSelf(d) - } - for { - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj13-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *Port) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Label)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Label")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Label)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeInt(int64(x.Value)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Value")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeInt(int64(x.Value)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *Port) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *Port) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Label": - if r.TryDecodeAsNil() { - x.Label = "" - } else { - yyv4 := &x.Label - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Value": - if r.TryDecodeAsNil() { - x.Value = 0 - } else { - yyv6 := &x.Value - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*int)(yyv6)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *Port) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj8 int - var yyb8 bool - var yyhl8 bool = l >= 0 - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Label = "" - } else { - yyv9 := &x.Label - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*string)(yyv9)) = r.DecodeString() - } - } - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Value = 0 - } else { - yyv11 := &x.Value - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*int)(yyv11)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - for { - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj8-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *NetworkResource) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [6]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(6) - } else { - yynn2 = 6 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Device)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Device")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Device)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.CIDR)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("CIDR")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.CIDR)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.IP)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("IP")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.IP)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeInt(int64(x.MBits)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MBits")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeInt(int64(x.MBits)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.ReservedPorts == nil { - r.EncodeNil() - } else { - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - h.encSlicePort(([]Port)(x.ReservedPorts), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ReservedPorts")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.ReservedPorts == nil { - r.EncodeNil() - } else { - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - h.encSlicePort(([]Port)(x.ReservedPorts), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.DynamicPorts == nil { - r.EncodeNil() - } else { - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - h.encSlicePort(([]Port)(x.DynamicPorts), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DynamicPorts")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.DynamicPorts == nil { - r.EncodeNil() - } else { - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - h.encSlicePort(([]Port)(x.DynamicPorts), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *NetworkResource) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *NetworkResource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Device": - if r.TryDecodeAsNil() { - x.Device = "" - } else { - yyv4 := &x.Device - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "CIDR": - if r.TryDecodeAsNil() { - x.CIDR = "" - } else { - yyv6 := &x.CIDR - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "IP": - if r.TryDecodeAsNil() { - x.IP = "" - } else { - yyv8 := &x.IP - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "MBits": - if r.TryDecodeAsNil() { - x.MBits = 0 - } else { - yyv10 := &x.MBits - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*int)(yyv10)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "ReservedPorts": - if r.TryDecodeAsNil() { - x.ReservedPorts = nil - } else { - yyv12 := &x.ReservedPorts - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - h.decSlicePort((*[]Port)(yyv12), d) - } - } - case "DynamicPorts": - if r.TryDecodeAsNil() { - x.DynamicPorts = nil - } else { - yyv14 := &x.DynamicPorts - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - h.decSlicePort((*[]Port)(yyv14), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *NetworkResource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj16 int - var yyb16 bool - var yyhl16 bool = l >= 0 - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Device = "" - } else { - yyv17 := &x.Device - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(yyv17)) = r.DecodeString() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.CIDR = "" - } else { - yyv19 := &x.CIDR - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.IP = "" - } else { - yyv21 := &x.IP - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*string)(yyv21)) = r.DecodeString() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MBits = 0 - } else { - yyv23 := &x.MBits - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*int)(yyv23)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ReservedPorts = nil - } else { - yyv25 := &x.ReservedPorts - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - h.decSlicePort((*[]Port)(yyv25), d) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DynamicPorts = nil - } else { - yyv27 := &x.DynamicPorts - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - h.decSlicePort((*[]Port)(yyv27), d) - } - } - for { - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj16-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *Job) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [25]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(25) - } else { - yynn2 = 25 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeBool(bool(x.Stop)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Stop")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeBool(bool(x.Stop)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Region")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Region)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ParentID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ParentID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ParentID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Name")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Type)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Type")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Type)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeInt(int64(x.Priority)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Priority")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeInt(int64(x.Priority)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym25 := z.EncBinary() - _ = yym25 - if false { - } else { - r.EncodeBool(bool(x.AllAtOnce)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllAtOnce")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - r.EncodeBool(bool(x.AllAtOnce)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Datacenters == nil { - r.EncodeNil() - } else { - yym28 := z.EncBinary() - _ = yym28 - if false { - } else { - z.F.EncSliceStringV(x.Datacenters, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Datacenters")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Datacenters == nil { - r.EncodeNil() - } else { - yym29 := z.EncBinary() - _ = yym29 - if false { - } else { - z.F.EncSliceStringV(x.Datacenters, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Constraints == nil { - r.EncodeNil() - } else { - yym31 := z.EncBinary() - _ = yym31 - if false { - } else { - h.encSlicePtrtoConstraint(([]*Constraint)(x.Constraints), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Constraints")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Constraints == nil { - r.EncodeNil() - } else { - yym32 := z.EncBinary() - _ = yym32 - if false { - } else { - h.encSlicePtrtoConstraint(([]*Constraint)(x.Constraints), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.TaskGroups == nil { - r.EncodeNil() - } else { - yym34 := z.EncBinary() - _ = yym34 - if false { - } else { - h.encSlicePtrtoTaskGroup(([]*TaskGroup)(x.TaskGroups), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("TaskGroups")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.TaskGroups == nil { - r.EncodeNil() - } else { - yym35 := z.EncBinary() - _ = yym35 - if false { - } else { - h.encSlicePtrtoTaskGroup(([]*TaskGroup)(x.TaskGroups), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yy37 := &x.Update - yy37.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Update")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yy39 := &x.Update - yy39.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Periodic == nil { - r.EncodeNil() - } else { - x.Periodic.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Periodic")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Periodic == nil { - r.EncodeNil() - } else { - x.Periodic.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.ParameterizedJob == nil { - r.EncodeNil() - } else { - x.ParameterizedJob.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ParameterizedJob")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.ParameterizedJob == nil { - r.EncodeNil() - } else { - x.ParameterizedJob.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Payload == nil { - r.EncodeNil() - } else { - yym48 := z.EncBinary() - _ = yym48 - if false { - } else { - r.EncodeStringBytes(codecSelferC_RAW5247, []byte(x.Payload)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Payload")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Payload == nil { - r.EncodeNil() - } else { - yym49 := z.EncBinary() - _ = yym49 - if false { - } else { - r.EncodeStringBytes(codecSelferC_RAW5247, []byte(x.Payload)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Meta == nil { - r.EncodeNil() - } else { - yym51 := z.EncBinary() - _ = yym51 - if false { - } else { - z.F.EncMapStringStringV(x.Meta, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Meta")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Meta == nil { - r.EncodeNil() - } else { - yym52 := z.EncBinary() - _ = yym52 - if false { - } else { - z.F.EncMapStringStringV(x.Meta, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym54 := z.EncBinary() - _ = yym54 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.VaultToken)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("VaultToken")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym55 := z.EncBinary() - _ = yym55 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.VaultToken)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym57 := z.EncBinary() - _ = yym57 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Status)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Status")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym58 := z.EncBinary() - _ = yym58 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Status)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym60 := z.EncBinary() - _ = yym60 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.StatusDescription)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("StatusDescription")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym61 := z.EncBinary() - _ = yym61 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.StatusDescription)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym63 := z.EncBinary() - _ = yym63 - if false { - } else { - r.EncodeBool(bool(x.Stable)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Stable")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym64 := z.EncBinary() - _ = yym64 - if false { - } else { - r.EncodeBool(bool(x.Stable)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym66 := z.EncBinary() - _ = yym66 - if false { - } else { - r.EncodeUint(uint64(x.Version)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Version")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym67 := z.EncBinary() - _ = yym67 - if false { - } else { - r.EncodeUint(uint64(x.Version)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym69 := z.EncBinary() - _ = yym69 - if false { - } else { - r.EncodeInt(int64(x.SubmitTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("SubmitTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym70 := z.EncBinary() - _ = yym70 - if false { - } else { - r.EncodeInt(int64(x.SubmitTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym72 := z.EncBinary() - _ = yym72 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("CreateIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym73 := z.EncBinary() - _ = yym73 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym75 := z.EncBinary() - _ = yym75 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym76 := z.EncBinary() - _ = yym76 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym78 := z.EncBinary() - _ = yym78 - if false { - } else { - r.EncodeUint(uint64(x.JobModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym79 := z.EncBinary() - _ = yym79 - if false { - } else { - r.EncodeUint(uint64(x.JobModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *Job) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *Job) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Stop": - if r.TryDecodeAsNil() { - x.Stop = false - } else { - yyv4 := &x.Stop - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*bool)(yyv4)) = r.DecodeBool() - } - } - case "Region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv6 := &x.Region - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "ID": - if r.TryDecodeAsNil() { - x.ID = "" - } else { - yyv8 := &x.ID - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "ParentID": - if r.TryDecodeAsNil() { - x.ParentID = "" - } else { - yyv10 := &x.ParentID - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - case "Name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv12 := &x.Name - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - case "Type": - if r.TryDecodeAsNil() { - x.Type = "" - } else { - yyv14 := &x.Type - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*string)(yyv14)) = r.DecodeString() - } - } - case "Priority": - if r.TryDecodeAsNil() { - x.Priority = 0 - } else { - yyv16 := &x.Priority - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*int)(yyv16)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "AllAtOnce": - if r.TryDecodeAsNil() { - x.AllAtOnce = false - } else { - yyv18 := &x.AllAtOnce - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - *((*bool)(yyv18)) = r.DecodeBool() - } - } - case "Datacenters": - if r.TryDecodeAsNil() { - x.Datacenters = nil - } else { - yyv20 := &x.Datacenters - yym21 := z.DecBinary() - _ = yym21 - if false { - } else { - z.F.DecSliceStringX(yyv20, false, d) - } - } - case "Constraints": - if r.TryDecodeAsNil() { - x.Constraints = nil - } else { - yyv22 := &x.Constraints - yym23 := z.DecBinary() - _ = yym23 - if false { - } else { - h.decSlicePtrtoConstraint((*[]*Constraint)(yyv22), d) - } - } - case "TaskGroups": - if r.TryDecodeAsNil() { - x.TaskGroups = nil - } else { - yyv24 := &x.TaskGroups - yym25 := z.DecBinary() - _ = yym25 - if false { - } else { - h.decSlicePtrtoTaskGroup((*[]*TaskGroup)(yyv24), d) - } - } - case "Update": - if r.TryDecodeAsNil() { - x.Update = UpdateStrategy{} - } else { - yyv26 := &x.Update - yyv26.CodecDecodeSelf(d) - } - case "Periodic": - if r.TryDecodeAsNil() { - if x.Periodic != nil { - x.Periodic = nil - } - } else { - if x.Periodic == nil { - x.Periodic = new(PeriodicConfig) - } - x.Periodic.CodecDecodeSelf(d) - } - case "ParameterizedJob": - if r.TryDecodeAsNil() { - if x.ParameterizedJob != nil { - x.ParameterizedJob = nil - } - } else { - if x.ParameterizedJob == nil { - x.ParameterizedJob = new(ParameterizedJobConfig) - } - x.ParameterizedJob.CodecDecodeSelf(d) - } - case "Payload": - if r.TryDecodeAsNil() { - x.Payload = nil - } else { - yyv29 := &x.Payload - yym30 := z.DecBinary() - _ = yym30 - if false { - } else { - *yyv29 = r.DecodeBytes(*(*[]byte)(yyv29), false, false) - } - } - case "Meta": - if r.TryDecodeAsNil() { - x.Meta = nil - } else { - yyv31 := &x.Meta - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - z.F.DecMapStringStringX(yyv31, false, d) - } - } - case "VaultToken": - if r.TryDecodeAsNil() { - x.VaultToken = "" - } else { - yyv33 := &x.VaultToken - yym34 := z.DecBinary() - _ = yym34 - if false { - } else { - *((*string)(yyv33)) = r.DecodeString() - } - } - case "Status": - if r.TryDecodeAsNil() { - x.Status = "" - } else { - yyv35 := &x.Status - yym36 := z.DecBinary() - _ = yym36 - if false { - } else { - *((*string)(yyv35)) = r.DecodeString() - } - } - case "StatusDescription": - if r.TryDecodeAsNil() { - x.StatusDescription = "" - } else { - yyv37 := &x.StatusDescription - yym38 := z.DecBinary() - _ = yym38 - if false { - } else { - *((*string)(yyv37)) = r.DecodeString() - } - } - case "Stable": - if r.TryDecodeAsNil() { - x.Stable = false - } else { - yyv39 := &x.Stable - yym40 := z.DecBinary() - _ = yym40 - if false { - } else { - *((*bool)(yyv39)) = r.DecodeBool() - } - } - case "Version": - if r.TryDecodeAsNil() { - x.Version = 0 - } else { - yyv41 := &x.Version - yym42 := z.DecBinary() - _ = yym42 - if false { - } else { - *((*uint64)(yyv41)) = uint64(r.DecodeUint(64)) - } - } - case "SubmitTime": - if r.TryDecodeAsNil() { - x.SubmitTime = 0 - } else { - yyv43 := &x.SubmitTime - yym44 := z.DecBinary() - _ = yym44 - if false { - } else { - *((*int64)(yyv43)) = int64(r.DecodeInt(64)) - } - } - case "CreateIndex": - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv45 := &x.CreateIndex - yym46 := z.DecBinary() - _ = yym46 - if false { - } else { - *((*uint64)(yyv45)) = uint64(r.DecodeUint(64)) - } - } - case "ModifyIndex": - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv47 := &x.ModifyIndex - yym48 := z.DecBinary() - _ = yym48 - if false { - } else { - *((*uint64)(yyv47)) = uint64(r.DecodeUint(64)) - } - } - case "JobModifyIndex": - if r.TryDecodeAsNil() { - x.JobModifyIndex = 0 - } else { - yyv49 := &x.JobModifyIndex - yym50 := z.DecBinary() - _ = yym50 - if false { - } else { - *((*uint64)(yyv49)) = uint64(r.DecodeUint(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *Job) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj51 int - var yyb51 bool - var yyhl51 bool = l >= 0 - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Stop = false - } else { - yyv52 := &x.Stop - yym53 := z.DecBinary() - _ = yym53 - if false { - } else { - *((*bool)(yyv52)) = r.DecodeBool() - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - yyv54 := &x.Region - yym55 := z.DecBinary() - _ = yym55 - if false { - } else { - *((*string)(yyv54)) = r.DecodeString() - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ID = "" - } else { - yyv56 := &x.ID - yym57 := z.DecBinary() - _ = yym57 - if false { - } else { - *((*string)(yyv56)) = r.DecodeString() - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ParentID = "" - } else { - yyv58 := &x.ParentID - yym59 := z.DecBinary() - _ = yym59 - if false { - } else { - *((*string)(yyv58)) = r.DecodeString() - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv60 := &x.Name - yym61 := z.DecBinary() - _ = yym61 - if false { - } else { - *((*string)(yyv60)) = r.DecodeString() - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Type = "" - } else { - yyv62 := &x.Type - yym63 := z.DecBinary() - _ = yym63 - if false { - } else { - *((*string)(yyv62)) = r.DecodeString() - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Priority = 0 - } else { - yyv64 := &x.Priority - yym65 := z.DecBinary() - _ = yym65 - if false { - } else { - *((*int)(yyv64)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllAtOnce = false - } else { - yyv66 := &x.AllAtOnce - yym67 := z.DecBinary() - _ = yym67 - if false { - } else { - *((*bool)(yyv66)) = r.DecodeBool() - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Datacenters = nil - } else { - yyv68 := &x.Datacenters - yym69 := z.DecBinary() - _ = yym69 - if false { - } else { - z.F.DecSliceStringX(yyv68, false, d) - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Constraints = nil - } else { - yyv70 := &x.Constraints - yym71 := z.DecBinary() - _ = yym71 - if false { - } else { - h.decSlicePtrtoConstraint((*[]*Constraint)(yyv70), d) - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.TaskGroups = nil - } else { - yyv72 := &x.TaskGroups - yym73 := z.DecBinary() - _ = yym73 - if false { - } else { - h.decSlicePtrtoTaskGroup((*[]*TaskGroup)(yyv72), d) - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Update = UpdateStrategy{} - } else { - yyv74 := &x.Update - yyv74.CodecDecodeSelf(d) - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Periodic != nil { - x.Periodic = nil - } - } else { - if x.Periodic == nil { - x.Periodic = new(PeriodicConfig) - } - x.Periodic.CodecDecodeSelf(d) - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.ParameterizedJob != nil { - x.ParameterizedJob = nil - } - } else { - if x.ParameterizedJob == nil { - x.ParameterizedJob = new(ParameterizedJobConfig) - } - x.ParameterizedJob.CodecDecodeSelf(d) - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Payload = nil - } else { - yyv77 := &x.Payload - yym78 := z.DecBinary() - _ = yym78 - if false { - } else { - *yyv77 = r.DecodeBytes(*(*[]byte)(yyv77), false, false) - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Meta = nil - } else { - yyv79 := &x.Meta - yym80 := z.DecBinary() - _ = yym80 - if false { - } else { - z.F.DecMapStringStringX(yyv79, false, d) - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.VaultToken = "" - } else { - yyv81 := &x.VaultToken - yym82 := z.DecBinary() - _ = yym82 - if false { - } else { - *((*string)(yyv81)) = r.DecodeString() - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Status = "" - } else { - yyv83 := &x.Status - yym84 := z.DecBinary() - _ = yym84 - if false { - } else { - *((*string)(yyv83)) = r.DecodeString() - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.StatusDescription = "" - } else { - yyv85 := &x.StatusDescription - yym86 := z.DecBinary() - _ = yym86 - if false { - } else { - *((*string)(yyv85)) = r.DecodeString() - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Stable = false - } else { - yyv87 := &x.Stable - yym88 := z.DecBinary() - _ = yym88 - if false { - } else { - *((*bool)(yyv87)) = r.DecodeBool() - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Version = 0 - } else { - yyv89 := &x.Version - yym90 := z.DecBinary() - _ = yym90 - if false { - } else { - *((*uint64)(yyv89)) = uint64(r.DecodeUint(64)) - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.SubmitTime = 0 - } else { - yyv91 := &x.SubmitTime - yym92 := z.DecBinary() - _ = yym92 - if false { - } else { - *((*int64)(yyv91)) = int64(r.DecodeInt(64)) - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv93 := &x.CreateIndex - yym94 := z.DecBinary() - _ = yym94 - if false { - } else { - *((*uint64)(yyv93)) = uint64(r.DecodeUint(64)) - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv95 := &x.ModifyIndex - yym96 := z.DecBinary() - _ = yym96 - if false { - } else { - *((*uint64)(yyv95)) = uint64(r.DecodeUint(64)) - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobModifyIndex = 0 - } else { - yyv97 := &x.JobModifyIndex - yym98 := z.DecBinary() - _ = yym98 - if false { - } else { - *((*uint64)(yyv97)) = uint64(r.DecodeUint(64)) - } - } - for { - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj51-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobListStub) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [15]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(15) - } else { - yynn2 = 15 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ParentID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ParentID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ParentID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Name")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Type)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Type")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Type)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeInt(int64(x.Priority)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Priority")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeInt(int64(x.Priority)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeBool(bool(x.Periodic)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Periodic")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeBool(bool(x.Periodic)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeBool(bool(x.ParameterizedJob)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ParameterizedJob")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeBool(bool(x.ParameterizedJob)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym25 := z.EncBinary() - _ = yym25 - if false { - } else { - r.EncodeBool(bool(x.Stop)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Stop")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - r.EncodeBool(bool(x.Stop)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym28 := z.EncBinary() - _ = yym28 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Status)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Status")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym29 := z.EncBinary() - _ = yym29 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Status)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym31 := z.EncBinary() - _ = yym31 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.StatusDescription)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("StatusDescription")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym32 := z.EncBinary() - _ = yym32 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.StatusDescription)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.JobSummary == nil { - r.EncodeNil() - } else { - x.JobSummary.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobSummary")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.JobSummary == nil { - r.EncodeNil() - } else { - x.JobSummary.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym37 := z.EncBinary() - _ = yym37 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("CreateIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym38 := z.EncBinary() - _ = yym38 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym40 := z.EncBinary() - _ = yym40 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym41 := z.EncBinary() - _ = yym41 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym43 := z.EncBinary() - _ = yym43 - if false { - } else { - r.EncodeUint(uint64(x.JobModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym44 := z.EncBinary() - _ = yym44 - if false { - } else { - r.EncodeUint(uint64(x.JobModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym46 := z.EncBinary() - _ = yym46 - if false { - } else { - r.EncodeInt(int64(x.SubmitTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("SubmitTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym47 := z.EncBinary() - _ = yym47 - if false { - } else { - r.EncodeInt(int64(x.SubmitTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobListStub) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobListStub) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "ID": - if r.TryDecodeAsNil() { - x.ID = "" - } else { - yyv4 := &x.ID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "ParentID": - if r.TryDecodeAsNil() { - x.ParentID = "" - } else { - yyv6 := &x.ParentID - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "Name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv8 := &x.Name - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "Type": - if r.TryDecodeAsNil() { - x.Type = "" - } else { - yyv10 := &x.Type - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - case "Priority": - if r.TryDecodeAsNil() { - x.Priority = 0 - } else { - yyv12 := &x.Priority - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*int)(yyv12)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "Periodic": - if r.TryDecodeAsNil() { - x.Periodic = false - } else { - yyv14 := &x.Periodic - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*bool)(yyv14)) = r.DecodeBool() - } - } - case "ParameterizedJob": - if r.TryDecodeAsNil() { - x.ParameterizedJob = false - } else { - yyv16 := &x.ParameterizedJob - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*bool)(yyv16)) = r.DecodeBool() - } - } - case "Stop": - if r.TryDecodeAsNil() { - x.Stop = false - } else { - yyv18 := &x.Stop - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - *((*bool)(yyv18)) = r.DecodeBool() - } - } - case "Status": - if r.TryDecodeAsNil() { - x.Status = "" - } else { - yyv20 := &x.Status - yym21 := z.DecBinary() - _ = yym21 - if false { - } else { - *((*string)(yyv20)) = r.DecodeString() - } - } - case "StatusDescription": - if r.TryDecodeAsNil() { - x.StatusDescription = "" - } else { - yyv22 := &x.StatusDescription - yym23 := z.DecBinary() - _ = yym23 - if false { - } else { - *((*string)(yyv22)) = r.DecodeString() - } - } - case "JobSummary": - if r.TryDecodeAsNil() { - if x.JobSummary != nil { - x.JobSummary = nil - } - } else { - if x.JobSummary == nil { - x.JobSummary = new(JobSummary) - } - x.JobSummary.CodecDecodeSelf(d) - } - case "CreateIndex": - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv25 := &x.CreateIndex - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*uint64)(yyv25)) = uint64(r.DecodeUint(64)) - } - } - case "ModifyIndex": - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv27 := &x.ModifyIndex - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*uint64)(yyv27)) = uint64(r.DecodeUint(64)) - } - } - case "JobModifyIndex": - if r.TryDecodeAsNil() { - x.JobModifyIndex = 0 - } else { - yyv29 := &x.JobModifyIndex - yym30 := z.DecBinary() - _ = yym30 - if false { - } else { - *((*uint64)(yyv29)) = uint64(r.DecodeUint(64)) - } - } - case "SubmitTime": - if r.TryDecodeAsNil() { - x.SubmitTime = 0 - } else { - yyv31 := &x.SubmitTime - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - *((*int64)(yyv31)) = int64(r.DecodeInt(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobListStub) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj33 int - var yyb33 bool - var yyhl33 bool = l >= 0 - yyj33++ - if yyhl33 { - yyb33 = yyj33 > l - } else { - yyb33 = r.CheckBreak() - } - if yyb33 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ID = "" - } else { - yyv34 := &x.ID - yym35 := z.DecBinary() - _ = yym35 - if false { - } else { - *((*string)(yyv34)) = r.DecodeString() - } - } - yyj33++ - if yyhl33 { - yyb33 = yyj33 > l - } else { - yyb33 = r.CheckBreak() - } - if yyb33 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ParentID = "" - } else { - yyv36 := &x.ParentID - yym37 := z.DecBinary() - _ = yym37 - if false { - } else { - *((*string)(yyv36)) = r.DecodeString() - } - } - yyj33++ - if yyhl33 { - yyb33 = yyj33 > l - } else { - yyb33 = r.CheckBreak() - } - if yyb33 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv38 := &x.Name - yym39 := z.DecBinary() - _ = yym39 - if false { - } else { - *((*string)(yyv38)) = r.DecodeString() - } - } - yyj33++ - if yyhl33 { - yyb33 = yyj33 > l - } else { - yyb33 = r.CheckBreak() - } - if yyb33 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Type = "" - } else { - yyv40 := &x.Type - yym41 := z.DecBinary() - _ = yym41 - if false { - } else { - *((*string)(yyv40)) = r.DecodeString() - } - } - yyj33++ - if yyhl33 { - yyb33 = yyj33 > l - } else { - yyb33 = r.CheckBreak() - } - if yyb33 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Priority = 0 - } else { - yyv42 := &x.Priority - yym43 := z.DecBinary() - _ = yym43 - if false { - } else { - *((*int)(yyv42)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj33++ - if yyhl33 { - yyb33 = yyj33 > l - } else { - yyb33 = r.CheckBreak() - } - if yyb33 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Periodic = false - } else { - yyv44 := &x.Periodic - yym45 := z.DecBinary() - _ = yym45 - if false { - } else { - *((*bool)(yyv44)) = r.DecodeBool() - } - } - yyj33++ - if yyhl33 { - yyb33 = yyj33 > l - } else { - yyb33 = r.CheckBreak() - } - if yyb33 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ParameterizedJob = false - } else { - yyv46 := &x.ParameterizedJob - yym47 := z.DecBinary() - _ = yym47 - if false { - } else { - *((*bool)(yyv46)) = r.DecodeBool() - } - } - yyj33++ - if yyhl33 { - yyb33 = yyj33 > l - } else { - yyb33 = r.CheckBreak() - } - if yyb33 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Stop = false - } else { - yyv48 := &x.Stop - yym49 := z.DecBinary() - _ = yym49 - if false { - } else { - *((*bool)(yyv48)) = r.DecodeBool() - } - } - yyj33++ - if yyhl33 { - yyb33 = yyj33 > l - } else { - yyb33 = r.CheckBreak() - } - if yyb33 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Status = "" - } else { - yyv50 := &x.Status - yym51 := z.DecBinary() - _ = yym51 - if false { - } else { - *((*string)(yyv50)) = r.DecodeString() - } - } - yyj33++ - if yyhl33 { - yyb33 = yyj33 > l - } else { - yyb33 = r.CheckBreak() - } - if yyb33 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.StatusDescription = "" - } else { - yyv52 := &x.StatusDescription - yym53 := z.DecBinary() - _ = yym53 - if false { - } else { - *((*string)(yyv52)) = r.DecodeString() - } - } - yyj33++ - if yyhl33 { - yyb33 = yyj33 > l - } else { - yyb33 = r.CheckBreak() - } - if yyb33 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.JobSummary != nil { - x.JobSummary = nil - } - } else { - if x.JobSummary == nil { - x.JobSummary = new(JobSummary) - } - x.JobSummary.CodecDecodeSelf(d) - } - yyj33++ - if yyhl33 { - yyb33 = yyj33 > l - } else { - yyb33 = r.CheckBreak() - } - if yyb33 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv55 := &x.CreateIndex - yym56 := z.DecBinary() - _ = yym56 - if false { - } else { - *((*uint64)(yyv55)) = uint64(r.DecodeUint(64)) - } - } - yyj33++ - if yyhl33 { - yyb33 = yyj33 > l - } else { - yyb33 = r.CheckBreak() - } - if yyb33 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv57 := &x.ModifyIndex - yym58 := z.DecBinary() - _ = yym58 - if false { - } else { - *((*uint64)(yyv57)) = uint64(r.DecodeUint(64)) - } - } - yyj33++ - if yyhl33 { - yyb33 = yyj33 > l - } else { - yyb33 = r.CheckBreak() - } - if yyb33 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobModifyIndex = 0 - } else { - yyv59 := &x.JobModifyIndex - yym60 := z.DecBinary() - _ = yym60 - if false { - } else { - *((*uint64)(yyv59)) = uint64(r.DecodeUint(64)) - } - } - yyj33++ - if yyhl33 { - yyb33 = yyj33 > l - } else { - yyb33 = r.CheckBreak() - } - if yyb33 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.SubmitTime = 0 - } else { - yyv61 := &x.SubmitTime - yym62 := z.DecBinary() - _ = yym62 - if false { - } else { - *((*int64)(yyv61)) = int64(r.DecodeInt(64)) - } - } - for { - yyj33++ - if yyhl33 { - yyb33 = yyj33 > l - } else { - yyb33 = r.CheckBreak() - } - if yyb33 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj33-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobSummary) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) - } else { - yynn2 = 5 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Summary == nil { - r.EncodeNil() - } else { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - h.encMapstringTaskGroupSummary((map[string]TaskGroupSummary)(x.Summary), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Summary")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Summary == nil { - r.EncodeNil() - } else { - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - h.encMapstringTaskGroupSummary((map[string]TaskGroupSummary)(x.Summary), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Children == nil { - r.EncodeNil() - } else { - x.Children.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Children")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Children == nil { - r.EncodeNil() - } else { - x.Children.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("CreateIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobSummary) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobSummary) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "JobID": - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv4 := &x.JobID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Summary": - if r.TryDecodeAsNil() { - x.Summary = nil - } else { - yyv6 := &x.Summary - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - h.decMapstringTaskGroupSummary((*map[string]TaskGroupSummary)(yyv6), d) - } - } - case "Children": - if r.TryDecodeAsNil() { - if x.Children != nil { - x.Children = nil - } - } else { - if x.Children == nil { - x.Children = new(JobChildrenSummary) - } - x.Children.CodecDecodeSelf(d) - } - case "CreateIndex": - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv9 := &x.CreateIndex - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*uint64)(yyv9)) = uint64(r.DecodeUint(64)) - } - } - case "ModifyIndex": - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv11 := &x.ModifyIndex - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*uint64)(yyv11)) = uint64(r.DecodeUint(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobSummary) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj13 int - var yyb13 bool - var yyhl13 bool = l >= 0 - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv14 := &x.JobID - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*string)(yyv14)) = r.DecodeString() - } - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Summary = nil - } else { - yyv16 := &x.Summary - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - h.decMapstringTaskGroupSummary((*map[string]TaskGroupSummary)(yyv16), d) - } - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Children != nil { - x.Children = nil - } - } else { - if x.Children == nil { - x.Children = new(JobChildrenSummary) - } - x.Children.CodecDecodeSelf(d) - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv19 := &x.CreateIndex - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*uint64)(yyv19)) = uint64(r.DecodeUint(64)) - } - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv21 := &x.ModifyIndex - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*uint64)(yyv21)) = uint64(r.DecodeUint(64)) - } - } - for { - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj13-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *JobChildrenSummary) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeInt(int64(x.Pending)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Pending")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeInt(int64(x.Pending)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeInt(int64(x.Running)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Running")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeInt(int64(x.Running)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeInt(int64(x.Dead)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Dead")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeInt(int64(x.Dead)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *JobChildrenSummary) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *JobChildrenSummary) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Pending": - if r.TryDecodeAsNil() { - x.Pending = 0 - } else { - yyv4 := &x.Pending - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*int64)(yyv4)) = int64(r.DecodeInt(64)) - } - } - case "Running": - if r.TryDecodeAsNil() { - x.Running = 0 - } else { - yyv6 := &x.Running - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*int64)(yyv6)) = int64(r.DecodeInt(64)) - } - } - case "Dead": - if r.TryDecodeAsNil() { - x.Dead = 0 - } else { - yyv8 := &x.Dead - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*int64)(yyv8)) = int64(r.DecodeInt(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *JobChildrenSummary) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Pending = 0 - } else { - yyv11 := &x.Pending - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*int64)(yyv11)) = int64(r.DecodeInt(64)) - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Running = 0 - } else { - yyv13 := &x.Running - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*int64)(yyv13)) = int64(r.DecodeInt(64)) - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Dead = 0 - } else { - yyv15 := &x.Dead - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*int64)(yyv15)) = int64(r.DecodeInt(64)) - } - } - for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj10-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *TaskGroupSummary) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [6]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(6) - } else { - yynn2 = 6 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeInt(int64(x.Queued)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Queued")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeInt(int64(x.Queued)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeInt(int64(x.Complete)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Complete")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeInt(int64(x.Complete)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeInt(int64(x.Failed)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Failed")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeInt(int64(x.Failed)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeInt(int64(x.Running)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Running")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeInt(int64(x.Running)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeInt(int64(x.Starting)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Starting")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeInt(int64(x.Starting)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeInt(int64(x.Lost)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Lost")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeInt(int64(x.Lost)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *TaskGroupSummary) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *TaskGroupSummary) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Queued": - if r.TryDecodeAsNil() { - x.Queued = 0 - } else { - yyv4 := &x.Queued - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*int)(yyv4)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "Complete": - if r.TryDecodeAsNil() { - x.Complete = 0 - } else { - yyv6 := &x.Complete - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*int)(yyv6)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "Failed": - if r.TryDecodeAsNil() { - x.Failed = 0 - } else { - yyv8 := &x.Failed - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*int)(yyv8)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "Running": - if r.TryDecodeAsNil() { - x.Running = 0 - } else { - yyv10 := &x.Running - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*int)(yyv10)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "Starting": - if r.TryDecodeAsNil() { - x.Starting = 0 - } else { - yyv12 := &x.Starting - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*int)(yyv12)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "Lost": - if r.TryDecodeAsNil() { - x.Lost = 0 - } else { - yyv14 := &x.Lost - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*int)(yyv14)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *TaskGroupSummary) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj16 int - var yyb16 bool - var yyhl16 bool = l >= 0 - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Queued = 0 - } else { - yyv17 := &x.Queued - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*int)(yyv17)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Complete = 0 - } else { - yyv19 := &x.Complete - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*int)(yyv19)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Failed = 0 - } else { - yyv21 := &x.Failed - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*int)(yyv21)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Running = 0 - } else { - yyv23 := &x.Running - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*int)(yyv23)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Starting = 0 - } else { - yyv25 := &x.Starting - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*int)(yyv25)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Lost = 0 - } else { - yyv27 := &x.Lost - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*int)(yyv27)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - for { - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj16-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *UpdateStrategy) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [7]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(7) - } else { - yynn2 = 7 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else if z.HasExtensions() && z.EncExt(x.Stagger) { - } else { - r.EncodeInt(int64(x.Stagger)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Stagger")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else if z.HasExtensions() && z.EncExt(x.Stagger) { - } else { - r.EncodeInt(int64(x.Stagger)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeInt(int64(x.MaxParallel)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MaxParallel")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeInt(int64(x.MaxParallel)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.HealthCheck)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("HealthCheck")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.HealthCheck)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else if z.HasExtensions() && z.EncExt(x.MinHealthyTime) { - } else { - r.EncodeInt(int64(x.MinHealthyTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MinHealthyTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else if z.HasExtensions() && z.EncExt(x.MinHealthyTime) { - } else { - r.EncodeInt(int64(x.MinHealthyTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else if z.HasExtensions() && z.EncExt(x.HealthyDeadline) { - } else { - r.EncodeInt(int64(x.HealthyDeadline)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("HealthyDeadline")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else if z.HasExtensions() && z.EncExt(x.HealthyDeadline) { - } else { - r.EncodeInt(int64(x.HealthyDeadline)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeBool(bool(x.AutoRevert)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AutoRevert")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeBool(bool(x.AutoRevert)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeInt(int64(x.Canary)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Canary")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeInt(int64(x.Canary)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *UpdateStrategy) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *UpdateStrategy) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Stagger": - if r.TryDecodeAsNil() { - x.Stagger = 0 - } else { - yyv4 := &x.Stagger - yym5 := z.DecBinary() - _ = yym5 - if false { - } else if z.HasExtensions() && z.DecExt(yyv4) { - } else { - *((*int64)(yyv4)) = int64(r.DecodeInt(64)) - } - } - case "MaxParallel": - if r.TryDecodeAsNil() { - x.MaxParallel = 0 - } else { - yyv6 := &x.MaxParallel - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*int)(yyv6)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "HealthCheck": - if r.TryDecodeAsNil() { - x.HealthCheck = "" - } else { - yyv8 := &x.HealthCheck - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "MinHealthyTime": - if r.TryDecodeAsNil() { - x.MinHealthyTime = 0 - } else { - yyv10 := &x.MinHealthyTime - yym11 := z.DecBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.DecExt(yyv10) { - } else { - *((*int64)(yyv10)) = int64(r.DecodeInt(64)) - } - } - case "HealthyDeadline": - if r.TryDecodeAsNil() { - x.HealthyDeadline = 0 - } else { - yyv12 := &x.HealthyDeadline - yym13 := z.DecBinary() - _ = yym13 - if false { - } else if z.HasExtensions() && z.DecExt(yyv12) { - } else { - *((*int64)(yyv12)) = int64(r.DecodeInt(64)) - } - } - case "AutoRevert": - if r.TryDecodeAsNil() { - x.AutoRevert = false - } else { - yyv14 := &x.AutoRevert - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*bool)(yyv14)) = r.DecodeBool() - } - } - case "Canary": - if r.TryDecodeAsNil() { - x.Canary = 0 - } else { - yyv16 := &x.Canary - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*int)(yyv16)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *UpdateStrategy) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj18 int - var yyb18 bool - var yyhl18 bool = l >= 0 - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Stagger = 0 - } else { - yyv19 := &x.Stagger - yym20 := z.DecBinary() - _ = yym20 - if false { - } else if z.HasExtensions() && z.DecExt(yyv19) { - } else { - *((*int64)(yyv19)) = int64(r.DecodeInt(64)) - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MaxParallel = 0 - } else { - yyv21 := &x.MaxParallel - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*int)(yyv21)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.HealthCheck = "" - } else { - yyv23 := &x.HealthCheck - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*string)(yyv23)) = r.DecodeString() - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MinHealthyTime = 0 - } else { - yyv25 := &x.MinHealthyTime - yym26 := z.DecBinary() - _ = yym26 - if false { - } else if z.HasExtensions() && z.DecExt(yyv25) { - } else { - *((*int64)(yyv25)) = int64(r.DecodeInt(64)) - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.HealthyDeadline = 0 - } else { - yyv27 := &x.HealthyDeadline - yym28 := z.DecBinary() - _ = yym28 - if false { - } else if z.HasExtensions() && z.DecExt(yyv27) { - } else { - *((*int64)(yyv27)) = int64(r.DecodeInt(64)) - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AutoRevert = false - } else { - yyv29 := &x.AutoRevert - yym30 := z.DecBinary() - _ = yym30 - if false { - } else { - *((*bool)(yyv29)) = r.DecodeBool() - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Canary = 0 - } else { - yyv31 := &x.Canary - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - *((*int)(yyv31)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - for { - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj18-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *PeriodicConfig) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) - } else { - yynn2 = 5 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeBool(bool(x.Enabled)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Enabled")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeBool(bool(x.Enabled)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Spec)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Spec")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Spec)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.SpecType)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("SpecType")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.SpecType)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.ProhibitOverlap)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ProhibitOverlap")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.ProhibitOverlap)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.TimeZone)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("TimeZone")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.TimeZone)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *PeriodicConfig) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *PeriodicConfig) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Enabled": - if r.TryDecodeAsNil() { - x.Enabled = false - } else { - yyv4 := &x.Enabled - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*bool)(yyv4)) = r.DecodeBool() - } - } - case "Spec": - if r.TryDecodeAsNil() { - x.Spec = "" - } else { - yyv6 := &x.Spec - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "SpecType": - if r.TryDecodeAsNil() { - x.SpecType = "" - } else { - yyv8 := &x.SpecType - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "ProhibitOverlap": - if r.TryDecodeAsNil() { - x.ProhibitOverlap = false - } else { - yyv10 := &x.ProhibitOverlap - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - case "TimeZone": - if r.TryDecodeAsNil() { - x.TimeZone = "" - } else { - yyv12 := &x.TimeZone - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *PeriodicConfig) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj14 int - var yyb14 bool - var yyhl14 bool = l >= 0 - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Enabled = false - } else { - yyv15 := &x.Enabled - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*bool)(yyv15)) = r.DecodeBool() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Spec = "" - } else { - yyv17 := &x.Spec - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(yyv17)) = r.DecodeString() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.SpecType = "" - } else { - yyv19 := &x.SpecType - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ProhibitOverlap = false - } else { - yyv21 := &x.ProhibitOverlap - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*bool)(yyv21)) = r.DecodeBool() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.TimeZone = "" - } else { - yyv23 := &x.TimeZone - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*string)(yyv23)) = r.DecodeString() - } - } - for { - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj14-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *PeriodicLaunch) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yy7 := &x.Launch - yym8 := z.EncBinary() - _ = yym8 - if false { - } else if yym9 := z.TimeRtidIfBinc(); yym9 != 0 { - r.EncodeBuiltin(yym9, yy7) - } else if z.HasExtensions() && z.EncExt(yy7) { - } else if yym8 { - z.EncBinaryMarshal(yy7) - } else if !yym8 && z.IsJSONHandle() { - z.EncJSONMarshal(yy7) - } else { - z.EncFallback(yy7) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Launch")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yy10 := &x.Launch - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if yym12 := z.TimeRtidIfBinc(); yym12 != 0 { - r.EncodeBuiltin(yym12, yy10) - } else if z.HasExtensions() && z.EncExt(yy10) { - } else if yym11 { - z.EncBinaryMarshal(yy10) - } else if !yym11 && z.IsJSONHandle() { - z.EncJSONMarshal(yy10) - } else { - z.EncFallback(yy10) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("CreateIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym15 := z.EncBinary() - _ = yym15 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym18 := z.EncBinary() - _ = yym18 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *PeriodicLaunch) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *PeriodicLaunch) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "ID": - if r.TryDecodeAsNil() { - x.ID = "" - } else { - yyv4 := &x.ID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Launch": - if r.TryDecodeAsNil() { - x.Launch = time.Time{} - } else { - yyv6 := &x.Launch - yym7 := z.DecBinary() - _ = yym7 - if false { - } else if yym8 := z.TimeRtidIfBinc(); yym8 != 0 { - r.DecodeBuiltin(yym8, yyv6) - } else if z.HasExtensions() && z.DecExt(yyv6) { - } else if yym7 { - z.DecBinaryUnmarshal(yyv6) - } else if !yym7 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv6) - } else { - z.DecFallback(yyv6, false) - } - } - case "CreateIndex": - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv9 := &x.CreateIndex - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*uint64)(yyv9)) = uint64(r.DecodeUint(64)) - } - } - case "ModifyIndex": - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv11 := &x.ModifyIndex - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*uint64)(yyv11)) = uint64(r.DecodeUint(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *PeriodicLaunch) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj13 int - var yyb13 bool - var yyhl13 bool = l >= 0 - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ID = "" - } else { - yyv14 := &x.ID - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*string)(yyv14)) = r.DecodeString() - } - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Launch = time.Time{} - } else { - yyv16 := &x.Launch - yym17 := z.DecBinary() - _ = yym17 - if false { - } else if yym18 := z.TimeRtidIfBinc(); yym18 != 0 { - r.DecodeBuiltin(yym18, yyv16) - } else if z.HasExtensions() && z.DecExt(yyv16) { - } else if yym17 { - z.DecBinaryUnmarshal(yyv16) - } else if !yym17 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv16) - } else { - z.DecFallback(yyv16, false) - } - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv19 := &x.CreateIndex - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*uint64)(yyv19)) = uint64(r.DecodeUint(64)) - } - } - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv21 := &x.ModifyIndex - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*uint64)(yyv21)) = uint64(r.DecodeUint(64)) - } - } - for { - yyj13++ - if yyhl13 { - yyb13 = yyj13 > l - } else { - yyb13 = r.CheckBreak() - } - if yyb13 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj13-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *ParameterizedJobConfig) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Payload)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Payload")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Payload)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.MetaRequired == nil { - r.EncodeNil() - } else { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - z.F.EncSliceStringV(x.MetaRequired, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MetaRequired")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.MetaRequired == nil { - r.EncodeNil() - } else { - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - z.F.EncSliceStringV(x.MetaRequired, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.MetaOptional == nil { - r.EncodeNil() - } else { - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - z.F.EncSliceStringV(x.MetaOptional, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MetaOptional")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.MetaOptional == nil { - r.EncodeNil() - } else { - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - z.F.EncSliceStringV(x.MetaOptional, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *ParameterizedJobConfig) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *ParameterizedJobConfig) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Payload": - if r.TryDecodeAsNil() { - x.Payload = "" - } else { - yyv4 := &x.Payload - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "MetaRequired": - if r.TryDecodeAsNil() { - x.MetaRequired = nil - } else { - yyv6 := &x.MetaRequired - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - z.F.DecSliceStringX(yyv6, false, d) - } - } - case "MetaOptional": - if r.TryDecodeAsNil() { - x.MetaOptional = nil - } else { - yyv8 := &x.MetaOptional - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - z.F.DecSliceStringX(yyv8, false, d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *ParameterizedJobConfig) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Payload = "" - } else { - yyv11 := &x.Payload - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*string)(yyv11)) = r.DecodeString() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MetaRequired = nil - } else { - yyv13 := &x.MetaRequired - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - z.F.DecSliceStringX(yyv13, false, d) - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MetaOptional = nil - } else { - yyv15 := &x.MetaOptional - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - z.F.DecSliceStringX(yyv15, false, d) - } - } - for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj10-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *DispatchPayloadConfig) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [1]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(1) - } else { - yynn2 = 1 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.File)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("File")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.File)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *DispatchPayloadConfig) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *DispatchPayloadConfig) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "File": - if r.TryDecodeAsNil() { - x.File = "" - } else { - yyv4 := &x.File - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *DispatchPayloadConfig) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj6 int - var yyb6 bool - var yyhl6 bool = l >= 0 - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.File = "" - } else { - yyv7 := &x.File - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - *((*string)(yyv7)) = r.DecodeString() - } - } - for { - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj6-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *RestartPolicy) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeInt(int64(x.Attempts)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Attempts")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeInt(int64(x.Attempts)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else if z.HasExtensions() && z.EncExt(x.Interval) { - } else { - r.EncodeInt(int64(x.Interval)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Interval")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else if z.HasExtensions() && z.EncExt(x.Interval) { - } else { - r.EncodeInt(int64(x.Interval)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.EncExt(x.Delay) { - } else { - r.EncodeInt(int64(x.Delay)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Delay")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.EncExt(x.Delay) { - } else { - r.EncodeInt(int64(x.Delay)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Mode)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Mode")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Mode)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *RestartPolicy) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *RestartPolicy) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Attempts": - if r.TryDecodeAsNil() { - x.Attempts = 0 - } else { - yyv4 := &x.Attempts - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*int)(yyv4)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "Interval": - if r.TryDecodeAsNil() { - x.Interval = 0 - } else { - yyv6 := &x.Interval - yym7 := z.DecBinary() - _ = yym7 - if false { - } else if z.HasExtensions() && z.DecExt(yyv6) { - } else { - *((*int64)(yyv6)) = int64(r.DecodeInt(64)) - } - } - case "Delay": - if r.TryDecodeAsNil() { - x.Delay = 0 - } else { - yyv8 := &x.Delay - yym9 := z.DecBinary() - _ = yym9 - if false { - } else if z.HasExtensions() && z.DecExt(yyv8) { - } else { - *((*int64)(yyv8)) = int64(r.DecodeInt(64)) - } - } - case "Mode": - if r.TryDecodeAsNil() { - x.Mode = "" - } else { - yyv10 := &x.Mode - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *RestartPolicy) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Attempts = 0 - } else { - yyv13 := &x.Attempts - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*int)(yyv13)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Interval = 0 - } else { - yyv15 := &x.Interval - yym16 := z.DecBinary() - _ = yym16 - if false { - } else if z.HasExtensions() && z.DecExt(yyv15) { - } else { - *((*int64)(yyv15)) = int64(r.DecodeInt(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Delay = 0 - } else { - yyv17 := &x.Delay - yym18 := z.DecBinary() - _ = yym18 - if false { - } else if z.HasExtensions() && z.DecExt(yyv17) { - } else { - *((*int64)(yyv17)) = int64(r.DecodeInt(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Mode = "" - } else { - yyv19 := &x.Mode - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *TaskGroup) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [8]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(8) - } else { - yynn2 = 8 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Name")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeInt(int64(x.Count)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Count")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeInt(int64(x.Count)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Update == nil { - r.EncodeNil() - } else { - x.Update.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Update")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Update == nil { - r.EncodeNil() - } else { - x.Update.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Constraints == nil { - r.EncodeNil() - } else { - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - h.encSlicePtrtoConstraint(([]*Constraint)(x.Constraints), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Constraints")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Constraints == nil { - r.EncodeNil() - } else { - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - h.encSlicePtrtoConstraint(([]*Constraint)(x.Constraints), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.RestartPolicy == nil { - r.EncodeNil() - } else { - x.RestartPolicy.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("RestartPolicy")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.RestartPolicy == nil { - r.EncodeNil() - } else { - x.RestartPolicy.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Tasks == nil { - r.EncodeNil() - } else { - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - h.encSlicePtrtoTask(([]*Task)(x.Tasks), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Tasks")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Tasks == nil { - r.EncodeNil() - } else { - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - h.encSlicePtrtoTask(([]*Task)(x.Tasks), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.EphemeralDisk == nil { - r.EncodeNil() - } else { - x.EphemeralDisk.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EphemeralDisk")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.EphemeralDisk == nil { - r.EncodeNil() - } else { - x.EphemeralDisk.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Meta == nil { - r.EncodeNil() - } else { - yym25 := z.EncBinary() - _ = yym25 - if false { - } else { - z.F.EncMapStringStringV(x.Meta, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Meta")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Meta == nil { - r.EncodeNil() - } else { - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - z.F.EncMapStringStringV(x.Meta, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *TaskGroup) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *TaskGroup) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv4 := &x.Name - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Count": - if r.TryDecodeAsNil() { - x.Count = 0 - } else { - yyv6 := &x.Count - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*int)(yyv6)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "Update": - if r.TryDecodeAsNil() { - if x.Update != nil { - x.Update = nil - } - } else { - if x.Update == nil { - x.Update = new(UpdateStrategy) - } - x.Update.CodecDecodeSelf(d) - } - case "Constraints": - if r.TryDecodeAsNil() { - x.Constraints = nil - } else { - yyv9 := &x.Constraints - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - h.decSlicePtrtoConstraint((*[]*Constraint)(yyv9), d) - } - } - case "RestartPolicy": - if r.TryDecodeAsNil() { - if x.RestartPolicy != nil { - x.RestartPolicy = nil - } - } else { - if x.RestartPolicy == nil { - x.RestartPolicy = new(RestartPolicy) - } - x.RestartPolicy.CodecDecodeSelf(d) - } - case "Tasks": - if r.TryDecodeAsNil() { - x.Tasks = nil - } else { - yyv12 := &x.Tasks - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - h.decSlicePtrtoTask((*[]*Task)(yyv12), d) - } - } - case "EphemeralDisk": - if r.TryDecodeAsNil() { - if x.EphemeralDisk != nil { - x.EphemeralDisk = nil - } - } else { - if x.EphemeralDisk == nil { - x.EphemeralDisk = new(EphemeralDisk) - } - x.EphemeralDisk.CodecDecodeSelf(d) - } - case "Meta": - if r.TryDecodeAsNil() { - x.Meta = nil - } else { - yyv15 := &x.Meta - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - z.F.DecMapStringStringX(yyv15, false, d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *TaskGroup) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj17 int - var yyb17 bool - var yyhl17 bool = l >= 0 - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv18 := &x.Name - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - *((*string)(yyv18)) = r.DecodeString() - } - } - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Count = 0 - } else { - yyv20 := &x.Count - yym21 := z.DecBinary() - _ = yym21 - if false { - } else { - *((*int)(yyv20)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Update != nil { - x.Update = nil - } - } else { - if x.Update == nil { - x.Update = new(UpdateStrategy) - } - x.Update.CodecDecodeSelf(d) - } - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Constraints = nil - } else { - yyv23 := &x.Constraints - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - h.decSlicePtrtoConstraint((*[]*Constraint)(yyv23), d) - } - } - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.RestartPolicy != nil { - x.RestartPolicy = nil - } - } else { - if x.RestartPolicy == nil { - x.RestartPolicy = new(RestartPolicy) - } - x.RestartPolicy.CodecDecodeSelf(d) - } - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Tasks = nil - } else { - yyv26 := &x.Tasks - yym27 := z.DecBinary() - _ = yym27 - if false { - } else { - h.decSlicePtrtoTask((*[]*Task)(yyv26), d) - } - } - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.EphemeralDisk != nil { - x.EphemeralDisk = nil - } - } else { - if x.EphemeralDisk == nil { - x.EphemeralDisk = new(EphemeralDisk) - } - x.EphemeralDisk.CodecDecodeSelf(d) - } - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Meta = nil - } else { - yyv29 := &x.Meta - yym30 := z.DecBinary() - _ = yym30 - if false { - } else { - z.F.DecMapStringStringX(yyv29, false, d) - } - } - for { - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj17-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *ServiceCheck) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [13]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(13) - } else { - yynn2 = 13 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Name")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Type)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Type")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Type)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Command)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Command")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Command)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Args == nil { - r.EncodeNil() - } else { - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - z.F.EncSliceStringV(x.Args, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Args")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Args == nil { - r.EncodeNil() - } else { - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - z.F.EncSliceStringV(x.Args, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Path)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Path")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Path)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Protocol)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Protocol")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Protocol)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.PortLabel)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("PortLabel")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.PortLabel)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym25 := z.EncBinary() - _ = yym25 - if false { - } else if z.HasExtensions() && z.EncExt(x.Interval) { - } else { - r.EncodeInt(int64(x.Interval)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Interval")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym26 := z.EncBinary() - _ = yym26 - if false { - } else if z.HasExtensions() && z.EncExt(x.Interval) { - } else { - r.EncodeInt(int64(x.Interval)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym28 := z.EncBinary() - _ = yym28 - if false { - } else if z.HasExtensions() && z.EncExt(x.Timeout) { - } else { - r.EncodeInt(int64(x.Timeout)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Timeout")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym29 := z.EncBinary() - _ = yym29 - if false { - } else if z.HasExtensions() && z.EncExt(x.Timeout) { - } else { - r.EncodeInt(int64(x.Timeout)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym31 := z.EncBinary() - _ = yym31 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.InitialStatus)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("InitialStatus")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym32 := z.EncBinary() - _ = yym32 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.InitialStatus)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym34 := z.EncBinary() - _ = yym34 - if false { - } else { - r.EncodeBool(bool(x.TLSSkipVerify)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("TLSSkipVerify")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym35 := z.EncBinary() - _ = yym35 - if false { - } else { - r.EncodeBool(bool(x.TLSSkipVerify)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym37 := z.EncBinary() - _ = yym37 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Method)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Method")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym38 := z.EncBinary() - _ = yym38 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Method)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Header == nil { - r.EncodeNil() - } else { - yym40 := z.EncBinary() - _ = yym40 - if false { - } else { - h.encMapstringSlicestring((map[string][]string)(x.Header), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Header")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Header == nil { - r.EncodeNil() - } else { - yym41 := z.EncBinary() - _ = yym41 - if false { - } else { - h.encMapstringSlicestring((map[string][]string)(x.Header), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *ServiceCheck) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *ServiceCheck) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv4 := &x.Name - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Type": - if r.TryDecodeAsNil() { - x.Type = "" - } else { - yyv6 := &x.Type - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "Command": - if r.TryDecodeAsNil() { - x.Command = "" - } else { - yyv8 := &x.Command - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "Args": - if r.TryDecodeAsNil() { - x.Args = nil - } else { - yyv10 := &x.Args - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - z.F.DecSliceStringX(yyv10, false, d) - } - } - case "Path": - if r.TryDecodeAsNil() { - x.Path = "" - } else { - yyv12 := &x.Path - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - case "Protocol": - if r.TryDecodeAsNil() { - x.Protocol = "" - } else { - yyv14 := &x.Protocol - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*string)(yyv14)) = r.DecodeString() - } - } - case "PortLabel": - if r.TryDecodeAsNil() { - x.PortLabel = "" - } else { - yyv16 := &x.PortLabel - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*string)(yyv16)) = r.DecodeString() - } - } - case "Interval": - if r.TryDecodeAsNil() { - x.Interval = 0 - } else { - yyv18 := &x.Interval - yym19 := z.DecBinary() - _ = yym19 - if false { - } else if z.HasExtensions() && z.DecExt(yyv18) { - } else { - *((*int64)(yyv18)) = int64(r.DecodeInt(64)) - } - } - case "Timeout": - if r.TryDecodeAsNil() { - x.Timeout = 0 - } else { - yyv20 := &x.Timeout - yym21 := z.DecBinary() - _ = yym21 - if false { - } else if z.HasExtensions() && z.DecExt(yyv20) { - } else { - *((*int64)(yyv20)) = int64(r.DecodeInt(64)) - } - } - case "InitialStatus": - if r.TryDecodeAsNil() { - x.InitialStatus = "" - } else { - yyv22 := &x.InitialStatus - yym23 := z.DecBinary() - _ = yym23 - if false { - } else { - *((*string)(yyv22)) = r.DecodeString() - } - } - case "TLSSkipVerify": - if r.TryDecodeAsNil() { - x.TLSSkipVerify = false - } else { - yyv24 := &x.TLSSkipVerify - yym25 := z.DecBinary() - _ = yym25 - if false { - } else { - *((*bool)(yyv24)) = r.DecodeBool() - } - } - case "Method": - if r.TryDecodeAsNil() { - x.Method = "" - } else { - yyv26 := &x.Method - yym27 := z.DecBinary() - _ = yym27 - if false { - } else { - *((*string)(yyv26)) = r.DecodeString() - } - } - case "Header": - if r.TryDecodeAsNil() { - x.Header = nil - } else { - yyv28 := &x.Header - yym29 := z.DecBinary() - _ = yym29 - if false { - } else { - h.decMapstringSlicestring((*map[string][]string)(yyv28), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *ServiceCheck) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj30 int - var yyb30 bool - var yyhl30 bool = l >= 0 - yyj30++ - if yyhl30 { - yyb30 = yyj30 > l - } else { - yyb30 = r.CheckBreak() - } - if yyb30 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv31 := &x.Name - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - *((*string)(yyv31)) = r.DecodeString() - } - } - yyj30++ - if yyhl30 { - yyb30 = yyj30 > l - } else { - yyb30 = r.CheckBreak() - } - if yyb30 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Type = "" - } else { - yyv33 := &x.Type - yym34 := z.DecBinary() - _ = yym34 - if false { - } else { - *((*string)(yyv33)) = r.DecodeString() - } - } - yyj30++ - if yyhl30 { - yyb30 = yyj30 > l - } else { - yyb30 = r.CheckBreak() - } - if yyb30 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Command = "" - } else { - yyv35 := &x.Command - yym36 := z.DecBinary() - _ = yym36 - if false { - } else { - *((*string)(yyv35)) = r.DecodeString() - } - } - yyj30++ - if yyhl30 { - yyb30 = yyj30 > l - } else { - yyb30 = r.CheckBreak() - } - if yyb30 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Args = nil - } else { - yyv37 := &x.Args - yym38 := z.DecBinary() - _ = yym38 - if false { - } else { - z.F.DecSliceStringX(yyv37, false, d) - } - } - yyj30++ - if yyhl30 { - yyb30 = yyj30 > l - } else { - yyb30 = r.CheckBreak() - } - if yyb30 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Path = "" - } else { - yyv39 := &x.Path - yym40 := z.DecBinary() - _ = yym40 - if false { - } else { - *((*string)(yyv39)) = r.DecodeString() - } - } - yyj30++ - if yyhl30 { - yyb30 = yyj30 > l - } else { - yyb30 = r.CheckBreak() - } - if yyb30 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Protocol = "" - } else { - yyv41 := &x.Protocol - yym42 := z.DecBinary() - _ = yym42 - if false { - } else { - *((*string)(yyv41)) = r.DecodeString() - } - } - yyj30++ - if yyhl30 { - yyb30 = yyj30 > l - } else { - yyb30 = r.CheckBreak() - } - if yyb30 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.PortLabel = "" - } else { - yyv43 := &x.PortLabel - yym44 := z.DecBinary() - _ = yym44 - if false { - } else { - *((*string)(yyv43)) = r.DecodeString() - } - } - yyj30++ - if yyhl30 { - yyb30 = yyj30 > l - } else { - yyb30 = r.CheckBreak() - } - if yyb30 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Interval = 0 - } else { - yyv45 := &x.Interval - yym46 := z.DecBinary() - _ = yym46 - if false { - } else if z.HasExtensions() && z.DecExt(yyv45) { - } else { - *((*int64)(yyv45)) = int64(r.DecodeInt(64)) - } - } - yyj30++ - if yyhl30 { - yyb30 = yyj30 > l - } else { - yyb30 = r.CheckBreak() - } - if yyb30 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Timeout = 0 - } else { - yyv47 := &x.Timeout - yym48 := z.DecBinary() - _ = yym48 - if false { - } else if z.HasExtensions() && z.DecExt(yyv47) { - } else { - *((*int64)(yyv47)) = int64(r.DecodeInt(64)) - } - } - yyj30++ - if yyhl30 { - yyb30 = yyj30 > l - } else { - yyb30 = r.CheckBreak() - } - if yyb30 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.InitialStatus = "" - } else { - yyv49 := &x.InitialStatus - yym50 := z.DecBinary() - _ = yym50 - if false { - } else { - *((*string)(yyv49)) = r.DecodeString() - } - } - yyj30++ - if yyhl30 { - yyb30 = yyj30 > l - } else { - yyb30 = r.CheckBreak() - } - if yyb30 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.TLSSkipVerify = false - } else { - yyv51 := &x.TLSSkipVerify - yym52 := z.DecBinary() - _ = yym52 - if false { - } else { - *((*bool)(yyv51)) = r.DecodeBool() - } - } - yyj30++ - if yyhl30 { - yyb30 = yyj30 > l - } else { - yyb30 = r.CheckBreak() - } - if yyb30 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Method = "" - } else { - yyv53 := &x.Method - yym54 := z.DecBinary() - _ = yym54 - if false { - } else { - *((*string)(yyv53)) = r.DecodeString() - } - } - yyj30++ - if yyhl30 { - yyb30 = yyj30 > l - } else { - yyb30 = r.CheckBreak() - } - if yyb30 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Header = nil - } else { - yyv55 := &x.Header - yym56 := z.DecBinary() - _ = yym56 - if false { - } else { - h.decMapstringSlicestring((*map[string][]string)(yyv55), d) - } - } - for { - yyj30++ - if yyhl30 { - yyb30 = yyj30 > l - } else { - yyb30 = r.CheckBreak() - } - if yyb30 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj30-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *Service) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) - } else { - yynn2 = 5 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Name")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.PortLabel)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("PortLabel")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.PortLabel)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.AddressMode)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AddressMode")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.AddressMode)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Tags == nil { - r.EncodeNil() - } else { - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - z.F.EncSliceStringV(x.Tags, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Tags")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Tags == nil { - r.EncodeNil() - } else { - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - z.F.EncSliceStringV(x.Tags, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Checks == nil { - r.EncodeNil() - } else { - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - h.encSlicePtrtoServiceCheck(([]*ServiceCheck)(x.Checks), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Checks")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Checks == nil { - r.EncodeNil() - } else { - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - h.encSlicePtrtoServiceCheck(([]*ServiceCheck)(x.Checks), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *Service) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *Service) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv4 := &x.Name - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "PortLabel": - if r.TryDecodeAsNil() { - x.PortLabel = "" - } else { - yyv6 := &x.PortLabel - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "AddressMode": - if r.TryDecodeAsNil() { - x.AddressMode = "" - } else { - yyv8 := &x.AddressMode - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "Tags": - if r.TryDecodeAsNil() { - x.Tags = nil - } else { - yyv10 := &x.Tags - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - z.F.DecSliceStringX(yyv10, false, d) - } - } - case "Checks": - if r.TryDecodeAsNil() { - x.Checks = nil - } else { - yyv12 := &x.Checks - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - h.decSlicePtrtoServiceCheck((*[]*ServiceCheck)(yyv12), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *Service) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj14 int - var yyb14 bool - var yyhl14 bool = l >= 0 - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv15 := &x.Name - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.PortLabel = "" - } else { - yyv17 := &x.PortLabel - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(yyv17)) = r.DecodeString() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AddressMode = "" - } else { - yyv19 := &x.AddressMode - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Tags = nil - } else { - yyv21 := &x.Tags - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - z.F.DecSliceStringX(yyv21, false, d) - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Checks = nil - } else { - yyv23 := &x.Checks - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - h.decSlicePtrtoServiceCheck((*[]*ServiceCheck)(yyv23), d) - } - } - for { - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj14-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *LogConfig) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeInt(int64(x.MaxFiles)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MaxFiles")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeInt(int64(x.MaxFiles)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeInt(int64(x.MaxFileSizeMB)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("MaxFileSizeMB")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeInt(int64(x.MaxFileSizeMB)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *LogConfig) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *LogConfig) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "MaxFiles": - if r.TryDecodeAsNil() { - x.MaxFiles = 0 - } else { - yyv4 := &x.MaxFiles - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*int)(yyv4)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "MaxFileSizeMB": - if r.TryDecodeAsNil() { - x.MaxFileSizeMB = 0 - } else { - yyv6 := &x.MaxFileSizeMB - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*int)(yyv6)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *LogConfig) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj8 int - var yyb8 bool - var yyhl8 bool = l >= 0 - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MaxFiles = 0 - } else { - yyv9 := &x.MaxFiles - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*int)(yyv9)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.MaxFileSizeMB = 0 - } else { - yyv11 := &x.MaxFileSizeMB - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*int)(yyv11)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - for { - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj8-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *Task) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [17]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(17) - } else { - yynn2 = 17 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Name")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Driver)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Driver")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Driver)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.User)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("User")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.User)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Config == nil { - r.EncodeNil() - } else { - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - z.F.EncMapStringIntfV(x.Config, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Config")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Config == nil { - r.EncodeNil() - } else { - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - z.F.EncMapStringIntfV(x.Config, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Env == nil { - r.EncodeNil() - } else { - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - z.F.EncMapStringStringV(x.Env, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Env")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Env == nil { - r.EncodeNil() - } else { - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - z.F.EncMapStringStringV(x.Env, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Services == nil { - r.EncodeNil() - } else { - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - h.encSlicePtrtoService(([]*Service)(x.Services), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Services")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Services == nil { - r.EncodeNil() - } else { - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - h.encSlicePtrtoService(([]*Service)(x.Services), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Vault == nil { - r.EncodeNil() - } else { - x.Vault.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Vault")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Vault == nil { - r.EncodeNil() - } else { - x.Vault.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Templates == nil { - r.EncodeNil() - } else { - yym25 := z.EncBinary() - _ = yym25 - if false { - } else { - h.encSlicePtrtoTemplate(([]*Template)(x.Templates), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Templates")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Templates == nil { - r.EncodeNil() - } else { - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - h.encSlicePtrtoTemplate(([]*Template)(x.Templates), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Constraints == nil { - r.EncodeNil() - } else { - yym28 := z.EncBinary() - _ = yym28 - if false { - } else { - h.encSlicePtrtoConstraint(([]*Constraint)(x.Constraints), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Constraints")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Constraints == nil { - r.EncodeNil() - } else { - yym29 := z.EncBinary() - _ = yym29 - if false { - } else { - h.encSlicePtrtoConstraint(([]*Constraint)(x.Constraints), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Resources == nil { - r.EncodeNil() - } else { - x.Resources.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Resources")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Resources == nil { - r.EncodeNil() - } else { - x.Resources.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.DispatchPayload == nil { - r.EncodeNil() - } else { - x.DispatchPayload.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DispatchPayload")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.DispatchPayload == nil { - r.EncodeNil() - } else { - x.DispatchPayload.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Meta == nil { - r.EncodeNil() - } else { - yym37 := z.EncBinary() - _ = yym37 - if false { - } else { - z.F.EncMapStringStringV(x.Meta, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Meta")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Meta == nil { - r.EncodeNil() - } else { - yym38 := z.EncBinary() - _ = yym38 - if false { - } else { - z.F.EncMapStringStringV(x.Meta, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym40 := z.EncBinary() - _ = yym40 - if false { - } else if z.HasExtensions() && z.EncExt(x.KillTimeout) { - } else { - r.EncodeInt(int64(x.KillTimeout)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KillTimeout")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym41 := z.EncBinary() - _ = yym41 - if false { - } else if z.HasExtensions() && z.EncExt(x.KillTimeout) { - } else { - r.EncodeInt(int64(x.KillTimeout)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.LogConfig == nil { - r.EncodeNil() - } else { - x.LogConfig.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LogConfig")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.LogConfig == nil { - r.EncodeNil() - } else { - x.LogConfig.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Artifacts == nil { - r.EncodeNil() - } else { - yym46 := z.EncBinary() - _ = yym46 - if false { - } else { - h.encSlicePtrtoTaskArtifact(([]*TaskArtifact)(x.Artifacts), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Artifacts")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Artifacts == nil { - r.EncodeNil() - } else { - yym47 := z.EncBinary() - _ = yym47 - if false { - } else { - h.encSlicePtrtoTaskArtifact(([]*TaskArtifact)(x.Artifacts), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym49 := z.EncBinary() - _ = yym49 - if false { - } else { - r.EncodeBool(bool(x.Leader)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Leader")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym50 := z.EncBinary() - _ = yym50 - if false { - } else { - r.EncodeBool(bool(x.Leader)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym52 := z.EncBinary() - _ = yym52 - if false { - } else if z.HasExtensions() && z.EncExt(x.ShutdownDelay) { - } else { - r.EncodeInt(int64(x.ShutdownDelay)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ShutdownDelay")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym53 := z.EncBinary() - _ = yym53 - if false { - } else if z.HasExtensions() && z.EncExt(x.ShutdownDelay) { - } else { - r.EncodeInt(int64(x.ShutdownDelay)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *Task) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *Task) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv4 := &x.Name - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Driver": - if r.TryDecodeAsNil() { - x.Driver = "" - } else { - yyv6 := &x.Driver - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "User": - if r.TryDecodeAsNil() { - x.User = "" - } else { - yyv8 := &x.User - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "Config": - if r.TryDecodeAsNil() { - x.Config = nil - } else { - yyv10 := &x.Config - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - z.F.DecMapStringIntfX(yyv10, false, d) - } - } - case "Env": - if r.TryDecodeAsNil() { - x.Env = nil - } else { - yyv12 := &x.Env - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - z.F.DecMapStringStringX(yyv12, false, d) - } - } - case "Services": - if r.TryDecodeAsNil() { - x.Services = nil - } else { - yyv14 := &x.Services - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - h.decSlicePtrtoService((*[]*Service)(yyv14), d) - } - } - case "Vault": - if r.TryDecodeAsNil() { - if x.Vault != nil { - x.Vault = nil - } - } else { - if x.Vault == nil { - x.Vault = new(Vault) - } - x.Vault.CodecDecodeSelf(d) - } - case "Templates": - if r.TryDecodeAsNil() { - x.Templates = nil - } else { - yyv17 := &x.Templates - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - h.decSlicePtrtoTemplate((*[]*Template)(yyv17), d) - } - } - case "Constraints": - if r.TryDecodeAsNil() { - x.Constraints = nil - } else { - yyv19 := &x.Constraints - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - h.decSlicePtrtoConstraint((*[]*Constraint)(yyv19), d) - } - } - case "Resources": - if r.TryDecodeAsNil() { - if x.Resources != nil { - x.Resources = nil - } - } else { - if x.Resources == nil { - x.Resources = new(Resources) - } - x.Resources.CodecDecodeSelf(d) - } - case "DispatchPayload": - if r.TryDecodeAsNil() { - if x.DispatchPayload != nil { - x.DispatchPayload = nil - } - } else { - if x.DispatchPayload == nil { - x.DispatchPayload = new(DispatchPayloadConfig) - } - x.DispatchPayload.CodecDecodeSelf(d) - } - case "Meta": - if r.TryDecodeAsNil() { - x.Meta = nil - } else { - yyv23 := &x.Meta - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - z.F.DecMapStringStringX(yyv23, false, d) - } - } - case "KillTimeout": - if r.TryDecodeAsNil() { - x.KillTimeout = 0 - } else { - yyv25 := &x.KillTimeout - yym26 := z.DecBinary() - _ = yym26 - if false { - } else if z.HasExtensions() && z.DecExt(yyv25) { - } else { - *((*int64)(yyv25)) = int64(r.DecodeInt(64)) - } - } - case "LogConfig": - if r.TryDecodeAsNil() { - if x.LogConfig != nil { - x.LogConfig = nil - } - } else { - if x.LogConfig == nil { - x.LogConfig = new(LogConfig) - } - x.LogConfig.CodecDecodeSelf(d) - } - case "Artifacts": - if r.TryDecodeAsNil() { - x.Artifacts = nil - } else { - yyv28 := &x.Artifacts - yym29 := z.DecBinary() - _ = yym29 - if false { - } else { - h.decSlicePtrtoTaskArtifact((*[]*TaskArtifact)(yyv28), d) - } - } - case "Leader": - if r.TryDecodeAsNil() { - x.Leader = false - } else { - yyv30 := &x.Leader - yym31 := z.DecBinary() - _ = yym31 - if false { - } else { - *((*bool)(yyv30)) = r.DecodeBool() - } - } - case "ShutdownDelay": - if r.TryDecodeAsNil() { - x.ShutdownDelay = 0 - } else { - yyv32 := &x.ShutdownDelay - yym33 := z.DecBinary() - _ = yym33 - if false { - } else if z.HasExtensions() && z.DecExt(yyv32) { - } else { - *((*int64)(yyv32)) = int64(r.DecodeInt(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *Task) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj34 int - var yyb34 bool - var yyhl34 bool = l >= 0 - yyj34++ - if yyhl34 { - yyb34 = yyj34 > l - } else { - yyb34 = r.CheckBreak() - } - if yyb34 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv35 := &x.Name - yym36 := z.DecBinary() - _ = yym36 - if false { - } else { - *((*string)(yyv35)) = r.DecodeString() - } - } - yyj34++ - if yyhl34 { - yyb34 = yyj34 > l - } else { - yyb34 = r.CheckBreak() - } - if yyb34 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Driver = "" - } else { - yyv37 := &x.Driver - yym38 := z.DecBinary() - _ = yym38 - if false { - } else { - *((*string)(yyv37)) = r.DecodeString() - } - } - yyj34++ - if yyhl34 { - yyb34 = yyj34 > l - } else { - yyb34 = r.CheckBreak() - } - if yyb34 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.User = "" - } else { - yyv39 := &x.User - yym40 := z.DecBinary() - _ = yym40 - if false { - } else { - *((*string)(yyv39)) = r.DecodeString() - } - } - yyj34++ - if yyhl34 { - yyb34 = yyj34 > l - } else { - yyb34 = r.CheckBreak() - } - if yyb34 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Config = nil - } else { - yyv41 := &x.Config - yym42 := z.DecBinary() - _ = yym42 - if false { - } else { - z.F.DecMapStringIntfX(yyv41, false, d) - } - } - yyj34++ - if yyhl34 { - yyb34 = yyj34 > l - } else { - yyb34 = r.CheckBreak() - } - if yyb34 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Env = nil - } else { - yyv43 := &x.Env - yym44 := z.DecBinary() - _ = yym44 - if false { - } else { - z.F.DecMapStringStringX(yyv43, false, d) - } - } - yyj34++ - if yyhl34 { - yyb34 = yyj34 > l - } else { - yyb34 = r.CheckBreak() - } - if yyb34 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Services = nil - } else { - yyv45 := &x.Services - yym46 := z.DecBinary() - _ = yym46 - if false { - } else { - h.decSlicePtrtoService((*[]*Service)(yyv45), d) - } - } - yyj34++ - if yyhl34 { - yyb34 = yyj34 > l - } else { - yyb34 = r.CheckBreak() - } - if yyb34 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Vault != nil { - x.Vault = nil - } - } else { - if x.Vault == nil { - x.Vault = new(Vault) - } - x.Vault.CodecDecodeSelf(d) - } - yyj34++ - if yyhl34 { - yyb34 = yyj34 > l - } else { - yyb34 = r.CheckBreak() - } - if yyb34 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Templates = nil - } else { - yyv48 := &x.Templates - yym49 := z.DecBinary() - _ = yym49 - if false { - } else { - h.decSlicePtrtoTemplate((*[]*Template)(yyv48), d) - } - } - yyj34++ - if yyhl34 { - yyb34 = yyj34 > l - } else { - yyb34 = r.CheckBreak() - } - if yyb34 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Constraints = nil - } else { - yyv50 := &x.Constraints - yym51 := z.DecBinary() - _ = yym51 - if false { - } else { - h.decSlicePtrtoConstraint((*[]*Constraint)(yyv50), d) - } - } - yyj34++ - if yyhl34 { - yyb34 = yyj34 > l - } else { - yyb34 = r.CheckBreak() - } - if yyb34 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Resources != nil { - x.Resources = nil - } - } else { - if x.Resources == nil { - x.Resources = new(Resources) - } - x.Resources.CodecDecodeSelf(d) - } - yyj34++ - if yyhl34 { - yyb34 = yyj34 > l - } else { - yyb34 = r.CheckBreak() - } - if yyb34 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.DispatchPayload != nil { - x.DispatchPayload = nil - } - } else { - if x.DispatchPayload == nil { - x.DispatchPayload = new(DispatchPayloadConfig) - } - x.DispatchPayload.CodecDecodeSelf(d) - } - yyj34++ - if yyhl34 { - yyb34 = yyj34 > l - } else { - yyb34 = r.CheckBreak() - } - if yyb34 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Meta = nil - } else { - yyv54 := &x.Meta - yym55 := z.DecBinary() - _ = yym55 - if false { - } else { - z.F.DecMapStringStringX(yyv54, false, d) - } - } - yyj34++ - if yyhl34 { - yyb34 = yyj34 > l - } else { - yyb34 = r.CheckBreak() - } - if yyb34 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KillTimeout = 0 - } else { - yyv56 := &x.KillTimeout - yym57 := z.DecBinary() - _ = yym57 - if false { - } else if z.HasExtensions() && z.DecExt(yyv56) { - } else { - *((*int64)(yyv56)) = int64(r.DecodeInt(64)) - } - } - yyj34++ - if yyhl34 { - yyb34 = yyj34 > l - } else { - yyb34 = r.CheckBreak() - } - if yyb34 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.LogConfig != nil { - x.LogConfig = nil - } - } else { - if x.LogConfig == nil { - x.LogConfig = new(LogConfig) - } - x.LogConfig.CodecDecodeSelf(d) - } - yyj34++ - if yyhl34 { - yyb34 = yyj34 > l - } else { - yyb34 = r.CheckBreak() - } - if yyb34 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Artifacts = nil - } else { - yyv59 := &x.Artifacts - yym60 := z.DecBinary() - _ = yym60 - if false { - } else { - h.decSlicePtrtoTaskArtifact((*[]*TaskArtifact)(yyv59), d) - } - } - yyj34++ - if yyhl34 { - yyb34 = yyj34 > l - } else { - yyb34 = r.CheckBreak() - } - if yyb34 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Leader = false - } else { - yyv61 := &x.Leader - yym62 := z.DecBinary() - _ = yym62 - if false { - } else { - *((*bool)(yyv61)) = r.DecodeBool() - } - } - yyj34++ - if yyhl34 { - yyb34 = yyj34 > l - } else { - yyb34 = r.CheckBreak() - } - if yyb34 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ShutdownDelay = 0 - } else { - yyv63 := &x.ShutdownDelay - yym64 := z.DecBinary() - _ = yym64 - if false { - } else if z.HasExtensions() && z.DecExt(yyv63) { - } else { - *((*int64)(yyv63)) = int64(r.DecodeInt(64)) - } - } - for { - yyj34++ - if yyhl34 { - yyb34 = yyj34 > l - } else { - yyb34 = r.CheckBreak() - } - if yyb34 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj34-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *Template) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [11]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(11) - } else { - yynn2 = 11 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.SourcePath)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("SourcePath")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.SourcePath)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DestPath)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DestPath")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DestPath)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EmbeddedTmpl)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EmbeddedTmpl")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EmbeddedTmpl)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ChangeMode)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ChangeMode")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ChangeMode)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ChangeSignal)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ChangeSignal")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ChangeSignal)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else if z.HasExtensions() && z.EncExt(x.Splay) { - } else { - r.EncodeInt(int64(x.Splay)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Splay")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else if z.HasExtensions() && z.EncExt(x.Splay) { - } else { - r.EncodeInt(int64(x.Splay)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Perms)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Perms")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Perms)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym25 := z.EncBinary() - _ = yym25 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.LeftDelim)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LeftDelim")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.LeftDelim)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym28 := z.EncBinary() - _ = yym28 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.RightDelim)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("RightDelim")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym29 := z.EncBinary() - _ = yym29 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.RightDelim)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym31 := z.EncBinary() - _ = yym31 - if false { - } else { - r.EncodeBool(bool(x.Envvars)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Envvars")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym32 := z.EncBinary() - _ = yym32 - if false { - } else { - r.EncodeBool(bool(x.Envvars)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym34 := z.EncBinary() - _ = yym34 - if false { - } else if z.HasExtensions() && z.EncExt(x.VaultGrace) { - } else { - r.EncodeInt(int64(x.VaultGrace)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("VaultGrace")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym35 := z.EncBinary() - _ = yym35 - if false { - } else if z.HasExtensions() && z.EncExt(x.VaultGrace) { - } else { - r.EncodeInt(int64(x.VaultGrace)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *Template) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *Template) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "SourcePath": - if r.TryDecodeAsNil() { - x.SourcePath = "" - } else { - yyv4 := &x.SourcePath - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "DestPath": - if r.TryDecodeAsNil() { - x.DestPath = "" - } else { - yyv6 := &x.DestPath - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "EmbeddedTmpl": - if r.TryDecodeAsNil() { - x.EmbeddedTmpl = "" - } else { - yyv8 := &x.EmbeddedTmpl - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "ChangeMode": - if r.TryDecodeAsNil() { - x.ChangeMode = "" - } else { - yyv10 := &x.ChangeMode - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - case "ChangeSignal": - if r.TryDecodeAsNil() { - x.ChangeSignal = "" - } else { - yyv12 := &x.ChangeSignal - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - case "Splay": - if r.TryDecodeAsNil() { - x.Splay = 0 - } else { - yyv14 := &x.Splay - yym15 := z.DecBinary() - _ = yym15 - if false { - } else if z.HasExtensions() && z.DecExt(yyv14) { - } else { - *((*int64)(yyv14)) = int64(r.DecodeInt(64)) - } - } - case "Perms": - if r.TryDecodeAsNil() { - x.Perms = "" - } else { - yyv16 := &x.Perms - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*string)(yyv16)) = r.DecodeString() - } - } - case "LeftDelim": - if r.TryDecodeAsNil() { - x.LeftDelim = "" - } else { - yyv18 := &x.LeftDelim - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - *((*string)(yyv18)) = r.DecodeString() - } - } - case "RightDelim": - if r.TryDecodeAsNil() { - x.RightDelim = "" - } else { - yyv20 := &x.RightDelim - yym21 := z.DecBinary() - _ = yym21 - if false { - } else { - *((*string)(yyv20)) = r.DecodeString() - } - } - case "Envvars": - if r.TryDecodeAsNil() { - x.Envvars = false - } else { - yyv22 := &x.Envvars - yym23 := z.DecBinary() - _ = yym23 - if false { - } else { - *((*bool)(yyv22)) = r.DecodeBool() - } - } - case "VaultGrace": - if r.TryDecodeAsNil() { - x.VaultGrace = 0 - } else { - yyv24 := &x.VaultGrace - yym25 := z.DecBinary() - _ = yym25 - if false { - } else if z.HasExtensions() && z.DecExt(yyv24) { - } else { - *((*int64)(yyv24)) = int64(r.DecodeInt(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *Template) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj26 int - var yyb26 bool - var yyhl26 bool = l >= 0 - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.SourcePath = "" - } else { - yyv27 := &x.SourcePath - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*string)(yyv27)) = r.DecodeString() - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DestPath = "" - } else { - yyv29 := &x.DestPath - yym30 := z.DecBinary() - _ = yym30 - if false { - } else { - *((*string)(yyv29)) = r.DecodeString() - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EmbeddedTmpl = "" - } else { - yyv31 := &x.EmbeddedTmpl - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - *((*string)(yyv31)) = r.DecodeString() - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ChangeMode = "" - } else { - yyv33 := &x.ChangeMode - yym34 := z.DecBinary() - _ = yym34 - if false { - } else { - *((*string)(yyv33)) = r.DecodeString() - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ChangeSignal = "" - } else { - yyv35 := &x.ChangeSignal - yym36 := z.DecBinary() - _ = yym36 - if false { - } else { - *((*string)(yyv35)) = r.DecodeString() - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Splay = 0 - } else { - yyv37 := &x.Splay - yym38 := z.DecBinary() - _ = yym38 - if false { - } else if z.HasExtensions() && z.DecExt(yyv37) { - } else { - *((*int64)(yyv37)) = int64(r.DecodeInt(64)) - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Perms = "" - } else { - yyv39 := &x.Perms - yym40 := z.DecBinary() - _ = yym40 - if false { - } else { - *((*string)(yyv39)) = r.DecodeString() - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LeftDelim = "" - } else { - yyv41 := &x.LeftDelim - yym42 := z.DecBinary() - _ = yym42 - if false { - } else { - *((*string)(yyv41)) = r.DecodeString() - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.RightDelim = "" - } else { - yyv43 := &x.RightDelim - yym44 := z.DecBinary() - _ = yym44 - if false { - } else { - *((*string)(yyv43)) = r.DecodeString() - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Envvars = false - } else { - yyv45 := &x.Envvars - yym46 := z.DecBinary() - _ = yym46 - if false { - } else { - *((*bool)(yyv45)) = r.DecodeBool() - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.VaultGrace = 0 - } else { - yyv47 := &x.VaultGrace - yym48 := z.DecBinary() - _ = yym48 - if false { - } else if z.HasExtensions() && z.DecExt(yyv47) { - } else { - *((*int64)(yyv47)) = int64(r.DecodeInt(64)) - } - } - for { - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj26-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *TaskState) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [7]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(7) - } else { - yynn2 = 7 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.State)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("State")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.State)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeBool(bool(x.Failed)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Failed")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeBool(bool(x.Failed)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.Restarts)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Restarts")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.Restarts)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yy13 := &x.LastRestart - yym14 := z.EncBinary() - _ = yym14 - if false { - } else if yym15 := z.TimeRtidIfBinc(); yym15 != 0 { - r.EncodeBuiltin(yym15, yy13) - } else if z.HasExtensions() && z.EncExt(yy13) { - } else if yym14 { - z.EncBinaryMarshal(yy13) - } else if !yym14 && z.IsJSONHandle() { - z.EncJSONMarshal(yy13) - } else { - z.EncFallback(yy13) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LastRestart")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yy16 := &x.LastRestart - yym17 := z.EncBinary() - _ = yym17 - if false { - } else if yym18 := z.TimeRtidIfBinc(); yym18 != 0 { - r.EncodeBuiltin(yym18, yy16) - } else if z.HasExtensions() && z.EncExt(yy16) { - } else if yym17 { - z.EncBinaryMarshal(yy16) - } else if !yym17 && z.IsJSONHandle() { - z.EncJSONMarshal(yy16) - } else { - z.EncFallback(yy16) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yy20 := &x.StartedAt - yym21 := z.EncBinary() - _ = yym21 - if false { - } else if yym22 := z.TimeRtidIfBinc(); yym22 != 0 { - r.EncodeBuiltin(yym22, yy20) - } else if z.HasExtensions() && z.EncExt(yy20) { - } else if yym21 { - z.EncBinaryMarshal(yy20) - } else if !yym21 && z.IsJSONHandle() { - z.EncJSONMarshal(yy20) - } else { - z.EncFallback(yy20) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("StartedAt")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yy23 := &x.StartedAt - yym24 := z.EncBinary() - _ = yym24 - if false { - } else if yym25 := z.TimeRtidIfBinc(); yym25 != 0 { - r.EncodeBuiltin(yym25, yy23) - } else if z.HasExtensions() && z.EncExt(yy23) { - } else if yym24 { - z.EncBinaryMarshal(yy23) - } else if !yym24 && z.IsJSONHandle() { - z.EncJSONMarshal(yy23) - } else { - z.EncFallback(yy23) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yy27 := &x.FinishedAt - yym28 := z.EncBinary() - _ = yym28 - if false { - } else if yym29 := z.TimeRtidIfBinc(); yym29 != 0 { - r.EncodeBuiltin(yym29, yy27) - } else if z.HasExtensions() && z.EncExt(yy27) { - } else if yym28 { - z.EncBinaryMarshal(yy27) - } else if !yym28 && z.IsJSONHandle() { - z.EncJSONMarshal(yy27) - } else { - z.EncFallback(yy27) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("FinishedAt")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yy30 := &x.FinishedAt - yym31 := z.EncBinary() - _ = yym31 - if false { - } else if yym32 := z.TimeRtidIfBinc(); yym32 != 0 { - r.EncodeBuiltin(yym32, yy30) - } else if z.HasExtensions() && z.EncExt(yy30) { - } else if yym31 { - z.EncBinaryMarshal(yy30) - } else if !yym31 && z.IsJSONHandle() { - z.EncJSONMarshal(yy30) - } else { - z.EncFallback(yy30) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Events == nil { - r.EncodeNil() - } else { - yym34 := z.EncBinary() - _ = yym34 - if false { - } else { - h.encSlicePtrtoTaskEvent(([]*TaskEvent)(x.Events), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Events")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Events == nil { - r.EncodeNil() - } else { - yym35 := z.EncBinary() - _ = yym35 - if false { - } else { - h.encSlicePtrtoTaskEvent(([]*TaskEvent)(x.Events), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *TaskState) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *TaskState) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "State": - if r.TryDecodeAsNil() { - x.State = "" - } else { - yyv4 := &x.State - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Failed": - if r.TryDecodeAsNil() { - x.Failed = false - } else { - yyv6 := &x.Failed - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*bool)(yyv6)) = r.DecodeBool() - } - } - case "Restarts": - if r.TryDecodeAsNil() { - x.Restarts = 0 - } else { - yyv8 := &x.Restarts - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint64)(yyv8)) = uint64(r.DecodeUint(64)) - } - } - case "LastRestart": - if r.TryDecodeAsNil() { - x.LastRestart = time.Time{} - } else { - yyv10 := &x.LastRestart - yym11 := z.DecBinary() - _ = yym11 - if false { - } else if yym12 := z.TimeRtidIfBinc(); yym12 != 0 { - r.DecodeBuiltin(yym12, yyv10) - } else if z.HasExtensions() && z.DecExt(yyv10) { - } else if yym11 { - z.DecBinaryUnmarshal(yyv10) - } else if !yym11 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv10) - } else { - z.DecFallback(yyv10, false) - } - } - case "StartedAt": - if r.TryDecodeAsNil() { - x.StartedAt = time.Time{} - } else { - yyv13 := &x.StartedAt - yym14 := z.DecBinary() - _ = yym14 - if false { - } else if yym15 := z.TimeRtidIfBinc(); yym15 != 0 { - r.DecodeBuiltin(yym15, yyv13) - } else if z.HasExtensions() && z.DecExt(yyv13) { - } else if yym14 { - z.DecBinaryUnmarshal(yyv13) - } else if !yym14 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv13) - } else { - z.DecFallback(yyv13, false) - } - } - case "FinishedAt": - if r.TryDecodeAsNil() { - x.FinishedAt = time.Time{} - } else { - yyv16 := &x.FinishedAt - yym17 := z.DecBinary() - _ = yym17 - if false { - } else if yym18 := z.TimeRtidIfBinc(); yym18 != 0 { - r.DecodeBuiltin(yym18, yyv16) - } else if z.HasExtensions() && z.DecExt(yyv16) { - } else if yym17 { - z.DecBinaryUnmarshal(yyv16) - } else if !yym17 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv16) - } else { - z.DecFallback(yyv16, false) - } - } - case "Events": - if r.TryDecodeAsNil() { - x.Events = nil - } else { - yyv19 := &x.Events - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - h.decSlicePtrtoTaskEvent((*[]*TaskEvent)(yyv19), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *TaskState) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj21 int - var yyb21 bool - var yyhl21 bool = l >= 0 - yyj21++ - if yyhl21 { - yyb21 = yyj21 > l - } else { - yyb21 = r.CheckBreak() - } - if yyb21 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.State = "" - } else { - yyv22 := &x.State - yym23 := z.DecBinary() - _ = yym23 - if false { - } else { - *((*string)(yyv22)) = r.DecodeString() - } - } - yyj21++ - if yyhl21 { - yyb21 = yyj21 > l - } else { - yyb21 = r.CheckBreak() - } - if yyb21 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Failed = false - } else { - yyv24 := &x.Failed - yym25 := z.DecBinary() - _ = yym25 - if false { - } else { - *((*bool)(yyv24)) = r.DecodeBool() - } - } - yyj21++ - if yyhl21 { - yyb21 = yyj21 > l - } else { - yyb21 = r.CheckBreak() - } - if yyb21 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Restarts = 0 - } else { - yyv26 := &x.Restarts - yym27 := z.DecBinary() - _ = yym27 - if false { - } else { - *((*uint64)(yyv26)) = uint64(r.DecodeUint(64)) - } - } - yyj21++ - if yyhl21 { - yyb21 = yyj21 > l - } else { - yyb21 = r.CheckBreak() - } - if yyb21 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LastRestart = time.Time{} - } else { - yyv28 := &x.LastRestart - yym29 := z.DecBinary() - _ = yym29 - if false { - } else if yym30 := z.TimeRtidIfBinc(); yym30 != 0 { - r.DecodeBuiltin(yym30, yyv28) - } else if z.HasExtensions() && z.DecExt(yyv28) { - } else if yym29 { - z.DecBinaryUnmarshal(yyv28) - } else if !yym29 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv28) - } else { - z.DecFallback(yyv28, false) - } - } - yyj21++ - if yyhl21 { - yyb21 = yyj21 > l - } else { - yyb21 = r.CheckBreak() - } - if yyb21 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.StartedAt = time.Time{} - } else { - yyv31 := &x.StartedAt - yym32 := z.DecBinary() - _ = yym32 - if false { - } else if yym33 := z.TimeRtidIfBinc(); yym33 != 0 { - r.DecodeBuiltin(yym33, yyv31) - } else if z.HasExtensions() && z.DecExt(yyv31) { - } else if yym32 { - z.DecBinaryUnmarshal(yyv31) - } else if !yym32 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv31) - } else { - z.DecFallback(yyv31, false) - } - } - yyj21++ - if yyhl21 { - yyb21 = yyj21 > l - } else { - yyb21 = r.CheckBreak() - } - if yyb21 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.FinishedAt = time.Time{} - } else { - yyv34 := &x.FinishedAt - yym35 := z.DecBinary() - _ = yym35 - if false { - } else if yym36 := z.TimeRtidIfBinc(); yym36 != 0 { - r.DecodeBuiltin(yym36, yyv34) - } else if z.HasExtensions() && z.DecExt(yyv34) { - } else if yym35 { - z.DecBinaryUnmarshal(yyv34) - } else if !yym35 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv34) - } else { - z.DecFallback(yyv34, false) - } - } - yyj21++ - if yyhl21 { - yyb21 = yyj21 > l - } else { - yyb21 = r.CheckBreak() - } - if yyb21 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Events = nil - } else { - yyv37 := &x.Events - yym38 := z.DecBinary() - _ = yym38 - if false { - } else { - h.decSlicePtrtoTaskEvent((*[]*TaskEvent)(yyv37), d) - } - } - for { - yyj21++ - if yyhl21 { - yyb21 = yyj21 > l - } else { - yyb21 = r.CheckBreak() - } - if yyb21 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj21-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *TaskEvent) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [22]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(22) - } else { - yynn2 = 22 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Type)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Type")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Type)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeInt(int64(x.Time)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Time")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeInt(int64(x.Time)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeBool(bool(x.FailsTask)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("FailsTask")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeBool(bool(x.FailsTask)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.RestartReason)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("RestartReason")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.RestartReason)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.SetupError)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("SetupError")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.SetupError)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DriverError)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DriverError")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DriverError)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeInt(int64(x.ExitCode)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ExitCode")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeInt(int64(x.ExitCode)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym25 := z.EncBinary() - _ = yym25 - if false { - } else { - r.EncodeInt(int64(x.Signal)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Signal")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - r.EncodeInt(int64(x.Signal)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym28 := z.EncBinary() - _ = yym28 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Message)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Message")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym29 := z.EncBinary() - _ = yym29 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Message)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym31 := z.EncBinary() - _ = yym31 - if false { - } else if z.HasExtensions() && z.EncExt(x.KillTimeout) { - } else { - r.EncodeInt(int64(x.KillTimeout)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KillTimeout")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym32 := z.EncBinary() - _ = yym32 - if false { - } else if z.HasExtensions() && z.EncExt(x.KillTimeout) { - } else { - r.EncodeInt(int64(x.KillTimeout)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym34 := z.EncBinary() - _ = yym34 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.KillError)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KillError")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym35 := z.EncBinary() - _ = yym35 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.KillError)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym37 := z.EncBinary() - _ = yym37 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.KillReason)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("KillReason")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym38 := z.EncBinary() - _ = yym38 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.KillReason)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym40 := z.EncBinary() - _ = yym40 - if false { - } else { - r.EncodeInt(int64(x.StartDelay)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("StartDelay")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym41 := z.EncBinary() - _ = yym41 - if false { - } else { - r.EncodeInt(int64(x.StartDelay)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym43 := z.EncBinary() - _ = yym43 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DownloadError)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DownloadError")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym44 := z.EncBinary() - _ = yym44 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DownloadError)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym46 := z.EncBinary() - _ = yym46 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ValidationError)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ValidationError")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym47 := z.EncBinary() - _ = yym47 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ValidationError)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym49 := z.EncBinary() - _ = yym49 - if false { - } else { - r.EncodeInt(int64(x.DiskLimit)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DiskLimit")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym50 := z.EncBinary() - _ = yym50 - if false { - } else { - r.EncodeInt(int64(x.DiskLimit)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym52 := z.EncBinary() - _ = yym52 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.FailedSibling)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("FailedSibling")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym53 := z.EncBinary() - _ = yym53 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.FailedSibling)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym55 := z.EncBinary() - _ = yym55 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.VaultError)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("VaultError")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym56 := z.EncBinary() - _ = yym56 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.VaultError)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym58 := z.EncBinary() - _ = yym58 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.TaskSignalReason)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("TaskSignalReason")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym59 := z.EncBinary() - _ = yym59 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.TaskSignalReason)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym61 := z.EncBinary() - _ = yym61 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.TaskSignal)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("TaskSignal")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym62 := z.EncBinary() - _ = yym62 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.TaskSignal)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym64 := z.EncBinary() - _ = yym64 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DriverMessage)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DriverMessage")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym65 := z.EncBinary() - _ = yym65 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DriverMessage)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym67 := z.EncBinary() - _ = yym67 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.GenericSource)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("GenericSource")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym68 := z.EncBinary() - _ = yym68 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.GenericSource)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *TaskEvent) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *TaskEvent) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Type": - if r.TryDecodeAsNil() { - x.Type = "" - } else { - yyv4 := &x.Type - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Time": - if r.TryDecodeAsNil() { - x.Time = 0 - } else { - yyv6 := &x.Time - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*int64)(yyv6)) = int64(r.DecodeInt(64)) - } - } - case "FailsTask": - if r.TryDecodeAsNil() { - x.FailsTask = false - } else { - yyv8 := &x.FailsTask - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*bool)(yyv8)) = r.DecodeBool() - } - } - case "RestartReason": - if r.TryDecodeAsNil() { - x.RestartReason = "" - } else { - yyv10 := &x.RestartReason - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - case "SetupError": - if r.TryDecodeAsNil() { - x.SetupError = "" - } else { - yyv12 := &x.SetupError - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - case "DriverError": - if r.TryDecodeAsNil() { - x.DriverError = "" - } else { - yyv14 := &x.DriverError - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*string)(yyv14)) = r.DecodeString() - } - } - case "ExitCode": - if r.TryDecodeAsNil() { - x.ExitCode = 0 - } else { - yyv16 := &x.ExitCode - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*int)(yyv16)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "Signal": - if r.TryDecodeAsNil() { - x.Signal = 0 - } else { - yyv18 := &x.Signal - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - *((*int)(yyv18)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "Message": - if r.TryDecodeAsNil() { - x.Message = "" - } else { - yyv20 := &x.Message - yym21 := z.DecBinary() - _ = yym21 - if false { - } else { - *((*string)(yyv20)) = r.DecodeString() - } - } - case "KillTimeout": - if r.TryDecodeAsNil() { - x.KillTimeout = 0 - } else { - yyv22 := &x.KillTimeout - yym23 := z.DecBinary() - _ = yym23 - if false { - } else if z.HasExtensions() && z.DecExt(yyv22) { - } else { - *((*int64)(yyv22)) = int64(r.DecodeInt(64)) - } - } - case "KillError": - if r.TryDecodeAsNil() { - x.KillError = "" - } else { - yyv24 := &x.KillError - yym25 := z.DecBinary() - _ = yym25 - if false { - } else { - *((*string)(yyv24)) = r.DecodeString() - } - } - case "KillReason": - if r.TryDecodeAsNil() { - x.KillReason = "" - } else { - yyv26 := &x.KillReason - yym27 := z.DecBinary() - _ = yym27 - if false { - } else { - *((*string)(yyv26)) = r.DecodeString() - } - } - case "StartDelay": - if r.TryDecodeAsNil() { - x.StartDelay = 0 - } else { - yyv28 := &x.StartDelay - yym29 := z.DecBinary() - _ = yym29 - if false { - } else { - *((*int64)(yyv28)) = int64(r.DecodeInt(64)) - } - } - case "DownloadError": - if r.TryDecodeAsNil() { - x.DownloadError = "" - } else { - yyv30 := &x.DownloadError - yym31 := z.DecBinary() - _ = yym31 - if false { - } else { - *((*string)(yyv30)) = r.DecodeString() - } - } - case "ValidationError": - if r.TryDecodeAsNil() { - x.ValidationError = "" - } else { - yyv32 := &x.ValidationError - yym33 := z.DecBinary() - _ = yym33 - if false { - } else { - *((*string)(yyv32)) = r.DecodeString() - } - } - case "DiskLimit": - if r.TryDecodeAsNil() { - x.DiskLimit = 0 - } else { - yyv34 := &x.DiskLimit - yym35 := z.DecBinary() - _ = yym35 - if false { - } else { - *((*int64)(yyv34)) = int64(r.DecodeInt(64)) - } - } - case "FailedSibling": - if r.TryDecodeAsNil() { - x.FailedSibling = "" - } else { - yyv36 := &x.FailedSibling - yym37 := z.DecBinary() - _ = yym37 - if false { - } else { - *((*string)(yyv36)) = r.DecodeString() - } - } - case "VaultError": - if r.TryDecodeAsNil() { - x.VaultError = "" - } else { - yyv38 := &x.VaultError - yym39 := z.DecBinary() - _ = yym39 - if false { - } else { - *((*string)(yyv38)) = r.DecodeString() - } - } - case "TaskSignalReason": - if r.TryDecodeAsNil() { - x.TaskSignalReason = "" - } else { - yyv40 := &x.TaskSignalReason - yym41 := z.DecBinary() - _ = yym41 - if false { - } else { - *((*string)(yyv40)) = r.DecodeString() - } - } - case "TaskSignal": - if r.TryDecodeAsNil() { - x.TaskSignal = "" - } else { - yyv42 := &x.TaskSignal - yym43 := z.DecBinary() - _ = yym43 - if false { - } else { - *((*string)(yyv42)) = r.DecodeString() - } - } - case "DriverMessage": - if r.TryDecodeAsNil() { - x.DriverMessage = "" - } else { - yyv44 := &x.DriverMessage - yym45 := z.DecBinary() - _ = yym45 - if false { - } else { - *((*string)(yyv44)) = r.DecodeString() - } - } - case "GenericSource": - if r.TryDecodeAsNil() { - x.GenericSource = "" - } else { - yyv46 := &x.GenericSource - yym47 := z.DecBinary() - _ = yym47 - if false { - } else { - *((*string)(yyv46)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *TaskEvent) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj48 int - var yyb48 bool - var yyhl48 bool = l >= 0 - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Type = "" - } else { - yyv49 := &x.Type - yym50 := z.DecBinary() - _ = yym50 - if false { - } else { - *((*string)(yyv49)) = r.DecodeString() - } - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Time = 0 - } else { - yyv51 := &x.Time - yym52 := z.DecBinary() - _ = yym52 - if false { - } else { - *((*int64)(yyv51)) = int64(r.DecodeInt(64)) - } - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.FailsTask = false - } else { - yyv53 := &x.FailsTask - yym54 := z.DecBinary() - _ = yym54 - if false { - } else { - *((*bool)(yyv53)) = r.DecodeBool() - } - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.RestartReason = "" - } else { - yyv55 := &x.RestartReason - yym56 := z.DecBinary() - _ = yym56 - if false { - } else { - *((*string)(yyv55)) = r.DecodeString() - } - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.SetupError = "" - } else { - yyv57 := &x.SetupError - yym58 := z.DecBinary() - _ = yym58 - if false { - } else { - *((*string)(yyv57)) = r.DecodeString() - } - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DriverError = "" - } else { - yyv59 := &x.DriverError - yym60 := z.DecBinary() - _ = yym60 - if false { - } else { - *((*string)(yyv59)) = r.DecodeString() - } - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ExitCode = 0 - } else { - yyv61 := &x.ExitCode - yym62 := z.DecBinary() - _ = yym62 - if false { - } else { - *((*int)(yyv61)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Signal = 0 - } else { - yyv63 := &x.Signal - yym64 := z.DecBinary() - _ = yym64 - if false { - } else { - *((*int)(yyv63)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Message = "" - } else { - yyv65 := &x.Message - yym66 := z.DecBinary() - _ = yym66 - if false { - } else { - *((*string)(yyv65)) = r.DecodeString() - } - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KillTimeout = 0 - } else { - yyv67 := &x.KillTimeout - yym68 := z.DecBinary() - _ = yym68 - if false { - } else if z.HasExtensions() && z.DecExt(yyv67) { - } else { - *((*int64)(yyv67)) = int64(r.DecodeInt(64)) - } - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KillError = "" - } else { - yyv69 := &x.KillError - yym70 := z.DecBinary() - _ = yym70 - if false { - } else { - *((*string)(yyv69)) = r.DecodeString() - } - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.KillReason = "" - } else { - yyv71 := &x.KillReason - yym72 := z.DecBinary() - _ = yym72 - if false { - } else { - *((*string)(yyv71)) = r.DecodeString() - } - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.StartDelay = 0 - } else { - yyv73 := &x.StartDelay - yym74 := z.DecBinary() - _ = yym74 - if false { - } else { - *((*int64)(yyv73)) = int64(r.DecodeInt(64)) - } - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DownloadError = "" - } else { - yyv75 := &x.DownloadError - yym76 := z.DecBinary() - _ = yym76 - if false { - } else { - *((*string)(yyv75)) = r.DecodeString() - } - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ValidationError = "" - } else { - yyv77 := &x.ValidationError - yym78 := z.DecBinary() - _ = yym78 - if false { - } else { - *((*string)(yyv77)) = r.DecodeString() - } - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DiskLimit = 0 - } else { - yyv79 := &x.DiskLimit - yym80 := z.DecBinary() - _ = yym80 - if false { - } else { - *((*int64)(yyv79)) = int64(r.DecodeInt(64)) - } - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.FailedSibling = "" - } else { - yyv81 := &x.FailedSibling - yym82 := z.DecBinary() - _ = yym82 - if false { - } else { - *((*string)(yyv81)) = r.DecodeString() - } - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.VaultError = "" - } else { - yyv83 := &x.VaultError - yym84 := z.DecBinary() - _ = yym84 - if false { - } else { - *((*string)(yyv83)) = r.DecodeString() - } - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.TaskSignalReason = "" - } else { - yyv85 := &x.TaskSignalReason - yym86 := z.DecBinary() - _ = yym86 - if false { - } else { - *((*string)(yyv85)) = r.DecodeString() - } - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.TaskSignal = "" - } else { - yyv87 := &x.TaskSignal - yym88 := z.DecBinary() - _ = yym88 - if false { - } else { - *((*string)(yyv87)) = r.DecodeString() - } - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DriverMessage = "" - } else { - yyv89 := &x.DriverMessage - yym90 := z.DecBinary() - _ = yym90 - if false { - } else { - *((*string)(yyv89)) = r.DecodeString() - } - } - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.GenericSource = "" - } else { - yyv91 := &x.GenericSource - yym92 := z.DecBinary() - _ = yym92 - if false { - } else { - *((*string)(yyv91)) = r.DecodeString() - } - } - for { - yyj48++ - if yyhl48 { - yyb48 = yyj48 > l - } else { - yyb48 = r.CheckBreak() - } - if yyb48 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj48-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *TaskArtifact) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.GetterSource)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("GetterSource")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.GetterSource)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.GetterOptions == nil { - r.EncodeNil() - } else { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - z.F.EncMapStringStringV(x.GetterOptions, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("GetterOptions")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.GetterOptions == nil { - r.EncodeNil() - } else { - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - z.F.EncMapStringStringV(x.GetterOptions, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.GetterMode)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("GetterMode")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.GetterMode)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.RelativeDest)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("RelativeDest")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.RelativeDest)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *TaskArtifact) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *TaskArtifact) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "GetterSource": - if r.TryDecodeAsNil() { - x.GetterSource = "" - } else { - yyv4 := &x.GetterSource - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "GetterOptions": - if r.TryDecodeAsNil() { - x.GetterOptions = nil - } else { - yyv6 := &x.GetterOptions - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - z.F.DecMapStringStringX(yyv6, false, d) - } - } - case "GetterMode": - if r.TryDecodeAsNil() { - x.GetterMode = "" - } else { - yyv8 := &x.GetterMode - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "RelativeDest": - if r.TryDecodeAsNil() { - x.RelativeDest = "" - } else { - yyv10 := &x.RelativeDest - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *TaskArtifact) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.GetterSource = "" - } else { - yyv13 := &x.GetterSource - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*string)(yyv13)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.GetterOptions = nil - } else { - yyv15 := &x.GetterOptions - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - z.F.DecMapStringStringX(yyv15, false, d) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.GetterMode = "" - } else { - yyv17 := &x.GetterMode - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(yyv17)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.RelativeDest = "" - } else { - yyv19 := &x.RelativeDest - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *Constraint) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.LTarget)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("LTarget")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.LTarget)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.RTarget)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("RTarget")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.RTarget)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Operand)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Operand")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Operand)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *Constraint) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *Constraint) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "LTarget": - if r.TryDecodeAsNil() { - x.LTarget = "" - } else { - yyv4 := &x.LTarget - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "RTarget": - if r.TryDecodeAsNil() { - x.RTarget = "" - } else { - yyv6 := &x.RTarget - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "Operand": - if r.TryDecodeAsNil() { - x.Operand = "" - } else { - yyv8 := &x.Operand - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *Constraint) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.LTarget = "" - } else { - yyv11 := &x.LTarget - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*string)(yyv11)) = r.DecodeString() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.RTarget = "" - } else { - yyv13 := &x.RTarget - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*string)(yyv13)) = r.DecodeString() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Operand = "" - } else { - yyv15 := &x.Operand - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj10-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *EphemeralDisk) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeBool(bool(x.Sticky)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Sticky")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeBool(bool(x.Sticky)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeInt(int64(x.SizeMB)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("SizeMB")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeInt(int64(x.SizeMB)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeBool(bool(x.Migrate)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Migrate")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeBool(bool(x.Migrate)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *EphemeralDisk) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *EphemeralDisk) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Sticky": - if r.TryDecodeAsNil() { - x.Sticky = false - } else { - yyv4 := &x.Sticky - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*bool)(yyv4)) = r.DecodeBool() - } - } - case "SizeMB": - if r.TryDecodeAsNil() { - x.SizeMB = 0 - } else { - yyv6 := &x.SizeMB - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*int)(yyv6)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "Migrate": - if r.TryDecodeAsNil() { - x.Migrate = false - } else { - yyv8 := &x.Migrate - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*bool)(yyv8)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *EphemeralDisk) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Sticky = false - } else { - yyv11 := &x.Sticky - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*bool)(yyv11)) = r.DecodeBool() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.SizeMB = 0 - } else { - yyv13 := &x.SizeMB - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*int)(yyv13)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Migrate = false - } else { - yyv15 := &x.Migrate - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*bool)(yyv15)) = r.DecodeBool() - } - } - for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj10-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *Vault) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [4]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(4) - } else { - yynn2 = 4 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Policies == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - z.F.EncSliceStringV(x.Policies, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Policies")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Policies == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - z.F.EncSliceStringV(x.Policies, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeBool(bool(x.Env)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Env")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeBool(bool(x.Env)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ChangeMode)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ChangeMode")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ChangeMode)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ChangeSignal)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ChangeSignal")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ChangeSignal)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *Vault) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *Vault) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Policies": - if r.TryDecodeAsNil() { - x.Policies = nil - } else { - yyv4 := &x.Policies - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - z.F.DecSliceStringX(yyv4, false, d) - } - } - case "Env": - if r.TryDecodeAsNil() { - x.Env = false - } else { - yyv6 := &x.Env - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*bool)(yyv6)) = r.DecodeBool() - } - } - case "ChangeMode": - if r.TryDecodeAsNil() { - x.ChangeMode = "" - } else { - yyv8 := &x.ChangeMode - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "ChangeSignal": - if r.TryDecodeAsNil() { - x.ChangeSignal = "" - } else { - yyv10 := &x.ChangeSignal - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *Vault) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Policies = nil - } else { - yyv13 := &x.Policies - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - z.F.DecSliceStringX(yyv13, false, d) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Env = false - } else { - yyv15 := &x.Env - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*bool)(yyv15)) = r.DecodeBool() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ChangeMode = "" - } else { - yyv17 := &x.ChangeMode - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(yyv17)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ChangeSignal = "" - } else { - yyv19 := &x.ChangeSignal - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj12-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *Deployment) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [10]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(10) - } else { - yynn2 = 10 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.JobVersion)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.JobVersion)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeUint(uint64(x.JobModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeUint(uint64(x.JobModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeUint(uint64(x.JobCreateIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobCreateIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeUint(uint64(x.JobCreateIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.TaskGroups == nil { - r.EncodeNil() - } else { - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - h.encMapstringPtrtoDeploymentState((map[string]*DeploymentState)(x.TaskGroups), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("TaskGroups")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.TaskGroups == nil { - r.EncodeNil() - } else { - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - h.encMapstringPtrtoDeploymentState((map[string]*DeploymentState)(x.TaskGroups), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Status)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Status")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Status)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym25 := z.EncBinary() - _ = yym25 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.StatusDescription)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("StatusDescription")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.StatusDescription)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym28 := z.EncBinary() - _ = yym28 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("CreateIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym29 := z.EncBinary() - _ = yym29 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym31 := z.EncBinary() - _ = yym31 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym32 := z.EncBinary() - _ = yym32 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *Deployment) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *Deployment) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "ID": - if r.TryDecodeAsNil() { - x.ID = "" - } else { - yyv4 := &x.ID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "JobID": - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv6 := &x.JobID - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "JobVersion": - if r.TryDecodeAsNil() { - x.JobVersion = 0 - } else { - yyv8 := &x.JobVersion - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint64)(yyv8)) = uint64(r.DecodeUint(64)) - } - } - case "JobModifyIndex": - if r.TryDecodeAsNil() { - x.JobModifyIndex = 0 - } else { - yyv10 := &x.JobModifyIndex - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*uint64)(yyv10)) = uint64(r.DecodeUint(64)) - } - } - case "JobCreateIndex": - if r.TryDecodeAsNil() { - x.JobCreateIndex = 0 - } else { - yyv12 := &x.JobCreateIndex - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*uint64)(yyv12)) = uint64(r.DecodeUint(64)) - } - } - case "TaskGroups": - if r.TryDecodeAsNil() { - x.TaskGroups = nil - } else { - yyv14 := &x.TaskGroups - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - h.decMapstringPtrtoDeploymentState((*map[string]*DeploymentState)(yyv14), d) - } - } - case "Status": - if r.TryDecodeAsNil() { - x.Status = "" - } else { - yyv16 := &x.Status - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*string)(yyv16)) = r.DecodeString() - } - } - case "StatusDescription": - if r.TryDecodeAsNil() { - x.StatusDescription = "" - } else { - yyv18 := &x.StatusDescription - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - *((*string)(yyv18)) = r.DecodeString() - } - } - case "CreateIndex": - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv20 := &x.CreateIndex - yym21 := z.DecBinary() - _ = yym21 - if false { - } else { - *((*uint64)(yyv20)) = uint64(r.DecodeUint(64)) - } - } - case "ModifyIndex": - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv22 := &x.ModifyIndex - yym23 := z.DecBinary() - _ = yym23 - if false { - } else { - *((*uint64)(yyv22)) = uint64(r.DecodeUint(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *Deployment) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj24 int - var yyb24 bool - var yyhl24 bool = l >= 0 - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ID = "" - } else { - yyv25 := &x.ID - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*string)(yyv25)) = r.DecodeString() - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv27 := &x.JobID - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*string)(yyv27)) = r.DecodeString() - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobVersion = 0 - } else { - yyv29 := &x.JobVersion - yym30 := z.DecBinary() - _ = yym30 - if false { - } else { - *((*uint64)(yyv29)) = uint64(r.DecodeUint(64)) - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobModifyIndex = 0 - } else { - yyv31 := &x.JobModifyIndex - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - *((*uint64)(yyv31)) = uint64(r.DecodeUint(64)) - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobCreateIndex = 0 - } else { - yyv33 := &x.JobCreateIndex - yym34 := z.DecBinary() - _ = yym34 - if false { - } else { - *((*uint64)(yyv33)) = uint64(r.DecodeUint(64)) - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.TaskGroups = nil - } else { - yyv35 := &x.TaskGroups - yym36 := z.DecBinary() - _ = yym36 - if false { - } else { - h.decMapstringPtrtoDeploymentState((*map[string]*DeploymentState)(yyv35), d) - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Status = "" - } else { - yyv37 := &x.Status - yym38 := z.DecBinary() - _ = yym38 - if false { - } else { - *((*string)(yyv37)) = r.DecodeString() - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.StatusDescription = "" - } else { - yyv39 := &x.StatusDescription - yym40 := z.DecBinary() - _ = yym40 - if false { - } else { - *((*string)(yyv39)) = r.DecodeString() - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv41 := &x.CreateIndex - yym42 := z.DecBinary() - _ = yym42 - if false { - } else { - *((*uint64)(yyv41)) = uint64(r.DecodeUint(64)) - } - } - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv43 := &x.ModifyIndex - yym44 := z.DecBinary() - _ = yym44 - if false { - } else { - *((*uint64)(yyv43)) = uint64(r.DecodeUint(64)) - } - } - for { - yyj24++ - if yyhl24 { - yyb24 = yyj24 > l - } else { - yyb24 = r.CheckBreak() - } - if yyb24 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj24-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *DeploymentState) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [8]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(8) - } else { - yynn2 = 8 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeBool(bool(x.AutoRevert)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AutoRevert")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeBool(bool(x.AutoRevert)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeBool(bool(x.Promoted)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Promoted")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeBool(bool(x.Promoted)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.PlacedCanaries == nil { - r.EncodeNil() - } else { - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - z.F.EncSliceStringV(x.PlacedCanaries, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("PlacedCanaries")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.PlacedCanaries == nil { - r.EncodeNil() - } else { - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - z.F.EncSliceStringV(x.PlacedCanaries, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeInt(int64(x.DesiredCanaries)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DesiredCanaries")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeInt(int64(x.DesiredCanaries)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeInt(int64(x.DesiredTotal)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DesiredTotal")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeInt(int64(x.DesiredTotal)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeInt(int64(x.PlacedAllocs)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("PlacedAllocs")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeInt(int64(x.PlacedAllocs)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeInt(int64(x.HealthyAllocs)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("HealthyAllocs")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeInt(int64(x.HealthyAllocs)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym25 := z.EncBinary() - _ = yym25 - if false { - } else { - r.EncodeInt(int64(x.UnhealthyAllocs)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("UnhealthyAllocs")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - r.EncodeInt(int64(x.UnhealthyAllocs)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *DeploymentState) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *DeploymentState) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "AutoRevert": - if r.TryDecodeAsNil() { - x.AutoRevert = false - } else { - yyv4 := &x.AutoRevert - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*bool)(yyv4)) = r.DecodeBool() - } - } - case "Promoted": - if r.TryDecodeAsNil() { - x.Promoted = false - } else { - yyv6 := &x.Promoted - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*bool)(yyv6)) = r.DecodeBool() - } - } - case "PlacedCanaries": - if r.TryDecodeAsNil() { - x.PlacedCanaries = nil - } else { - yyv8 := &x.PlacedCanaries - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - z.F.DecSliceStringX(yyv8, false, d) - } - } - case "DesiredCanaries": - if r.TryDecodeAsNil() { - x.DesiredCanaries = 0 - } else { - yyv10 := &x.DesiredCanaries - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*int)(yyv10)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "DesiredTotal": - if r.TryDecodeAsNil() { - x.DesiredTotal = 0 - } else { - yyv12 := &x.DesiredTotal - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*int)(yyv12)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "PlacedAllocs": - if r.TryDecodeAsNil() { - x.PlacedAllocs = 0 - } else { - yyv14 := &x.PlacedAllocs - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*int)(yyv14)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "HealthyAllocs": - if r.TryDecodeAsNil() { - x.HealthyAllocs = 0 - } else { - yyv16 := &x.HealthyAllocs - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*int)(yyv16)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "UnhealthyAllocs": - if r.TryDecodeAsNil() { - x.UnhealthyAllocs = 0 - } else { - yyv18 := &x.UnhealthyAllocs - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - *((*int)(yyv18)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *DeploymentState) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj20 int - var yyb20 bool - var yyhl20 bool = l >= 0 - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AutoRevert = false - } else { - yyv21 := &x.AutoRevert - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*bool)(yyv21)) = r.DecodeBool() - } - } - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Promoted = false - } else { - yyv23 := &x.Promoted - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*bool)(yyv23)) = r.DecodeBool() - } - } - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.PlacedCanaries = nil - } else { - yyv25 := &x.PlacedCanaries - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - z.F.DecSliceStringX(yyv25, false, d) - } - } - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DesiredCanaries = 0 - } else { - yyv27 := &x.DesiredCanaries - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*int)(yyv27)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DesiredTotal = 0 - } else { - yyv29 := &x.DesiredTotal - yym30 := z.DecBinary() - _ = yym30 - if false { - } else { - *((*int)(yyv29)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.PlacedAllocs = 0 - } else { - yyv31 := &x.PlacedAllocs - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - *((*int)(yyv31)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.HealthyAllocs = 0 - } else { - yyv33 := &x.HealthyAllocs - yym34 := z.DecBinary() - _ = yym34 - if false { - } else { - *((*int)(yyv33)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.UnhealthyAllocs = 0 - } else { - yyv35 := &x.UnhealthyAllocs - yym36 := z.DecBinary() - _ = yym36 - if false { - } else { - *((*int)(yyv35)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - for { - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj20-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *DeploymentStatusUpdate) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DeploymentID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DeploymentID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DeploymentID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Status)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Status")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Status)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.StatusDescription)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("StatusDescription")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.StatusDescription)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *DeploymentStatusUpdate) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *DeploymentStatusUpdate) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "DeploymentID": - if r.TryDecodeAsNil() { - x.DeploymentID = "" - } else { - yyv4 := &x.DeploymentID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Status": - if r.TryDecodeAsNil() { - x.Status = "" - } else { - yyv6 := &x.Status - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "StatusDescription": - if r.TryDecodeAsNil() { - x.StatusDescription = "" - } else { - yyv8 := &x.StatusDescription - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *DeploymentStatusUpdate) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DeploymentID = "" - } else { - yyv11 := &x.DeploymentID - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*string)(yyv11)) = r.DecodeString() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Status = "" - } else { - yyv13 := &x.Status - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*string)(yyv13)) = r.DecodeString() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.StatusDescription = "" - } else { - yyv15 := &x.StatusDescription - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj10-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *Allocation) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [23]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(23) - } else { - yynn2 = 23 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EvalID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Name")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodeID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Job == nil { - r.EncodeNil() - } else { - x.Job.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Job")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Job == nil { - r.EncodeNil() - } else { - x.Job.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.TaskGroup)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("TaskGroup")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.TaskGroup)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Resources == nil { - r.EncodeNil() - } else { - x.Resources.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Resources")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Resources == nil { - r.EncodeNil() - } else { - x.Resources.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.SharedResources == nil { - r.EncodeNil() - } else { - x.SharedResources.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("SharedResources")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.SharedResources == nil { - r.EncodeNil() - } else { - x.SharedResources.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.TaskResources == nil { - r.EncodeNil() - } else { - yym31 := z.EncBinary() - _ = yym31 - if false { - } else { - h.encMapstringPtrtoResources((map[string]*Resources)(x.TaskResources), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("TaskResources")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.TaskResources == nil { - r.EncodeNil() - } else { - yym32 := z.EncBinary() - _ = yym32 - if false { - } else { - h.encMapstringPtrtoResources((map[string]*Resources)(x.TaskResources), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Metrics == nil { - r.EncodeNil() - } else { - x.Metrics.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Metrics")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Metrics == nil { - r.EncodeNil() - } else { - x.Metrics.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym37 := z.EncBinary() - _ = yym37 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DesiredStatus)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DesiredStatus")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym38 := z.EncBinary() - _ = yym38 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DesiredStatus)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym40 := z.EncBinary() - _ = yym40 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DesiredDescription)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DesiredDescription")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym41 := z.EncBinary() - _ = yym41 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DesiredDescription)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym43 := z.EncBinary() - _ = yym43 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ClientStatus)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ClientStatus")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym44 := z.EncBinary() - _ = yym44 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ClientStatus)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym46 := z.EncBinary() - _ = yym46 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ClientDescription)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ClientDescription")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym47 := z.EncBinary() - _ = yym47 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ClientDescription)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.TaskStates == nil { - r.EncodeNil() - } else { - yym49 := z.EncBinary() - _ = yym49 - if false { - } else { - h.encMapstringPtrtoTaskState((map[string]*TaskState)(x.TaskStates), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("TaskStates")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.TaskStates == nil { - r.EncodeNil() - } else { - yym50 := z.EncBinary() - _ = yym50 - if false { - } else { - h.encMapstringPtrtoTaskState((map[string]*TaskState)(x.TaskStates), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym52 := z.EncBinary() - _ = yym52 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.PreviousAllocation)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("PreviousAllocation")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym53 := z.EncBinary() - _ = yym53 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.PreviousAllocation)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym55 := z.EncBinary() - _ = yym55 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DeploymentID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DeploymentID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym56 := z.EncBinary() - _ = yym56 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DeploymentID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.DeploymentStatus == nil { - r.EncodeNil() - } else { - x.DeploymentStatus.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DeploymentStatus")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.DeploymentStatus == nil { - r.EncodeNil() - } else { - x.DeploymentStatus.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym61 := z.EncBinary() - _ = yym61 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("CreateIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym62 := z.EncBinary() - _ = yym62 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym64 := z.EncBinary() - _ = yym64 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym65 := z.EncBinary() - _ = yym65 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym67 := z.EncBinary() - _ = yym67 - if false { - } else { - r.EncodeUint(uint64(x.AllocModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllocModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym68 := z.EncBinary() - _ = yym68 - if false { - } else { - r.EncodeUint(uint64(x.AllocModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym70 := z.EncBinary() - _ = yym70 - if false { - } else { - r.EncodeInt(int64(x.CreateTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("CreateTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym71 := z.EncBinary() - _ = yym71 - if false { - } else { - r.EncodeInt(int64(x.CreateTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *Allocation) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *Allocation) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "ID": - if r.TryDecodeAsNil() { - x.ID = "" - } else { - yyv4 := &x.ID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "EvalID": - if r.TryDecodeAsNil() { - x.EvalID = "" - } else { - yyv6 := &x.EvalID - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "Name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv8 := &x.Name - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "NodeID": - if r.TryDecodeAsNil() { - x.NodeID = "" - } else { - yyv10 := &x.NodeID - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - case "JobID": - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv12 := &x.JobID - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - case "Job": - if r.TryDecodeAsNil() { - if x.Job != nil { - x.Job = nil - } - } else { - if x.Job == nil { - x.Job = new(Job) - } - x.Job.CodecDecodeSelf(d) - } - case "TaskGroup": - if r.TryDecodeAsNil() { - x.TaskGroup = "" - } else { - yyv15 := &x.TaskGroup - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - case "Resources": - if r.TryDecodeAsNil() { - if x.Resources != nil { - x.Resources = nil - } - } else { - if x.Resources == nil { - x.Resources = new(Resources) - } - x.Resources.CodecDecodeSelf(d) - } - case "SharedResources": - if r.TryDecodeAsNil() { - if x.SharedResources != nil { - x.SharedResources = nil - } - } else { - if x.SharedResources == nil { - x.SharedResources = new(Resources) - } - x.SharedResources.CodecDecodeSelf(d) - } - case "TaskResources": - if r.TryDecodeAsNil() { - x.TaskResources = nil - } else { - yyv19 := &x.TaskResources - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - h.decMapstringPtrtoResources((*map[string]*Resources)(yyv19), d) - } - } - case "Metrics": - if r.TryDecodeAsNil() { - if x.Metrics != nil { - x.Metrics = nil - } - } else { - if x.Metrics == nil { - x.Metrics = new(AllocMetric) - } - x.Metrics.CodecDecodeSelf(d) - } - case "DesiredStatus": - if r.TryDecodeAsNil() { - x.DesiredStatus = "" - } else { - yyv22 := &x.DesiredStatus - yym23 := z.DecBinary() - _ = yym23 - if false { - } else { - *((*string)(yyv22)) = r.DecodeString() - } - } - case "DesiredDescription": - if r.TryDecodeAsNil() { - x.DesiredDescription = "" - } else { - yyv24 := &x.DesiredDescription - yym25 := z.DecBinary() - _ = yym25 - if false { - } else { - *((*string)(yyv24)) = r.DecodeString() - } - } - case "ClientStatus": - if r.TryDecodeAsNil() { - x.ClientStatus = "" - } else { - yyv26 := &x.ClientStatus - yym27 := z.DecBinary() - _ = yym27 - if false { - } else { - *((*string)(yyv26)) = r.DecodeString() - } - } - case "ClientDescription": - if r.TryDecodeAsNil() { - x.ClientDescription = "" - } else { - yyv28 := &x.ClientDescription - yym29 := z.DecBinary() - _ = yym29 - if false { - } else { - *((*string)(yyv28)) = r.DecodeString() - } - } - case "TaskStates": - if r.TryDecodeAsNil() { - x.TaskStates = nil - } else { - yyv30 := &x.TaskStates - yym31 := z.DecBinary() - _ = yym31 - if false { - } else { - h.decMapstringPtrtoTaskState((*map[string]*TaskState)(yyv30), d) - } - } - case "PreviousAllocation": - if r.TryDecodeAsNil() { - x.PreviousAllocation = "" - } else { - yyv32 := &x.PreviousAllocation - yym33 := z.DecBinary() - _ = yym33 - if false { - } else { - *((*string)(yyv32)) = r.DecodeString() - } - } - case "DeploymentID": - if r.TryDecodeAsNil() { - x.DeploymentID = "" - } else { - yyv34 := &x.DeploymentID - yym35 := z.DecBinary() - _ = yym35 - if false { - } else { - *((*string)(yyv34)) = r.DecodeString() - } - } - case "DeploymentStatus": - if r.TryDecodeAsNil() { - if x.DeploymentStatus != nil { - x.DeploymentStatus = nil - } - } else { - if x.DeploymentStatus == nil { - x.DeploymentStatus = new(AllocDeploymentStatus) - } - x.DeploymentStatus.CodecDecodeSelf(d) - } - case "CreateIndex": - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv37 := &x.CreateIndex - yym38 := z.DecBinary() - _ = yym38 - if false { - } else { - *((*uint64)(yyv37)) = uint64(r.DecodeUint(64)) - } - } - case "ModifyIndex": - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv39 := &x.ModifyIndex - yym40 := z.DecBinary() - _ = yym40 - if false { - } else { - *((*uint64)(yyv39)) = uint64(r.DecodeUint(64)) - } - } - case "AllocModifyIndex": - if r.TryDecodeAsNil() { - x.AllocModifyIndex = 0 - } else { - yyv41 := &x.AllocModifyIndex - yym42 := z.DecBinary() - _ = yym42 - if false { - } else { - *((*uint64)(yyv41)) = uint64(r.DecodeUint(64)) - } - } - case "CreateTime": - if r.TryDecodeAsNil() { - x.CreateTime = 0 - } else { - yyv43 := &x.CreateTime - yym44 := z.DecBinary() - _ = yym44 - if false { - } else { - *((*int64)(yyv43)) = int64(r.DecodeInt(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *Allocation) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj45 int - var yyb45 bool - var yyhl45 bool = l >= 0 - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ID = "" - } else { - yyv46 := &x.ID - yym47 := z.DecBinary() - _ = yym47 - if false { - } else { - *((*string)(yyv46)) = r.DecodeString() - } - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EvalID = "" - } else { - yyv48 := &x.EvalID - yym49 := z.DecBinary() - _ = yym49 - if false { - } else { - *((*string)(yyv48)) = r.DecodeString() - } - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv50 := &x.Name - yym51 := z.DecBinary() - _ = yym51 - if false { - } else { - *((*string)(yyv50)) = r.DecodeString() - } - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodeID = "" - } else { - yyv52 := &x.NodeID - yym53 := z.DecBinary() - _ = yym53 - if false { - } else { - *((*string)(yyv52)) = r.DecodeString() - } - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv54 := &x.JobID - yym55 := z.DecBinary() - _ = yym55 - if false { - } else { - *((*string)(yyv54)) = r.DecodeString() - } - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Job != nil { - x.Job = nil - } - } else { - if x.Job == nil { - x.Job = new(Job) - } - x.Job.CodecDecodeSelf(d) - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.TaskGroup = "" - } else { - yyv57 := &x.TaskGroup - yym58 := z.DecBinary() - _ = yym58 - if false { - } else { - *((*string)(yyv57)) = r.DecodeString() - } - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Resources != nil { - x.Resources = nil - } - } else { - if x.Resources == nil { - x.Resources = new(Resources) - } - x.Resources.CodecDecodeSelf(d) - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.SharedResources != nil { - x.SharedResources = nil - } - } else { - if x.SharedResources == nil { - x.SharedResources = new(Resources) - } - x.SharedResources.CodecDecodeSelf(d) - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.TaskResources = nil - } else { - yyv61 := &x.TaskResources - yym62 := z.DecBinary() - _ = yym62 - if false { - } else { - h.decMapstringPtrtoResources((*map[string]*Resources)(yyv61), d) - } - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Metrics != nil { - x.Metrics = nil - } - } else { - if x.Metrics == nil { - x.Metrics = new(AllocMetric) - } - x.Metrics.CodecDecodeSelf(d) - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DesiredStatus = "" - } else { - yyv64 := &x.DesiredStatus - yym65 := z.DecBinary() - _ = yym65 - if false { - } else { - *((*string)(yyv64)) = r.DecodeString() - } - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DesiredDescription = "" - } else { - yyv66 := &x.DesiredDescription - yym67 := z.DecBinary() - _ = yym67 - if false { - } else { - *((*string)(yyv66)) = r.DecodeString() - } - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ClientStatus = "" - } else { - yyv68 := &x.ClientStatus - yym69 := z.DecBinary() - _ = yym69 - if false { - } else { - *((*string)(yyv68)) = r.DecodeString() - } - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ClientDescription = "" - } else { - yyv70 := &x.ClientDescription - yym71 := z.DecBinary() - _ = yym71 - if false { - } else { - *((*string)(yyv70)) = r.DecodeString() - } - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.TaskStates = nil - } else { - yyv72 := &x.TaskStates - yym73 := z.DecBinary() - _ = yym73 - if false { - } else { - h.decMapstringPtrtoTaskState((*map[string]*TaskState)(yyv72), d) - } - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.PreviousAllocation = "" - } else { - yyv74 := &x.PreviousAllocation - yym75 := z.DecBinary() - _ = yym75 - if false { - } else { - *((*string)(yyv74)) = r.DecodeString() - } - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DeploymentID = "" - } else { - yyv76 := &x.DeploymentID - yym77 := z.DecBinary() - _ = yym77 - if false { - } else { - *((*string)(yyv76)) = r.DecodeString() - } - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.DeploymentStatus != nil { - x.DeploymentStatus = nil - } - } else { - if x.DeploymentStatus == nil { - x.DeploymentStatus = new(AllocDeploymentStatus) - } - x.DeploymentStatus.CodecDecodeSelf(d) - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv79 := &x.CreateIndex - yym80 := z.DecBinary() - _ = yym80 - if false { - } else { - *((*uint64)(yyv79)) = uint64(r.DecodeUint(64)) - } - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv81 := &x.ModifyIndex - yym82 := z.DecBinary() - _ = yym82 - if false { - } else { - *((*uint64)(yyv81)) = uint64(r.DecodeUint(64)) - } - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllocModifyIndex = 0 - } else { - yyv83 := &x.AllocModifyIndex - yym84 := z.DecBinary() - _ = yym84 - if false { - } else { - *((*uint64)(yyv83)) = uint64(r.DecodeUint(64)) - } - } - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.CreateTime = 0 - } else { - yyv85 := &x.CreateTime - yym86 := z.DecBinary() - _ = yym86 - if false { - } else { - *((*int64)(yyv85)) = int64(r.DecodeInt(64)) - } - } - for { - yyj45++ - if yyhl45 { - yyb45 = yyj45 > l - } else { - yyb45 = r.CheckBreak() - } - if yyb45 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj45-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *AllocListStub) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [16]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(16) - } else { - yynn2 = 16 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EvalID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Name")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Name)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodeID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeUint(uint64(x.JobVersion)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeUint(uint64(x.JobVersion)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.TaskGroup)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("TaskGroup")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.TaskGroup)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym25 := z.EncBinary() - _ = yym25 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DesiredStatus)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DesiredStatus")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DesiredStatus)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym28 := z.EncBinary() - _ = yym28 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DesiredDescription)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DesiredDescription")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym29 := z.EncBinary() - _ = yym29 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DesiredDescription)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym31 := z.EncBinary() - _ = yym31 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ClientStatus)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ClientStatus")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym32 := z.EncBinary() - _ = yym32 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ClientStatus)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym34 := z.EncBinary() - _ = yym34 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ClientDescription)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ClientDescription")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym35 := z.EncBinary() - _ = yym35 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ClientDescription)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.TaskStates == nil { - r.EncodeNil() - } else { - yym37 := z.EncBinary() - _ = yym37 - if false { - } else { - h.encMapstringPtrtoTaskState((map[string]*TaskState)(x.TaskStates), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("TaskStates")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.TaskStates == nil { - r.EncodeNil() - } else { - yym38 := z.EncBinary() - _ = yym38 - if false { - } else { - h.encMapstringPtrtoTaskState((map[string]*TaskState)(x.TaskStates), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.DeploymentStatus == nil { - r.EncodeNil() - } else { - x.DeploymentStatus.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DeploymentStatus")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.DeploymentStatus == nil { - r.EncodeNil() - } else { - x.DeploymentStatus.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym43 := z.EncBinary() - _ = yym43 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("CreateIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym44 := z.EncBinary() - _ = yym44 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym46 := z.EncBinary() - _ = yym46 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym47 := z.EncBinary() - _ = yym47 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym49 := z.EncBinary() - _ = yym49 - if false { - } else { - r.EncodeInt(int64(x.CreateTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("CreateTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym50 := z.EncBinary() - _ = yym50 - if false { - } else { - r.EncodeInt(int64(x.CreateTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *AllocListStub) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *AllocListStub) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "ID": - if r.TryDecodeAsNil() { - x.ID = "" - } else { - yyv4 := &x.ID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "EvalID": - if r.TryDecodeAsNil() { - x.EvalID = "" - } else { - yyv6 := &x.EvalID - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "Name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv8 := &x.Name - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "NodeID": - if r.TryDecodeAsNil() { - x.NodeID = "" - } else { - yyv10 := &x.NodeID - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - case "JobID": - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv12 := &x.JobID - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - case "JobVersion": - if r.TryDecodeAsNil() { - x.JobVersion = 0 - } else { - yyv14 := &x.JobVersion - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*uint64)(yyv14)) = uint64(r.DecodeUint(64)) - } - } - case "TaskGroup": - if r.TryDecodeAsNil() { - x.TaskGroup = "" - } else { - yyv16 := &x.TaskGroup - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*string)(yyv16)) = r.DecodeString() - } - } - case "DesiredStatus": - if r.TryDecodeAsNil() { - x.DesiredStatus = "" - } else { - yyv18 := &x.DesiredStatus - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - *((*string)(yyv18)) = r.DecodeString() - } - } - case "DesiredDescription": - if r.TryDecodeAsNil() { - x.DesiredDescription = "" - } else { - yyv20 := &x.DesiredDescription - yym21 := z.DecBinary() - _ = yym21 - if false { - } else { - *((*string)(yyv20)) = r.DecodeString() - } - } - case "ClientStatus": - if r.TryDecodeAsNil() { - x.ClientStatus = "" - } else { - yyv22 := &x.ClientStatus - yym23 := z.DecBinary() - _ = yym23 - if false { - } else { - *((*string)(yyv22)) = r.DecodeString() - } - } - case "ClientDescription": - if r.TryDecodeAsNil() { - x.ClientDescription = "" - } else { - yyv24 := &x.ClientDescription - yym25 := z.DecBinary() - _ = yym25 - if false { - } else { - *((*string)(yyv24)) = r.DecodeString() - } - } - case "TaskStates": - if r.TryDecodeAsNil() { - x.TaskStates = nil - } else { - yyv26 := &x.TaskStates - yym27 := z.DecBinary() - _ = yym27 - if false { - } else { - h.decMapstringPtrtoTaskState((*map[string]*TaskState)(yyv26), d) - } - } - case "DeploymentStatus": - if r.TryDecodeAsNil() { - if x.DeploymentStatus != nil { - x.DeploymentStatus = nil - } - } else { - if x.DeploymentStatus == nil { - x.DeploymentStatus = new(AllocDeploymentStatus) - } - x.DeploymentStatus.CodecDecodeSelf(d) - } - case "CreateIndex": - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv29 := &x.CreateIndex - yym30 := z.DecBinary() - _ = yym30 - if false { - } else { - *((*uint64)(yyv29)) = uint64(r.DecodeUint(64)) - } - } - case "ModifyIndex": - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv31 := &x.ModifyIndex - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - *((*uint64)(yyv31)) = uint64(r.DecodeUint(64)) - } - } - case "CreateTime": - if r.TryDecodeAsNil() { - x.CreateTime = 0 - } else { - yyv33 := &x.CreateTime - yym34 := z.DecBinary() - _ = yym34 - if false { - } else { - *((*int64)(yyv33)) = int64(r.DecodeInt(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *AllocListStub) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj35 int - var yyb35 bool - var yyhl35 bool = l >= 0 - yyj35++ - if yyhl35 { - yyb35 = yyj35 > l - } else { - yyb35 = r.CheckBreak() - } - if yyb35 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ID = "" - } else { - yyv36 := &x.ID - yym37 := z.DecBinary() - _ = yym37 - if false { - } else { - *((*string)(yyv36)) = r.DecodeString() - } - } - yyj35++ - if yyhl35 { - yyb35 = yyj35 > l - } else { - yyb35 = r.CheckBreak() - } - if yyb35 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EvalID = "" - } else { - yyv38 := &x.EvalID - yym39 := z.DecBinary() - _ = yym39 - if false { - } else { - *((*string)(yyv38)) = r.DecodeString() - } - } - yyj35++ - if yyhl35 { - yyb35 = yyj35 > l - } else { - yyb35 = r.CheckBreak() - } - if yyb35 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv40 := &x.Name - yym41 := z.DecBinary() - _ = yym41 - if false { - } else { - *((*string)(yyv40)) = r.DecodeString() - } - } - yyj35++ - if yyhl35 { - yyb35 = yyj35 > l - } else { - yyb35 = r.CheckBreak() - } - if yyb35 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodeID = "" - } else { - yyv42 := &x.NodeID - yym43 := z.DecBinary() - _ = yym43 - if false { - } else { - *((*string)(yyv42)) = r.DecodeString() - } - } - yyj35++ - if yyhl35 { - yyb35 = yyj35 > l - } else { - yyb35 = r.CheckBreak() - } - if yyb35 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv44 := &x.JobID - yym45 := z.DecBinary() - _ = yym45 - if false { - } else { - *((*string)(yyv44)) = r.DecodeString() - } - } - yyj35++ - if yyhl35 { - yyb35 = yyj35 > l - } else { - yyb35 = r.CheckBreak() - } - if yyb35 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobVersion = 0 - } else { - yyv46 := &x.JobVersion - yym47 := z.DecBinary() - _ = yym47 - if false { - } else { - *((*uint64)(yyv46)) = uint64(r.DecodeUint(64)) - } - } - yyj35++ - if yyhl35 { - yyb35 = yyj35 > l - } else { - yyb35 = r.CheckBreak() - } - if yyb35 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.TaskGroup = "" - } else { - yyv48 := &x.TaskGroup - yym49 := z.DecBinary() - _ = yym49 - if false { - } else { - *((*string)(yyv48)) = r.DecodeString() - } - } - yyj35++ - if yyhl35 { - yyb35 = yyj35 > l - } else { - yyb35 = r.CheckBreak() - } - if yyb35 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DesiredStatus = "" - } else { - yyv50 := &x.DesiredStatus - yym51 := z.DecBinary() - _ = yym51 - if false { - } else { - *((*string)(yyv50)) = r.DecodeString() - } - } - yyj35++ - if yyhl35 { - yyb35 = yyj35 > l - } else { - yyb35 = r.CheckBreak() - } - if yyb35 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DesiredDescription = "" - } else { - yyv52 := &x.DesiredDescription - yym53 := z.DecBinary() - _ = yym53 - if false { - } else { - *((*string)(yyv52)) = r.DecodeString() - } - } - yyj35++ - if yyhl35 { - yyb35 = yyj35 > l - } else { - yyb35 = r.CheckBreak() - } - if yyb35 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ClientStatus = "" - } else { - yyv54 := &x.ClientStatus - yym55 := z.DecBinary() - _ = yym55 - if false { - } else { - *((*string)(yyv54)) = r.DecodeString() - } - } - yyj35++ - if yyhl35 { - yyb35 = yyj35 > l - } else { - yyb35 = r.CheckBreak() - } - if yyb35 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ClientDescription = "" - } else { - yyv56 := &x.ClientDescription - yym57 := z.DecBinary() - _ = yym57 - if false { - } else { - *((*string)(yyv56)) = r.DecodeString() - } - } - yyj35++ - if yyhl35 { - yyb35 = yyj35 > l - } else { - yyb35 = r.CheckBreak() - } - if yyb35 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.TaskStates = nil - } else { - yyv58 := &x.TaskStates - yym59 := z.DecBinary() - _ = yym59 - if false { - } else { - h.decMapstringPtrtoTaskState((*map[string]*TaskState)(yyv58), d) - } - } - yyj35++ - if yyhl35 { - yyb35 = yyj35 > l - } else { - yyb35 = r.CheckBreak() - } - if yyb35 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.DeploymentStatus != nil { - x.DeploymentStatus = nil - } - } else { - if x.DeploymentStatus == nil { - x.DeploymentStatus = new(AllocDeploymentStatus) - } - x.DeploymentStatus.CodecDecodeSelf(d) - } - yyj35++ - if yyhl35 { - yyb35 = yyj35 > l - } else { - yyb35 = r.CheckBreak() - } - if yyb35 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv61 := &x.CreateIndex - yym62 := z.DecBinary() - _ = yym62 - if false { - } else { - *((*uint64)(yyv61)) = uint64(r.DecodeUint(64)) - } - } - yyj35++ - if yyhl35 { - yyb35 = yyj35 > l - } else { - yyb35 = r.CheckBreak() - } - if yyb35 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv63 := &x.ModifyIndex - yym64 := z.DecBinary() - _ = yym64 - if false { - } else { - *((*uint64)(yyv63)) = uint64(r.DecodeUint(64)) - } - } - yyj35++ - if yyhl35 { - yyb35 = yyj35 > l - } else { - yyb35 = r.CheckBreak() - } - if yyb35 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.CreateTime = 0 - } else { - yyv65 := &x.CreateTime - yym66 := z.DecBinary() - _ = yym66 - if false { - } else { - *((*int64)(yyv65)) = int64(r.DecodeInt(64)) - } - } - for { - yyj35++ - if yyhl35 { - yyb35 = yyj35 > l - } else { - yyb35 = r.CheckBreak() - } - if yyb35 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj35-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *AllocMetric) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [11]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(11) - } else { - yynn2 = 11 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeInt(int64(x.NodesEvaluated)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodesEvaluated")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeInt(int64(x.NodesEvaluated)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeInt(int64(x.NodesFiltered)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodesFiltered")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeInt(int64(x.NodesFiltered)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.NodesAvailable == nil { - r.EncodeNil() - } else { - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - z.F.EncMapStringIntV(x.NodesAvailable, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodesAvailable")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.NodesAvailable == nil { - r.EncodeNil() - } else { - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - z.F.EncMapStringIntV(x.NodesAvailable, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.ClassFiltered == nil { - r.EncodeNil() - } else { - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - z.F.EncMapStringIntV(x.ClassFiltered, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ClassFiltered")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.ClassFiltered == nil { - r.EncodeNil() - } else { - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - z.F.EncMapStringIntV(x.ClassFiltered, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.ConstraintFiltered == nil { - r.EncodeNil() - } else { - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - z.F.EncMapStringIntV(x.ConstraintFiltered, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ConstraintFiltered")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.ConstraintFiltered == nil { - r.EncodeNil() - } else { - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - z.F.EncMapStringIntV(x.ConstraintFiltered, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeInt(int64(x.NodesExhausted)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodesExhausted")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeInt(int64(x.NodesExhausted)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.ClassExhausted == nil { - r.EncodeNil() - } else { - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - z.F.EncMapStringIntV(x.ClassExhausted, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ClassExhausted")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.ClassExhausted == nil { - r.EncodeNil() - } else { - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - z.F.EncMapStringIntV(x.ClassExhausted, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.DimensionExhausted == nil { - r.EncodeNil() - } else { - yym25 := z.EncBinary() - _ = yym25 - if false { - } else { - z.F.EncMapStringIntV(x.DimensionExhausted, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DimensionExhausted")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.DimensionExhausted == nil { - r.EncodeNil() - } else { - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - z.F.EncMapStringIntV(x.DimensionExhausted, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Scores == nil { - r.EncodeNil() - } else { - yym28 := z.EncBinary() - _ = yym28 - if false { - } else { - z.F.EncMapStringFloat64V(x.Scores, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Scores")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Scores == nil { - r.EncodeNil() - } else { - yym29 := z.EncBinary() - _ = yym29 - if false { - } else { - z.F.EncMapStringFloat64V(x.Scores, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym31 := z.EncBinary() - _ = yym31 - if false { - } else if z.HasExtensions() && z.EncExt(x.AllocationTime) { - } else { - r.EncodeInt(int64(x.AllocationTime)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllocationTime")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym32 := z.EncBinary() - _ = yym32 - if false { - } else if z.HasExtensions() && z.EncExt(x.AllocationTime) { - } else { - r.EncodeInt(int64(x.AllocationTime)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym34 := z.EncBinary() - _ = yym34 - if false { - } else { - r.EncodeInt(int64(x.CoalescedFailures)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("CoalescedFailures")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym35 := z.EncBinary() - _ = yym35 - if false { - } else { - r.EncodeInt(int64(x.CoalescedFailures)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *AllocMetric) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *AllocMetric) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "NodesEvaluated": - if r.TryDecodeAsNil() { - x.NodesEvaluated = 0 - } else { - yyv4 := &x.NodesEvaluated - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*int)(yyv4)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "NodesFiltered": - if r.TryDecodeAsNil() { - x.NodesFiltered = 0 - } else { - yyv6 := &x.NodesFiltered - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*int)(yyv6)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "NodesAvailable": - if r.TryDecodeAsNil() { - x.NodesAvailable = nil - } else { - yyv8 := &x.NodesAvailable - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - z.F.DecMapStringIntX(yyv8, false, d) - } - } - case "ClassFiltered": - if r.TryDecodeAsNil() { - x.ClassFiltered = nil - } else { - yyv10 := &x.ClassFiltered - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - z.F.DecMapStringIntX(yyv10, false, d) - } - } - case "ConstraintFiltered": - if r.TryDecodeAsNil() { - x.ConstraintFiltered = nil - } else { - yyv12 := &x.ConstraintFiltered - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - z.F.DecMapStringIntX(yyv12, false, d) - } - } - case "NodesExhausted": - if r.TryDecodeAsNil() { - x.NodesExhausted = 0 - } else { - yyv14 := &x.NodesExhausted - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*int)(yyv14)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "ClassExhausted": - if r.TryDecodeAsNil() { - x.ClassExhausted = nil - } else { - yyv16 := &x.ClassExhausted - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - z.F.DecMapStringIntX(yyv16, false, d) - } - } - case "DimensionExhausted": - if r.TryDecodeAsNil() { - x.DimensionExhausted = nil - } else { - yyv18 := &x.DimensionExhausted - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - z.F.DecMapStringIntX(yyv18, false, d) - } - } - case "Scores": - if r.TryDecodeAsNil() { - x.Scores = nil - } else { - yyv20 := &x.Scores - yym21 := z.DecBinary() - _ = yym21 - if false { - } else { - z.F.DecMapStringFloat64X(yyv20, false, d) - } - } - case "AllocationTime": - if r.TryDecodeAsNil() { - x.AllocationTime = 0 - } else { - yyv22 := &x.AllocationTime - yym23 := z.DecBinary() - _ = yym23 - if false { - } else if z.HasExtensions() && z.DecExt(yyv22) { - } else { - *((*int64)(yyv22)) = int64(r.DecodeInt(64)) - } - } - case "CoalescedFailures": - if r.TryDecodeAsNil() { - x.CoalescedFailures = 0 - } else { - yyv24 := &x.CoalescedFailures - yym25 := z.DecBinary() - _ = yym25 - if false { - } else { - *((*int)(yyv24)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *AllocMetric) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj26 int - var yyb26 bool - var yyhl26 bool = l >= 0 - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodesEvaluated = 0 - } else { - yyv27 := &x.NodesEvaluated - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*int)(yyv27)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodesFiltered = 0 - } else { - yyv29 := &x.NodesFiltered - yym30 := z.DecBinary() - _ = yym30 - if false { - } else { - *((*int)(yyv29)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodesAvailable = nil - } else { - yyv31 := &x.NodesAvailable - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - z.F.DecMapStringIntX(yyv31, false, d) - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ClassFiltered = nil - } else { - yyv33 := &x.ClassFiltered - yym34 := z.DecBinary() - _ = yym34 - if false { - } else { - z.F.DecMapStringIntX(yyv33, false, d) - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ConstraintFiltered = nil - } else { - yyv35 := &x.ConstraintFiltered - yym36 := z.DecBinary() - _ = yym36 - if false { - } else { - z.F.DecMapStringIntX(yyv35, false, d) - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodesExhausted = 0 - } else { - yyv37 := &x.NodesExhausted - yym38 := z.DecBinary() - _ = yym38 - if false { - } else { - *((*int)(yyv37)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ClassExhausted = nil - } else { - yyv39 := &x.ClassExhausted - yym40 := z.DecBinary() - _ = yym40 - if false { - } else { - z.F.DecMapStringIntX(yyv39, false, d) - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DimensionExhausted = nil - } else { - yyv41 := &x.DimensionExhausted - yym42 := z.DecBinary() - _ = yym42 - if false { - } else { - z.F.DecMapStringIntX(yyv41, false, d) - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Scores = nil - } else { - yyv43 := &x.Scores - yym44 := z.DecBinary() - _ = yym44 - if false { - } else { - z.F.DecMapStringFloat64X(yyv43, false, d) - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllocationTime = 0 - } else { - yyv45 := &x.AllocationTime - yym46 := z.DecBinary() - _ = yym46 - if false { - } else if z.HasExtensions() && z.DecExt(yyv45) { - } else { - *((*int64)(yyv45)) = int64(r.DecodeInt(64)) - } - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.CoalescedFailures = 0 - } else { - yyv47 := &x.CoalescedFailures - yym48 := z.DecBinary() - _ = yym48 - if false { - } else { - *((*int)(yyv47)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - for { - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj26-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *AllocDeploymentStatus) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Healthy == nil { - r.EncodeNil() - } else { - yy4 := *x.Healthy - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeBool(bool(yy4)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Healthy")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Healthy == nil { - r.EncodeNil() - } else { - yy6 := *x.Healthy - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeBool(bool(yy6)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym9 := z.EncBinary() - _ = yym9 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *AllocDeploymentStatus) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *AllocDeploymentStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Healthy": - if r.TryDecodeAsNil() { - if x.Healthy != nil { - x.Healthy = nil - } - } else { - if x.Healthy == nil { - x.Healthy = new(bool) - } - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*bool)(x.Healthy)) = r.DecodeBool() - } - } - case "ModifyIndex": - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv6 := &x.ModifyIndex - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *AllocDeploymentStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj8 int - var yyb8 bool - var yyhl8 bool = l >= 0 - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Healthy != nil { - x.Healthy = nil - } - } else { - if x.Healthy == nil { - x.Healthy = new(bool) - } - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*bool)(x.Healthy)) = r.DecodeBool() - } - } - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv11 := &x.ModifyIndex - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*uint64)(yyv11)) = uint64(r.DecodeUint(64)) - } - } - for { - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj8-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *Evaluation) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [23]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(23) - } else { - yynn2 = 23 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.ID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeInt(int64(x.Priority)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Priority")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeInt(int64(x.Priority)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Type)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Type")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Type)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.TriggeredBy)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("TriggeredBy")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.TriggeredBy)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.JobID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeUint(uint64(x.JobModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("JobModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeUint(uint64(x.JobModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodeID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NodeID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym25 := z.EncBinary() - _ = yym25 - if false { - } else { - r.EncodeUint(uint64(x.NodeModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodeModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - r.EncodeUint(uint64(x.NodeModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym28 := z.EncBinary() - _ = yym28 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DeploymentID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DeploymentID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym29 := z.EncBinary() - _ = yym29 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.DeploymentID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym31 := z.EncBinary() - _ = yym31 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Status)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Status")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym32 := z.EncBinary() - _ = yym32 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Status)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym34 := z.EncBinary() - _ = yym34 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.StatusDescription)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("StatusDescription")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym35 := z.EncBinary() - _ = yym35 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.StatusDescription)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym37 := z.EncBinary() - _ = yym37 - if false { - } else if z.HasExtensions() && z.EncExt(x.Wait) { - } else { - r.EncodeInt(int64(x.Wait)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Wait")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym38 := z.EncBinary() - _ = yym38 - if false { - } else if z.HasExtensions() && z.EncExt(x.Wait) { - } else { - r.EncodeInt(int64(x.Wait)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym40 := z.EncBinary() - _ = yym40 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NextEval)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NextEval")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym41 := z.EncBinary() - _ = yym41 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.NextEval)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym43 := z.EncBinary() - _ = yym43 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.PreviousEval)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("PreviousEval")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym44 := z.EncBinary() - _ = yym44 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.PreviousEval)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym46 := z.EncBinary() - _ = yym46 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.BlockedEval)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("BlockedEval")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym47 := z.EncBinary() - _ = yym47 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.BlockedEval)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.FailedTGAllocs == nil { - r.EncodeNil() - } else { - yym49 := z.EncBinary() - _ = yym49 - if false { - } else { - h.encMapstringPtrtoAllocMetric((map[string]*AllocMetric)(x.FailedTGAllocs), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("FailedTGAllocs")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.FailedTGAllocs == nil { - r.EncodeNil() - } else { - yym50 := z.EncBinary() - _ = yym50 - if false { - } else { - h.encMapstringPtrtoAllocMetric((map[string]*AllocMetric)(x.FailedTGAllocs), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.ClassEligibility == nil { - r.EncodeNil() - } else { - yym52 := z.EncBinary() - _ = yym52 - if false { - } else { - z.F.EncMapStringBoolV(x.ClassEligibility, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ClassEligibility")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.ClassEligibility == nil { - r.EncodeNil() - } else { - yym53 := z.EncBinary() - _ = yym53 - if false { - } else { - z.F.EncMapStringBoolV(x.ClassEligibility, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym55 := z.EncBinary() - _ = yym55 - if false { - } else { - r.EncodeBool(bool(x.EscapedComputedClass)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EscapedComputedClass")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym56 := z.EncBinary() - _ = yym56 - if false { - } else { - r.EncodeBool(bool(x.EscapedComputedClass)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym58 := z.EncBinary() - _ = yym58 - if false { - } else { - r.EncodeBool(bool(x.AnnotatePlan)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AnnotatePlan")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym59 := z.EncBinary() - _ = yym59 - if false { - } else { - r.EncodeBool(bool(x.AnnotatePlan)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.QueuedAllocations == nil { - r.EncodeNil() - } else { - yym61 := z.EncBinary() - _ = yym61 - if false { - } else { - z.F.EncMapStringIntV(x.QueuedAllocations, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("QueuedAllocations")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.QueuedAllocations == nil { - r.EncodeNil() - } else { - yym62 := z.EncBinary() - _ = yym62 - if false { - } else { - z.F.EncMapStringIntV(x.QueuedAllocations, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym64 := z.EncBinary() - _ = yym64 - if false { - } else { - r.EncodeUint(uint64(x.SnapshotIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("SnapshotIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym65 := z.EncBinary() - _ = yym65 - if false { - } else { - r.EncodeUint(uint64(x.SnapshotIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym67 := z.EncBinary() - _ = yym67 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("CreateIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym68 := z.EncBinary() - _ = yym68 - if false { - } else { - r.EncodeUint(uint64(x.CreateIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym70 := z.EncBinary() - _ = yym70 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("ModifyIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym71 := z.EncBinary() - _ = yym71 - if false { - } else { - r.EncodeUint(uint64(x.ModifyIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *Evaluation) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *Evaluation) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "ID": - if r.TryDecodeAsNil() { - x.ID = "" - } else { - yyv4 := &x.ID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Priority": - if r.TryDecodeAsNil() { - x.Priority = 0 - } else { - yyv6 := &x.Priority - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*int)(yyv6)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "Type": - if r.TryDecodeAsNil() { - x.Type = "" - } else { - yyv8 := &x.Type - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "TriggeredBy": - if r.TryDecodeAsNil() { - x.TriggeredBy = "" - } else { - yyv10 := &x.TriggeredBy - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - case "JobID": - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv12 := &x.JobID - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - case "JobModifyIndex": - if r.TryDecodeAsNil() { - x.JobModifyIndex = 0 - } else { - yyv14 := &x.JobModifyIndex - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*uint64)(yyv14)) = uint64(r.DecodeUint(64)) - } - } - case "NodeID": - if r.TryDecodeAsNil() { - x.NodeID = "" - } else { - yyv16 := &x.NodeID - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*string)(yyv16)) = r.DecodeString() - } - } - case "NodeModifyIndex": - if r.TryDecodeAsNil() { - x.NodeModifyIndex = 0 - } else { - yyv18 := &x.NodeModifyIndex - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - *((*uint64)(yyv18)) = uint64(r.DecodeUint(64)) - } - } - case "DeploymentID": - if r.TryDecodeAsNil() { - x.DeploymentID = "" - } else { - yyv20 := &x.DeploymentID - yym21 := z.DecBinary() - _ = yym21 - if false { - } else { - *((*string)(yyv20)) = r.DecodeString() - } - } - case "Status": - if r.TryDecodeAsNil() { - x.Status = "" - } else { - yyv22 := &x.Status - yym23 := z.DecBinary() - _ = yym23 - if false { - } else { - *((*string)(yyv22)) = r.DecodeString() - } - } - case "StatusDescription": - if r.TryDecodeAsNil() { - x.StatusDescription = "" - } else { - yyv24 := &x.StatusDescription - yym25 := z.DecBinary() - _ = yym25 - if false { - } else { - *((*string)(yyv24)) = r.DecodeString() - } - } - case "Wait": - if r.TryDecodeAsNil() { - x.Wait = 0 - } else { - yyv26 := &x.Wait - yym27 := z.DecBinary() - _ = yym27 - if false { - } else if z.HasExtensions() && z.DecExt(yyv26) { - } else { - *((*int64)(yyv26)) = int64(r.DecodeInt(64)) - } - } - case "NextEval": - if r.TryDecodeAsNil() { - x.NextEval = "" - } else { - yyv28 := &x.NextEval - yym29 := z.DecBinary() - _ = yym29 - if false { - } else { - *((*string)(yyv28)) = r.DecodeString() - } - } - case "PreviousEval": - if r.TryDecodeAsNil() { - x.PreviousEval = "" - } else { - yyv30 := &x.PreviousEval - yym31 := z.DecBinary() - _ = yym31 - if false { - } else { - *((*string)(yyv30)) = r.DecodeString() - } - } - case "BlockedEval": - if r.TryDecodeAsNil() { - x.BlockedEval = "" - } else { - yyv32 := &x.BlockedEval - yym33 := z.DecBinary() - _ = yym33 - if false { - } else { - *((*string)(yyv32)) = r.DecodeString() - } - } - case "FailedTGAllocs": - if r.TryDecodeAsNil() { - x.FailedTGAllocs = nil - } else { - yyv34 := &x.FailedTGAllocs - yym35 := z.DecBinary() - _ = yym35 - if false { - } else { - h.decMapstringPtrtoAllocMetric((*map[string]*AllocMetric)(yyv34), d) - } - } - case "ClassEligibility": - if r.TryDecodeAsNil() { - x.ClassEligibility = nil - } else { - yyv36 := &x.ClassEligibility - yym37 := z.DecBinary() - _ = yym37 - if false { - } else { - z.F.DecMapStringBoolX(yyv36, false, d) - } - } - case "EscapedComputedClass": - if r.TryDecodeAsNil() { - x.EscapedComputedClass = false - } else { - yyv38 := &x.EscapedComputedClass - yym39 := z.DecBinary() - _ = yym39 - if false { - } else { - *((*bool)(yyv38)) = r.DecodeBool() - } - } - case "AnnotatePlan": - if r.TryDecodeAsNil() { - x.AnnotatePlan = false - } else { - yyv40 := &x.AnnotatePlan - yym41 := z.DecBinary() - _ = yym41 - if false { - } else { - *((*bool)(yyv40)) = r.DecodeBool() - } - } - case "QueuedAllocations": - if r.TryDecodeAsNil() { - x.QueuedAllocations = nil - } else { - yyv42 := &x.QueuedAllocations - yym43 := z.DecBinary() - _ = yym43 - if false { - } else { - z.F.DecMapStringIntX(yyv42, false, d) - } - } - case "SnapshotIndex": - if r.TryDecodeAsNil() { - x.SnapshotIndex = 0 - } else { - yyv44 := &x.SnapshotIndex - yym45 := z.DecBinary() - _ = yym45 - if false { - } else { - *((*uint64)(yyv44)) = uint64(r.DecodeUint(64)) - } - } - case "CreateIndex": - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv46 := &x.CreateIndex - yym47 := z.DecBinary() - _ = yym47 - if false { - } else { - *((*uint64)(yyv46)) = uint64(r.DecodeUint(64)) - } - } - case "ModifyIndex": - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv48 := &x.ModifyIndex - yym49 := z.DecBinary() - _ = yym49 - if false { - } else { - *((*uint64)(yyv48)) = uint64(r.DecodeUint(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *Evaluation) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj50 int - var yyb50 bool - var yyhl50 bool = l >= 0 - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ID = "" - } else { - yyv51 := &x.ID - yym52 := z.DecBinary() - _ = yym52 - if false { - } else { - *((*string)(yyv51)) = r.DecodeString() - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Priority = 0 - } else { - yyv53 := &x.Priority - yym54 := z.DecBinary() - _ = yym54 - if false { - } else { - *((*int)(yyv53)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Type = "" - } else { - yyv55 := &x.Type - yym56 := z.DecBinary() - _ = yym56 - if false { - } else { - *((*string)(yyv55)) = r.DecodeString() - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.TriggeredBy = "" - } else { - yyv57 := &x.TriggeredBy - yym58 := z.DecBinary() - _ = yym58 - if false { - } else { - *((*string)(yyv57)) = r.DecodeString() - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobID = "" - } else { - yyv59 := &x.JobID - yym60 := z.DecBinary() - _ = yym60 - if false { - } else { - *((*string)(yyv59)) = r.DecodeString() - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.JobModifyIndex = 0 - } else { - yyv61 := &x.JobModifyIndex - yym62 := z.DecBinary() - _ = yym62 - if false { - } else { - *((*uint64)(yyv61)) = uint64(r.DecodeUint(64)) - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodeID = "" - } else { - yyv63 := &x.NodeID - yym64 := z.DecBinary() - _ = yym64 - if false { - } else { - *((*string)(yyv63)) = r.DecodeString() - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodeModifyIndex = 0 - } else { - yyv65 := &x.NodeModifyIndex - yym66 := z.DecBinary() - _ = yym66 - if false { - } else { - *((*uint64)(yyv65)) = uint64(r.DecodeUint(64)) - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DeploymentID = "" - } else { - yyv67 := &x.DeploymentID - yym68 := z.DecBinary() - _ = yym68 - if false { - } else { - *((*string)(yyv67)) = r.DecodeString() - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Status = "" - } else { - yyv69 := &x.Status - yym70 := z.DecBinary() - _ = yym70 - if false { - } else { - *((*string)(yyv69)) = r.DecodeString() - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.StatusDescription = "" - } else { - yyv71 := &x.StatusDescription - yym72 := z.DecBinary() - _ = yym72 - if false { - } else { - *((*string)(yyv71)) = r.DecodeString() - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Wait = 0 - } else { - yyv73 := &x.Wait - yym74 := z.DecBinary() - _ = yym74 - if false { - } else if z.HasExtensions() && z.DecExt(yyv73) { - } else { - *((*int64)(yyv73)) = int64(r.DecodeInt(64)) - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NextEval = "" - } else { - yyv75 := &x.NextEval - yym76 := z.DecBinary() - _ = yym76 - if false { - } else { - *((*string)(yyv75)) = r.DecodeString() - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.PreviousEval = "" - } else { - yyv77 := &x.PreviousEval - yym78 := z.DecBinary() - _ = yym78 - if false { - } else { - *((*string)(yyv77)) = r.DecodeString() - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.BlockedEval = "" - } else { - yyv79 := &x.BlockedEval - yym80 := z.DecBinary() - _ = yym80 - if false { - } else { - *((*string)(yyv79)) = r.DecodeString() - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.FailedTGAllocs = nil - } else { - yyv81 := &x.FailedTGAllocs - yym82 := z.DecBinary() - _ = yym82 - if false { - } else { - h.decMapstringPtrtoAllocMetric((*map[string]*AllocMetric)(yyv81), d) - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ClassEligibility = nil - } else { - yyv83 := &x.ClassEligibility - yym84 := z.DecBinary() - _ = yym84 - if false { - } else { - z.F.DecMapStringBoolX(yyv83, false, d) - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EscapedComputedClass = false - } else { - yyv85 := &x.EscapedComputedClass - yym86 := z.DecBinary() - _ = yym86 - if false { - } else { - *((*bool)(yyv85)) = r.DecodeBool() - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AnnotatePlan = false - } else { - yyv87 := &x.AnnotatePlan - yym88 := z.DecBinary() - _ = yym88 - if false { - } else { - *((*bool)(yyv87)) = r.DecodeBool() - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.QueuedAllocations = nil - } else { - yyv89 := &x.QueuedAllocations - yym90 := z.DecBinary() - _ = yym90 - if false { - } else { - z.F.DecMapStringIntX(yyv89, false, d) - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.SnapshotIndex = 0 - } else { - yyv91 := &x.SnapshotIndex - yym92 := z.DecBinary() - _ = yym92 - if false { - } else { - *((*uint64)(yyv91)) = uint64(r.DecodeUint(64)) - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.CreateIndex = 0 - } else { - yyv93 := &x.CreateIndex - yym94 := z.DecBinary() - _ = yym94 - if false { - } else { - *((*uint64)(yyv93)) = uint64(r.DecodeUint(64)) - } - } - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.ModifyIndex = 0 - } else { - yyv95 := &x.ModifyIndex - yym96 := z.DecBinary() - _ = yym96 - if false { - } else { - *((*uint64)(yyv95)) = uint64(r.DecodeUint(64)) - } - } - for { - yyj50++ - if yyhl50 { - yyb50 = yyj50 > l - } else { - yyb50 = r.CheckBreak() - } - if yyb50 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj50-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *Plan) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [10]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(10) - } else { - yynn2 = 10 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EvalID")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalToken)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("EvalToken")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.EvalToken)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeInt(int64(x.Priority)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Priority")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeInt(int64(x.Priority)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.AllAtOnce)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllAtOnce")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.AllAtOnce)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Job == nil { - r.EncodeNil() - } else { - x.Job.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Job")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Job == nil { - r.EncodeNil() - } else { - x.Job.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.NodeUpdate == nil { - r.EncodeNil() - } else { - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - h.encMapstringSlicePtrtoAllocation((map[string][]*Allocation)(x.NodeUpdate), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodeUpdate")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.NodeUpdate == nil { - r.EncodeNil() - } else { - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - h.encMapstringSlicePtrtoAllocation((map[string][]*Allocation)(x.NodeUpdate), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.NodeAllocation == nil { - r.EncodeNil() - } else { - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - h.encMapstringSlicePtrtoAllocation((map[string][]*Allocation)(x.NodeAllocation), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodeAllocation")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.NodeAllocation == nil { - r.EncodeNil() - } else { - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - h.encMapstringSlicePtrtoAllocation((map[string][]*Allocation)(x.NodeAllocation), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Annotations == nil { - r.EncodeNil() - } else { - x.Annotations.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Annotations")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Annotations == nil { - r.EncodeNil() - } else { - x.Annotations.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Deployment == nil { - r.EncodeNil() - } else { - x.Deployment.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Deployment")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Deployment == nil { - r.EncodeNil() - } else { - x.Deployment.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.DeploymentUpdates == nil { - r.EncodeNil() - } else { - yym31 := z.EncBinary() - _ = yym31 - if false { - } else { - h.encSlicePtrtoDeploymentStatusUpdate(([]*DeploymentStatusUpdate)(x.DeploymentUpdates), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DeploymentUpdates")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.DeploymentUpdates == nil { - r.EncodeNil() - } else { - yym32 := z.EncBinary() - _ = yym32 - if false { - } else { - h.encSlicePtrtoDeploymentStatusUpdate(([]*DeploymentStatusUpdate)(x.DeploymentUpdates), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *Plan) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *Plan) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "EvalID": - if r.TryDecodeAsNil() { - x.EvalID = "" - } else { - yyv4 := &x.EvalID - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "EvalToken": - if r.TryDecodeAsNil() { - x.EvalToken = "" - } else { - yyv6 := &x.EvalToken - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "Priority": - if r.TryDecodeAsNil() { - x.Priority = 0 - } else { - yyv8 := &x.Priority - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*int)(yyv8)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - case "AllAtOnce": - if r.TryDecodeAsNil() { - x.AllAtOnce = false - } else { - yyv10 := &x.AllAtOnce - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - case "Job": - if r.TryDecodeAsNil() { - if x.Job != nil { - x.Job = nil - } - } else { - if x.Job == nil { - x.Job = new(Job) - } - x.Job.CodecDecodeSelf(d) - } - case "NodeUpdate": - if r.TryDecodeAsNil() { - x.NodeUpdate = nil - } else { - yyv13 := &x.NodeUpdate - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - h.decMapstringSlicePtrtoAllocation((*map[string][]*Allocation)(yyv13), d) - } - } - case "NodeAllocation": - if r.TryDecodeAsNil() { - x.NodeAllocation = nil - } else { - yyv15 := &x.NodeAllocation - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - h.decMapstringSlicePtrtoAllocation((*map[string][]*Allocation)(yyv15), d) - } - } - case "Annotations": - if r.TryDecodeAsNil() { - if x.Annotations != nil { - x.Annotations = nil - } - } else { - if x.Annotations == nil { - x.Annotations = new(PlanAnnotations) - } - x.Annotations.CodecDecodeSelf(d) - } - case "Deployment": - if r.TryDecodeAsNil() { - if x.Deployment != nil { - x.Deployment = nil - } - } else { - if x.Deployment == nil { - x.Deployment = new(Deployment) - } - x.Deployment.CodecDecodeSelf(d) - } - case "DeploymentUpdates": - if r.TryDecodeAsNil() { - x.DeploymentUpdates = nil - } else { - yyv19 := &x.DeploymentUpdates - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - h.decSlicePtrtoDeploymentStatusUpdate((*[]*DeploymentStatusUpdate)(yyv19), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *Plan) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj21 int - var yyb21 bool - var yyhl21 bool = l >= 0 - yyj21++ - if yyhl21 { - yyb21 = yyj21 > l - } else { - yyb21 = r.CheckBreak() - } - if yyb21 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EvalID = "" - } else { - yyv22 := &x.EvalID - yym23 := z.DecBinary() - _ = yym23 - if false { - } else { - *((*string)(yyv22)) = r.DecodeString() - } - } - yyj21++ - if yyhl21 { - yyb21 = yyj21 > l - } else { - yyb21 = r.CheckBreak() - } - if yyb21 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.EvalToken = "" - } else { - yyv24 := &x.EvalToken - yym25 := z.DecBinary() - _ = yym25 - if false { - } else { - *((*string)(yyv24)) = r.DecodeString() - } - } - yyj21++ - if yyhl21 { - yyb21 = yyj21 > l - } else { - yyb21 = r.CheckBreak() - } - if yyb21 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Priority = 0 - } else { - yyv26 := &x.Priority - yym27 := z.DecBinary() - _ = yym27 - if false { - } else { - *((*int)(yyv26)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - yyj21++ - if yyhl21 { - yyb21 = yyj21 > l - } else { - yyb21 = r.CheckBreak() - } - if yyb21 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllAtOnce = false - } else { - yyv28 := &x.AllAtOnce - yym29 := z.DecBinary() - _ = yym29 - if false { - } else { - *((*bool)(yyv28)) = r.DecodeBool() - } - } - yyj21++ - if yyhl21 { - yyb21 = yyj21 > l - } else { - yyb21 = r.CheckBreak() - } - if yyb21 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Job != nil { - x.Job = nil - } - } else { - if x.Job == nil { - x.Job = new(Job) - } - x.Job.CodecDecodeSelf(d) - } - yyj21++ - if yyhl21 { - yyb21 = yyj21 > l - } else { - yyb21 = r.CheckBreak() - } - if yyb21 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodeUpdate = nil - } else { - yyv31 := &x.NodeUpdate - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - h.decMapstringSlicePtrtoAllocation((*map[string][]*Allocation)(yyv31), d) - } - } - yyj21++ - if yyhl21 { - yyb21 = yyj21 > l - } else { - yyb21 = r.CheckBreak() - } - if yyb21 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodeAllocation = nil - } else { - yyv33 := &x.NodeAllocation - yym34 := z.DecBinary() - _ = yym34 - if false { - } else { - h.decMapstringSlicePtrtoAllocation((*map[string][]*Allocation)(yyv33), d) - } - } - yyj21++ - if yyhl21 { - yyb21 = yyj21 > l - } else { - yyb21 = r.CheckBreak() - } - if yyb21 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Annotations != nil { - x.Annotations = nil - } - } else { - if x.Annotations == nil { - x.Annotations = new(PlanAnnotations) - } - x.Annotations.CodecDecodeSelf(d) - } - yyj21++ - if yyhl21 { - yyb21 = yyj21 > l - } else { - yyb21 = r.CheckBreak() - } - if yyb21 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Deployment != nil { - x.Deployment = nil - } - } else { - if x.Deployment == nil { - x.Deployment = new(Deployment) - } - x.Deployment.CodecDecodeSelf(d) - } - yyj21++ - if yyhl21 { - yyb21 = yyj21 > l - } else { - yyb21 = r.CheckBreak() - } - if yyb21 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DeploymentUpdates = nil - } else { - yyv37 := &x.DeploymentUpdates - yym38 := z.DecBinary() - _ = yym38 - if false { - } else { - h.decSlicePtrtoDeploymentStatusUpdate((*[]*DeploymentStatusUpdate)(yyv37), d) - } - } - for { - yyj21++ - if yyhl21 { - yyb21 = yyj21 > l - } else { - yyb21 = r.CheckBreak() - } - if yyb21 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj21-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *PlanResult) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [6]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(6) - } else { - yynn2 = 6 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.NodeUpdate == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encMapstringSlicePtrtoAllocation((map[string][]*Allocation)(x.NodeUpdate), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodeUpdate")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.NodeUpdate == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encMapstringSlicePtrtoAllocation((map[string][]*Allocation)(x.NodeUpdate), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.NodeAllocation == nil { - r.EncodeNil() - } else { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - h.encMapstringSlicePtrtoAllocation((map[string][]*Allocation)(x.NodeAllocation), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NodeAllocation")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.NodeAllocation == nil { - r.EncodeNil() - } else { - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - h.encMapstringSlicePtrtoAllocation((map[string][]*Allocation)(x.NodeAllocation), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Deployment == nil { - r.EncodeNil() - } else { - x.Deployment.CodecEncodeSelf(e) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Deployment")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Deployment == nil { - r.EncodeNil() - } else { - x.Deployment.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.DeploymentUpdates == nil { - r.EncodeNil() - } else { - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - h.encSlicePtrtoDeploymentStatusUpdate(([]*DeploymentStatusUpdate)(x.DeploymentUpdates), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DeploymentUpdates")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.DeploymentUpdates == nil { - r.EncodeNil() - } else { - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - h.encSlicePtrtoDeploymentStatusUpdate(([]*DeploymentStatusUpdate)(x.DeploymentUpdates), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeUint(uint64(x.RefreshIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("RefreshIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeUint(uint64(x.RefreshIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeUint(uint64(x.AllocIndex)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("AllocIndex")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeUint(uint64(x.AllocIndex)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *PlanResult) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *PlanResult) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "NodeUpdate": - if r.TryDecodeAsNil() { - x.NodeUpdate = nil - } else { - yyv4 := &x.NodeUpdate - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decMapstringSlicePtrtoAllocation((*map[string][]*Allocation)(yyv4), d) - } - } - case "NodeAllocation": - if r.TryDecodeAsNil() { - x.NodeAllocation = nil - } else { - yyv6 := &x.NodeAllocation - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - h.decMapstringSlicePtrtoAllocation((*map[string][]*Allocation)(yyv6), d) - } - } - case "Deployment": - if r.TryDecodeAsNil() { - if x.Deployment != nil { - x.Deployment = nil - } - } else { - if x.Deployment == nil { - x.Deployment = new(Deployment) - } - x.Deployment.CodecDecodeSelf(d) - } - case "DeploymentUpdates": - if r.TryDecodeAsNil() { - x.DeploymentUpdates = nil - } else { - yyv9 := &x.DeploymentUpdates - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - h.decSlicePtrtoDeploymentStatusUpdate((*[]*DeploymentStatusUpdate)(yyv9), d) - } - } - case "RefreshIndex": - if r.TryDecodeAsNil() { - x.RefreshIndex = 0 - } else { - yyv11 := &x.RefreshIndex - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*uint64)(yyv11)) = uint64(r.DecodeUint(64)) - } - } - case "AllocIndex": - if r.TryDecodeAsNil() { - x.AllocIndex = 0 - } else { - yyv13 := &x.AllocIndex - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*uint64)(yyv13)) = uint64(r.DecodeUint(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *PlanResult) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj15 int - var yyb15 bool - var yyhl15 bool = l >= 0 - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodeUpdate = nil - } else { - yyv16 := &x.NodeUpdate - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - h.decMapstringSlicePtrtoAllocation((*map[string][]*Allocation)(yyv16), d) - } - } - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NodeAllocation = nil - } else { - yyv18 := &x.NodeAllocation - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - h.decMapstringSlicePtrtoAllocation((*map[string][]*Allocation)(yyv18), d) - } - } - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - if x.Deployment != nil { - x.Deployment = nil - } - } else { - if x.Deployment == nil { - x.Deployment = new(Deployment) - } - x.Deployment.CodecDecodeSelf(d) - } - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DeploymentUpdates = nil - } else { - yyv21 := &x.DeploymentUpdates - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - h.decSlicePtrtoDeploymentStatusUpdate((*[]*DeploymentStatusUpdate)(yyv21), d) - } - } - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.RefreshIndex = 0 - } else { - yyv23 := &x.RefreshIndex - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*uint64)(yyv23)) = uint64(r.DecodeUint(64)) - } - } - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.AllocIndex = 0 - } else { - yyv25 := &x.AllocIndex - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*uint64)(yyv25)) = uint64(r.DecodeUint(64)) - } - } - for { - yyj15++ - if yyhl15 { - yyb15 = yyj15 > l - } else { - yyb15 = r.CheckBreak() - } - if yyb15 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj15-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *PlanAnnotations) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [1]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(1) - } else { - yynn2 = 1 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.DesiredTGUpdates == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encMapstringPtrtoDesiredUpdates((map[string]*DesiredUpdates)(x.DesiredTGUpdates), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DesiredTGUpdates")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.DesiredTGUpdates == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encMapstringPtrtoDesiredUpdates((map[string]*DesiredUpdates)(x.DesiredTGUpdates), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *PlanAnnotations) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *PlanAnnotations) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "DesiredTGUpdates": - if r.TryDecodeAsNil() { - x.DesiredTGUpdates = nil - } else { - yyv4 := &x.DesiredTGUpdates - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decMapstringPtrtoDesiredUpdates((*map[string]*DesiredUpdates)(yyv4), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *PlanAnnotations) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj6 int - var yyb6 bool - var yyhl6 bool = l >= 0 - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DesiredTGUpdates = nil - } else { - yyv7 := &x.DesiredTGUpdates - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - h.decMapstringPtrtoDesiredUpdates((*map[string]*DesiredUpdates)(yyv7), d) - } - } - for { - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj6-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *DesiredUpdates) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [7]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(7) - } else { - yynn2 = 7 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeUint(uint64(x.Ignore)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Ignore")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeUint(uint64(x.Ignore)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.Place)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Place")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.Place)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.Migrate)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Migrate")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.Migrate)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeUint(uint64(x.Stop)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Stop")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeUint(uint64(x.Stop)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeUint(uint64(x.InPlaceUpdate)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("InPlaceUpdate")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeUint(uint64(x.InPlaceUpdate)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeUint(uint64(x.DestructiveUpdate)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("DestructiveUpdate")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeUint(uint64(x.DestructiveUpdate)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeUint(uint64(x.Canary)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Canary")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeUint(uint64(x.Canary)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *DesiredUpdates) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *DesiredUpdates) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Ignore": - if r.TryDecodeAsNil() { - x.Ignore = 0 - } else { - yyv4 := &x.Ignore - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*uint64)(yyv4)) = uint64(r.DecodeUint(64)) - } - } - case "Place": - if r.TryDecodeAsNil() { - x.Place = 0 - } else { - yyv6 := &x.Place - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "Migrate": - if r.TryDecodeAsNil() { - x.Migrate = 0 - } else { - yyv8 := &x.Migrate - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint64)(yyv8)) = uint64(r.DecodeUint(64)) - } - } - case "Stop": - if r.TryDecodeAsNil() { - x.Stop = 0 - } else { - yyv10 := &x.Stop - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*uint64)(yyv10)) = uint64(r.DecodeUint(64)) - } - } - case "InPlaceUpdate": - if r.TryDecodeAsNil() { - x.InPlaceUpdate = 0 - } else { - yyv12 := &x.InPlaceUpdate - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*uint64)(yyv12)) = uint64(r.DecodeUint(64)) - } - } - case "DestructiveUpdate": - if r.TryDecodeAsNil() { - x.DestructiveUpdate = 0 - } else { - yyv14 := &x.DestructiveUpdate - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*uint64)(yyv14)) = uint64(r.DecodeUint(64)) - } - } - case "Canary": - if r.TryDecodeAsNil() { - x.Canary = 0 - } else { - yyv16 := &x.Canary - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*uint64)(yyv16)) = uint64(r.DecodeUint(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *DesiredUpdates) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj18 int - var yyb18 bool - var yyhl18 bool = l >= 0 - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Ignore = 0 - } else { - yyv19 := &x.Ignore - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*uint64)(yyv19)) = uint64(r.DecodeUint(64)) - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Place = 0 - } else { - yyv21 := &x.Place - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*uint64)(yyv21)) = uint64(r.DecodeUint(64)) - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Migrate = 0 - } else { - yyv23 := &x.Migrate - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*uint64)(yyv23)) = uint64(r.DecodeUint(64)) - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Stop = 0 - } else { - yyv25 := &x.Stop - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*uint64)(yyv25)) = uint64(r.DecodeUint(64)) - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.InPlaceUpdate = 0 - } else { - yyv27 := &x.InPlaceUpdate - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*uint64)(yyv27)) = uint64(r.DecodeUint(64)) - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.DestructiveUpdate = 0 - } else { - yyv29 := &x.DestructiveUpdate - yym30 := z.DecBinary() - _ = yym30 - if false { - } else { - *((*uint64)(yyv29)) = uint64(r.DecodeUint(64)) - } - } - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Canary = 0 - } else { - yyv31 := &x.Canary - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - *((*uint64)(yyv31)) = uint64(r.DecodeUint(64)) - } - } - for { - yyj18++ - if yyhl18 { - yyb18 = yyj18 > l - } else { - yyb18 = r.CheckBreak() - } - if yyb18 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj18-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *KeyringResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Messages == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - z.F.EncMapStringStringV(x.Messages, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Messages")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Messages == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - z.F.EncMapStringStringV(x.Messages, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if x.Keys == nil { - r.EncodeNil() - } else { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - z.F.EncMapStringIntV(x.Keys, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Keys")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if x.Keys == nil { - r.EncodeNil() - } else { - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - z.F.EncMapStringIntV(x.Keys, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeInt(int64(x.NumNodes)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("NumNodes")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeInt(int64(x.NumNodes)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *KeyringResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *KeyringResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Messages": - if r.TryDecodeAsNil() { - x.Messages = nil - } else { - yyv4 := &x.Messages - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - z.F.DecMapStringStringX(yyv4, false, d) - } - } - case "Keys": - if r.TryDecodeAsNil() { - x.Keys = nil - } else { - yyv6 := &x.Keys - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - z.F.DecMapStringIntX(yyv6, false, d) - } - } - case "NumNodes": - if r.TryDecodeAsNil() { - x.NumNodes = 0 - } else { - yyv8 := &x.NumNodes - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*int)(yyv8)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *KeyringResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Messages = nil - } else { - yyv11 := &x.Messages - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - z.F.DecMapStringStringX(yyv11, false, d) - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Keys = nil - } else { - yyv13 := &x.Keys - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - z.F.DecMapStringIntX(yyv13, false, d) - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.NumNodes = 0 - } else { - yyv15 := &x.NumNodes - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*int)(yyv15)) = int(r.DecodeInt(codecSelferBitsize5247)) - } - } - for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj10-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *KeyringRequest) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [1]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(1) - } else { - yynn2 = 1 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Key)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Key")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Key)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *KeyringRequest) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *KeyringRequest) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Key": - if r.TryDecodeAsNil() { - x.Key = "" - } else { - yyv4 := &x.Key - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *KeyringRequest) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj6 int - var yyb6 bool - var yyhl6 bool = l >= 0 - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Key = "" - } else { - yyv7 := &x.Key - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - *((*string)(yyv7)) = r.DecodeString() - } - } - for { - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj6-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x *RecoverableError) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Err)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Err")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(x.Err)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeBool(bool(x.Recoverable)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - r.EncodeString(codecSelferC_UTF85247, string("Recoverable")) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeBool(bool(x.Recoverable)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd5247) - } - } - } -} - -func (x *RecoverableError) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap5247 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd5247) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray5247 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr5247) - } - } -} - -func (x *RecoverableError) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey5247) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3 := string(yys3Slc) - z.DecSendContainerState(codecSelfer_containerMapValue5247) - switch yys3 { - case "Err": - if r.TryDecodeAsNil() { - x.Err = "" - } else { - yyv4 := &x.Err - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Recoverable": - if r.TryDecodeAsNil() { - x.Recoverable = false - } else { - yyv6 := &x.Recoverable - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*bool)(yyv6)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x *RecoverableError) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj8 int - var yyb8 bool - var yyhl8 bool = l >= 0 - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Err = "" - } else { - yyv9 := &x.Err - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*string)(yyv9)) = r.DecodeString() - } - } - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - if r.TryDecodeAsNil() { - x.Recoverable = false - } else { - yyv11 := &x.Recoverable - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*bool)(yyv11)) = r.DecodeBool() - } - } - for { - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem5247) - z.DecStructFieldNotFound(yyj8-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) encMapContextSlicestring(v map[Context][]string, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeMapStart(len(v)) - for yyk1, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - yyk1.CodecEncodeSelf(e) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yym3 := z.EncBinary() - _ = yym3 - if false { - } else { - z.F.EncSliceStringV(yyv1, false, e) - } - } - } - z.EncSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x codecSelfer5247) decMapContextSlicestring(v *map[Context][]string, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyl1 := r.ReadMapStart() - yybh1 := z.DecBasicHandle() - if yyv1 == nil { - yyrl1, _ := z.DecInferLen(yyl1, yybh1.MaxInitLen, 40) - yyv1 = make(map[Context][]string, yyrl1) - *v = yyv1 - } - var yymk1 Context - var yymv1 []string - var yymg1 bool - if yybh1.MapValueReset { - yymg1 = true - } - if yyl1 > 0 { - for yyj1 := 0; yyj1 < yyl1; yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey5247) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv2 := &yymk1 - yyv2.CodecDecodeSelf(d) - } - - if yymg1 { - yymv1 = yyv1[yymk1] - } else { - yymv1 = nil - } - z.DecSendContainerState(codecSelfer_containerMapValue5247) - if r.TryDecodeAsNil() { - yymv1 = nil - } else { - yyv3 := &yymv1 - yym4 := z.DecBinary() - _ = yym4 - if false { - } else { - z.F.DecSliceStringX(yyv3, false, d) - } - } - - if yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } else if yyl1 < 0 { - for yyj1 := 0; !r.CheckBreak(); yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey5247) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv5 := &yymk1 - yyv5.CodecDecodeSelf(d) - } - - if yymg1 { - yymv1 = yyv1[yymk1] - } else { - yymv1 = nil - } - z.DecSendContainerState(codecSelfer_containerMapValue5247) - if r.TryDecodeAsNil() { - yymv1 = nil - } else { - yyv6 := &yymv1 - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - z.F.DecSliceStringX(yyv6, false, d) - } - } - - if yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } // else len==0: TODO: Should we clear map entries? - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x codecSelfer5247) encSlicestring(v []string, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yym2 := z.EncBinary() - _ = yym2 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(yyv1)) - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicestring(v *[]string, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []string{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 16) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]string, yyrl1) - } - } else { - yyv1 = make([]string, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - yyv1[yyj1] = "" - } else { - yyv2 := &yyv1[yyj1] - yym3 := z.DecBinary() - _ = yym3 - if false { - } else { - *((*string)(yyv2)) = r.DecodeString() - } - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, "") - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - yyv1[yyj1] = "" - } else { - yyv4 := &yyv1[yyj1] - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, "") // var yyz1 string - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - yyv1[yyj1] = "" - } else { - yyv6 := &yyv1[yyj1] - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []string{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encMapContextbool(v map[Context]bool, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeMapStart(len(v)) - for yyk1, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - yyk1.CodecEncodeSelf(e) - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yym3 := z.EncBinary() - _ = yym3 - if false { - } else { - r.EncodeBool(bool(yyv1)) - } - } - z.EncSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x codecSelfer5247) decMapContextbool(v *map[Context]bool, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyl1 := r.ReadMapStart() - yybh1 := z.DecBasicHandle() - if yyv1 == nil { - yyrl1, _ := z.DecInferLen(yyl1, yybh1.MaxInitLen, 17) - yyv1 = make(map[Context]bool, yyrl1) - *v = yyv1 - } - var yymk1 Context - var yymv1 bool - var yymg1 bool - if yybh1.MapValueReset { - } - if yyl1 > 0 { - for yyj1 := 0; yyj1 < yyl1; yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey5247) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv2 := &yymk1 - yyv2.CodecDecodeSelf(d) - } - - if yymg1 { - yymv1 = yyv1[yymk1] - } - z.DecSendContainerState(codecSelfer_containerMapValue5247) - if r.TryDecodeAsNil() { - yymv1 = false - } else { - yyv3 := &yymv1 - yym4 := z.DecBinary() - _ = yym4 - if false { - } else { - *((*bool)(yyv3)) = r.DecodeBool() - } - } - - if yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } else if yyl1 < 0 { - for yyj1 := 0; !r.CheckBreak(); yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey5247) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv5 := &yymk1 - yyv5.CodecDecodeSelf(d) - } - - if yymg1 { - yymv1 = yyv1[yymk1] - } - z.DecSendContainerState(codecSelfer_containerMapValue5247) - if r.TryDecodeAsNil() { - yymv1 = false - } else { - yyv6 := &yymv1 - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*bool)(yyv6)) = r.DecodeBool() - } - } - - if yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } // else len==0: TODO: Should we clear map entries? - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x codecSelfer5247) encSlicePtrtoEvaluation(v []*Evaluation, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicePtrtoEvaluation(v *[]*Evaluation, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*Evaluation{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*Evaluation, yyrl1) - } - } else { - yyv1 = make([]*Evaluation, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Evaluation{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Evaluation) - } - yyw2 := yyv1[yyj1] - yyw2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Evaluation{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Evaluation) - } - yyw3 := yyv1[yyj1] - yyw3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *Evaluation - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Evaluation{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Evaluation) - } - yyw4 := yyv1[yyj1] - yyw4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*Evaluation{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encSlicePtrtoAllocation(v []*Allocation, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicePtrtoAllocation(v *[]*Allocation, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*Allocation{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*Allocation, yyrl1) - } - } else { - yyv1 = make([]*Allocation, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Allocation{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Allocation) - } - yyw2 := yyv1[yyj1] - yyw2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Allocation{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Allocation) - } - yyw3 := yyv1[yyj1] - yyw3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *Allocation - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Allocation{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Allocation) - } - yyw4 := yyv1[yyj1] - yyw4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*Allocation{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encSlicePtrtoDeploymentStatusUpdate(v []*DeploymentStatusUpdate, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicePtrtoDeploymentStatusUpdate(v *[]*DeploymentStatusUpdate, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*DeploymentStatusUpdate{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*DeploymentStatusUpdate, yyrl1) - } - } else { - yyv1 = make([]*DeploymentStatusUpdate, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = DeploymentStatusUpdate{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(DeploymentStatusUpdate) - } - yyw2 := yyv1[yyj1] - yyw2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = DeploymentStatusUpdate{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(DeploymentStatusUpdate) - } - yyw3 := yyv1[yyj1] - yyw3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *DeploymentStatusUpdate - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = DeploymentStatusUpdate{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(DeploymentStatusUpdate) - } - yyw4 := yyv1[yyj1] - yyw4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*DeploymentStatusUpdate{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encSlicePtrtoServerMember(v []*ServerMember, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicePtrtoServerMember(v *[]*ServerMember, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*ServerMember{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*ServerMember, yyrl1) - } - } else { - yyv1 = make([]*ServerMember, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = ServerMember{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(ServerMember) - } - yyw2 := yyv1[yyj1] - yyw2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = ServerMember{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(ServerMember) - } - yyw3 := yyv1[yyj1] - yyw3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *ServerMember - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = ServerMember{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(ServerMember) - } - yyw4 := yyv1[yyj1] - yyw4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*ServerMember{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encnet_IP(v net.IP, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeStringBytes(codecSelferC_RAW5247, []byte(v)) -} - -func (x codecSelfer5247) decnet_IP(v *net.IP, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - *v = r.DecodeBytes(*((*[]byte)(v)), false, false) -} - -func (x codecSelfer5247) encSlicePtrtoVaultAccessor(v []*VaultAccessor, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicePtrtoVaultAccessor(v *[]*VaultAccessor, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*VaultAccessor{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*VaultAccessor, yyrl1) - } - } else { - yyv1 = make([]*VaultAccessor, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = VaultAccessor{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(VaultAccessor) - } - yyw2 := yyv1[yyj1] - yyw2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = VaultAccessor{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(VaultAccessor) - } - yyw3 := yyv1[yyj1] - yyw3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *VaultAccessor - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = VaultAccessor{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(VaultAccessor) - } - yyw4 := yyv1[yyj1] - yyw4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*VaultAccessor{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encSlicePtrtoNodeServerInfo(v []*NodeServerInfo, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicePtrtoNodeServerInfo(v *[]*NodeServerInfo, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*NodeServerInfo{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*NodeServerInfo, yyrl1) - } - } else { - yyv1 = make([]*NodeServerInfo, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = NodeServerInfo{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(NodeServerInfo) - } - yyw2 := yyv1[yyj1] - yyw2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = NodeServerInfo{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(NodeServerInfo) - } - yyw3 := yyv1[yyj1] - yyw3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *NodeServerInfo - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = NodeServerInfo{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(NodeServerInfo) - } - yyw4 := yyv1[yyj1] - yyw4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*NodeServerInfo{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encSlicePtrtoNodeListStub(v []*NodeListStub, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicePtrtoNodeListStub(v *[]*NodeListStub, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*NodeListStub{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*NodeListStub, yyrl1) - } - } else { - yyv1 = make([]*NodeListStub, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = NodeListStub{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(NodeListStub) - } - yyw2 := yyv1[yyj1] - yyw2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = NodeListStub{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(NodeListStub) - } - yyw3 := yyv1[yyj1] - yyw3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *NodeListStub - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = NodeListStub{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(NodeListStub) - } - yyw4 := yyv1[yyj1] - yyw4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*NodeListStub{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encSlicePtrtoJobListStub(v []*JobListStub, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicePtrtoJobListStub(v *[]*JobListStub, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*JobListStub{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*JobListStub, yyrl1) - } - } else { - yyv1 = make([]*JobListStub, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = JobListStub{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(JobListStub) - } - yyw2 := yyv1[yyj1] - yyw2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = JobListStub{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(JobListStub) - } - yyw3 := yyv1[yyj1] - yyw3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *JobListStub - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = JobListStub{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(JobListStub) - } - yyw4 := yyv1[yyj1] - yyw4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*JobListStub{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encSlicePtrtoJob(v []*Job, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicePtrtoJob(v *[]*Job, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*Job{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*Job, yyrl1) - } - } else { - yyv1 = make([]*Job, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Job{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Job) - } - yyw2 := yyv1[yyj1] - yyw2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Job{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Job) - } - yyw3 := yyv1[yyj1] - yyw3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *Job - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Job{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Job) - } - yyw4 := yyv1[yyj1] - yyw4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*Job{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encSlicePtrtoJobDiff(v []*JobDiff, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yym2 := z.EncBinary() - _ = yym2 - if false { - } else if z.HasExtensions() && z.EncExt(yyv1) { - } else { - z.EncFallback(yyv1) - } - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicePtrtoJobDiff(v *[]*JobDiff, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*JobDiff{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*JobDiff, yyrl1) - } - } else { - yyv1 = make([]*JobDiff, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = JobDiff{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(JobDiff) - } - yyw2 := yyv1[yyj1] - yym3 := z.DecBinary() - _ = yym3 - if false { - } else if z.HasExtensions() && z.DecExt(yyw2) { - } else { - z.DecFallback(yyw2, false) - } - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = JobDiff{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(JobDiff) - } - yyw4 := yyv1[yyj1] - yym5 := z.DecBinary() - _ = yym5 - if false { - } else if z.HasExtensions() && z.DecExt(yyw4) { - } else { - z.DecFallback(yyw4, false) - } - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *JobDiff - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = JobDiff{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(JobDiff) - } - yyw6 := yyv1[yyj1] - yym7 := z.DecBinary() - _ = yym7 - if false { - } else if z.HasExtensions() && z.DecExt(yyw6) { - } else { - z.DecFallback(yyw6, false) - } - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*JobDiff{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encMapstringPtrtoAllocMetric(v map[string]*AllocMetric, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeMapStart(len(v)) - for yyk1, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - yym2 := z.EncBinary() - _ = yym2 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(yyk1)) - } - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x codecSelfer5247) decMapstringPtrtoAllocMetric(v *map[string]*AllocMetric, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyl1 := r.ReadMapStart() - yybh1 := z.DecBasicHandle() - if yyv1 == nil { - yyrl1, _ := z.DecInferLen(yyl1, yybh1.MaxInitLen, 24) - yyv1 = make(map[string]*AllocMetric, yyrl1) - *v = yyv1 - } - var yymk1 string - var yymv1 *AllocMetric - var yymg1, yyms1, yymok1 bool - if yybh1.MapValueReset { - yymg1 = true - } - if yyl1 > 0 { - for yyj1 := 0; yyj1 < yyl1; yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey5247) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv2 := &yymk1 - yym3 := z.DecBinary() - _ = yym3 - if false { - } else { - *((*string)(yyv2)) = r.DecodeString() - } - } - - yyms1 = true - if yymg1 { - yymv1, yymok1 = yyv1[yymk1] - if yymok1 { - yyms1 = false - } - } else { - yymv1 = nil - } - z.DecSendContainerState(codecSelfer_containerMapValue5247) - if r.TryDecodeAsNil() { - if yymv1 != nil { - *yymv1 = AllocMetric{} - } - } else { - if yymv1 == nil { - yymv1 = new(AllocMetric) - } - yymv1.CodecDecodeSelf(d) - } - - if yyms1 && yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } else if yyl1 < 0 { - for yyj1 := 0; !r.CheckBreak(); yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey5247) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv5 := &yymk1 - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - *((*string)(yyv5)) = r.DecodeString() - } - } - - yyms1 = true - if yymg1 { - yymv1, yymok1 = yyv1[yymk1] - if yymok1 { - yyms1 = false - } - } else { - yymv1 = nil - } - z.DecSendContainerState(codecSelfer_containerMapValue5247) - if r.TryDecodeAsNil() { - if yymv1 != nil { - *yymv1 = AllocMetric{} - } - } else { - if yymv1 == nil { - yymv1 = new(AllocMetric) - } - yymv1.CodecDecodeSelf(d) - } - - if yyms1 && yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } // else len==0: TODO: Should we clear map entries? - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x codecSelfer5247) encSlicePtrtoAllocListStub(v []*AllocListStub, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicePtrtoAllocListStub(v *[]*AllocListStub, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*AllocListStub{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*AllocListStub, yyrl1) - } - } else { - yyv1 = make([]*AllocListStub, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = AllocListStub{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(AllocListStub) - } - yyw2 := yyv1[yyj1] - yyw2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = AllocListStub{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(AllocListStub) - } - yyw3 := yyv1[yyj1] - yyw3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *AllocListStub - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = AllocListStub{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(AllocListStub) - } - yyw4 := yyv1[yyj1] - yyw4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*AllocListStub{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encSlicePtrtoDeployment(v []*Deployment, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicePtrtoDeployment(v *[]*Deployment, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*Deployment{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*Deployment, yyrl1) - } - } else { - yyv1 = make([]*Deployment, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Deployment{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Deployment) - } - yyw2 := yyv1[yyj1] - yyw2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Deployment{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Deployment) - } - yyw3 := yyv1[yyj1] - yyw3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *Deployment - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Deployment{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Deployment) - } - yyw4 := yyv1[yyj1] - yyw4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*Deployment{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encNetworks(v Networks, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decNetworks(v *Networks, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*NetworkResource{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*NetworkResource, yyrl1) - } - } else { - yyv1 = make([]*NetworkResource, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = NetworkResource{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(NetworkResource) - } - yyw2 := yyv1[yyj1] - yyw2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = NetworkResource{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(NetworkResource) - } - yyw3 := yyv1[yyj1] - yyw3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *NetworkResource - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = NetworkResource{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(NetworkResource) - } - yyw4 := yyv1[yyj1] - yyw4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*NetworkResource{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encSlicePort(v []Port, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - yy2 := &yyv1 - yy2.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicePort(v *[]Port, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []Port{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 24) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]Port, yyrl1) - } - } else { - yyv1 = make([]Port, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - yyv1[yyj1] = Port{} - } else { - yyv2 := &yyv1[yyj1] - yyv2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, Port{}) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - yyv1[yyj1] = Port{} - } else { - yyv3 := &yyv1[yyj1] - yyv3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, Port{}) // var yyz1 Port - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - yyv1[yyj1] = Port{} - } else { - yyv4 := &yyv1[yyj1] - yyv4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []Port{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encSlicePtrtoConstraint(v []*Constraint, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicePtrtoConstraint(v *[]*Constraint, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*Constraint{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*Constraint, yyrl1) - } - } else { - yyv1 = make([]*Constraint, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Constraint{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Constraint) - } - yyw2 := yyv1[yyj1] - yyw2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Constraint{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Constraint) - } - yyw3 := yyv1[yyj1] - yyw3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *Constraint - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Constraint{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Constraint) - } - yyw4 := yyv1[yyj1] - yyw4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*Constraint{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encSlicePtrtoTaskGroup(v []*TaskGroup, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicePtrtoTaskGroup(v *[]*TaskGroup, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*TaskGroup{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*TaskGroup, yyrl1) - } - } else { - yyv1 = make([]*TaskGroup, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = TaskGroup{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(TaskGroup) - } - yyw2 := yyv1[yyj1] - yyw2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = TaskGroup{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(TaskGroup) - } - yyw3 := yyv1[yyj1] - yyw3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *TaskGroup - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = TaskGroup{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(TaskGroup) - } - yyw4 := yyv1[yyj1] - yyw4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*TaskGroup{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encMapstringTaskGroupSummary(v map[string]TaskGroupSummary, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeMapStart(len(v)) - for yyk1, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - yym2 := z.EncBinary() - _ = yym2 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(yyk1)) - } - z.EncSendContainerState(codecSelfer_containerMapValue5247) - yy3 := &yyv1 - yy3.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x codecSelfer5247) decMapstringTaskGroupSummary(v *map[string]TaskGroupSummary, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyl1 := r.ReadMapStart() - yybh1 := z.DecBasicHandle() - if yyv1 == nil { - yyrl1, _ := z.DecInferLen(yyl1, yybh1.MaxInitLen, 64) - yyv1 = make(map[string]TaskGroupSummary, yyrl1) - *v = yyv1 - } - var yymk1 string - var yymv1 TaskGroupSummary - var yymg1 bool - if yybh1.MapValueReset { - yymg1 = true - } - if yyl1 > 0 { - for yyj1 := 0; yyj1 < yyl1; yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey5247) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv2 := &yymk1 - yym3 := z.DecBinary() - _ = yym3 - if false { - } else { - *((*string)(yyv2)) = r.DecodeString() - } - } - - if yymg1 { - yymv1 = yyv1[yymk1] - } else { - yymv1 = TaskGroupSummary{} - } - z.DecSendContainerState(codecSelfer_containerMapValue5247) - if r.TryDecodeAsNil() { - yymv1 = TaskGroupSummary{} - } else { - yyv4 := &yymv1 - yyv4.CodecDecodeSelf(d) - } - - if yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } else if yyl1 < 0 { - for yyj1 := 0; !r.CheckBreak(); yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey5247) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv5 := &yymk1 - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - *((*string)(yyv5)) = r.DecodeString() - } - } - - if yymg1 { - yymv1 = yyv1[yymk1] - } else { - yymv1 = TaskGroupSummary{} - } - z.DecSendContainerState(codecSelfer_containerMapValue5247) - if r.TryDecodeAsNil() { - yymv1 = TaskGroupSummary{} - } else { - yyv7 := &yymv1 - yyv7.CodecDecodeSelf(d) - } - - if yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } // else len==0: TODO: Should we clear map entries? - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x codecSelfer5247) encSlicePtrtoTask(v []*Task, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicePtrtoTask(v *[]*Task, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*Task{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*Task, yyrl1) - } - } else { - yyv1 = make([]*Task, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Task{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Task) - } - yyw2 := yyv1[yyj1] - yyw2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Task{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Task) - } - yyw3 := yyv1[yyj1] - yyw3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *Task - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Task{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Task) - } - yyw4 := yyv1[yyj1] - yyw4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*Task{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encMapstringSlicestring(v map[string][]string, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeMapStart(len(v)) - for yyk1, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - yym2 := z.EncBinary() - _ = yym2 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(yyk1)) - } - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yym3 := z.EncBinary() - _ = yym3 - if false { - } else { - z.F.EncSliceStringV(yyv1, false, e) - } - } - } - z.EncSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x codecSelfer5247) decMapstringSlicestring(v *map[string][]string, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyl1 := r.ReadMapStart() - yybh1 := z.DecBasicHandle() - if yyv1 == nil { - yyrl1, _ := z.DecInferLen(yyl1, yybh1.MaxInitLen, 40) - yyv1 = make(map[string][]string, yyrl1) - *v = yyv1 - } - var yymk1 string - var yymv1 []string - var yymg1 bool - if yybh1.MapValueReset { - yymg1 = true - } - if yyl1 > 0 { - for yyj1 := 0; yyj1 < yyl1; yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey5247) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv2 := &yymk1 - yym3 := z.DecBinary() - _ = yym3 - if false { - } else { - *((*string)(yyv2)) = r.DecodeString() - } - } - - if yymg1 { - yymv1 = yyv1[yymk1] - } else { - yymv1 = nil - } - z.DecSendContainerState(codecSelfer_containerMapValue5247) - if r.TryDecodeAsNil() { - yymv1 = nil - } else { - yyv4 := &yymv1 - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - z.F.DecSliceStringX(yyv4, false, d) - } - } - - if yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } else if yyl1 < 0 { - for yyj1 := 0; !r.CheckBreak(); yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey5247) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv6 := &yymk1 - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - - if yymg1 { - yymv1 = yyv1[yymk1] - } else { - yymv1 = nil - } - z.DecSendContainerState(codecSelfer_containerMapValue5247) - if r.TryDecodeAsNil() { - yymv1 = nil - } else { - yyv8 := &yymv1 - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - z.F.DecSliceStringX(yyv8, false, d) - } - } - - if yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } // else len==0: TODO: Should we clear map entries? - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x codecSelfer5247) encSlicePtrtoServiceCheck(v []*ServiceCheck, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicePtrtoServiceCheck(v *[]*ServiceCheck, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*ServiceCheck{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*ServiceCheck, yyrl1) - } - } else { - yyv1 = make([]*ServiceCheck, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = ServiceCheck{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(ServiceCheck) - } - yyw2 := yyv1[yyj1] - yyw2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = ServiceCheck{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(ServiceCheck) - } - yyw3 := yyv1[yyj1] - yyw3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *ServiceCheck - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = ServiceCheck{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(ServiceCheck) - } - yyw4 := yyv1[yyj1] - yyw4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*ServiceCheck{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encSlicePtrtoService(v []*Service, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicePtrtoService(v *[]*Service, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*Service{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*Service, yyrl1) - } - } else { - yyv1 = make([]*Service, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Service{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Service) - } - yyw2 := yyv1[yyj1] - yyw2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Service{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Service) - } - yyw3 := yyv1[yyj1] - yyw3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *Service - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Service{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Service) - } - yyw4 := yyv1[yyj1] - yyw4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*Service{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encSlicePtrtoTemplate(v []*Template, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicePtrtoTemplate(v *[]*Template, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*Template{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*Template, yyrl1) - } - } else { - yyv1 = make([]*Template, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Template{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Template) - } - yyw2 := yyv1[yyj1] - yyw2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Template{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Template) - } - yyw3 := yyv1[yyj1] - yyw3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *Template - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Template{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Template) - } - yyw4 := yyv1[yyj1] - yyw4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*Template{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encSlicePtrtoTaskArtifact(v []*TaskArtifact, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicePtrtoTaskArtifact(v *[]*TaskArtifact, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*TaskArtifact{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*TaskArtifact, yyrl1) - } - } else { - yyv1 = make([]*TaskArtifact, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = TaskArtifact{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(TaskArtifact) - } - yyw2 := yyv1[yyj1] - yyw2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = TaskArtifact{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(TaskArtifact) - } - yyw3 := yyv1[yyj1] - yyw3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *TaskArtifact - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = TaskArtifact{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(TaskArtifact) - } - yyw4 := yyv1[yyj1] - yyw4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*TaskArtifact{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encSlicePtrtoTaskEvent(v []*TaskEvent, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd5247) -} - -func (x codecSelfer5247) decSlicePtrtoTaskEvent(v *[]*TaskEvent, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*TaskEvent{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*TaskEvent, yyrl1) - } - } else { - yyv1 = make([]*TaskEvent, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = TaskEvent{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(TaskEvent) - } - yyw2 := yyv1[yyj1] - yyw2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = TaskEvent{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(TaskEvent) - } - yyw3 := yyv1[yyj1] - yyw3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *TaskEvent - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = TaskEvent{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(TaskEvent) - } - yyw4 := yyv1[yyj1] - yyw4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*TaskEvent{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer5247) encMapstringPtrtoDeploymentState(v map[string]*DeploymentState, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeMapStart(len(v)) - for yyk1, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - yym2 := z.EncBinary() - _ = yym2 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(yyk1)) - } - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x codecSelfer5247) decMapstringPtrtoDeploymentState(v *map[string]*DeploymentState, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyl1 := r.ReadMapStart() - yybh1 := z.DecBasicHandle() - if yyv1 == nil { - yyrl1, _ := z.DecInferLen(yyl1, yybh1.MaxInitLen, 24) - yyv1 = make(map[string]*DeploymentState, yyrl1) - *v = yyv1 - } - var yymk1 string - var yymv1 *DeploymentState - var yymg1, yyms1, yymok1 bool - if yybh1.MapValueReset { - yymg1 = true - } - if yyl1 > 0 { - for yyj1 := 0; yyj1 < yyl1; yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey5247) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv2 := &yymk1 - yym3 := z.DecBinary() - _ = yym3 - if false { - } else { - *((*string)(yyv2)) = r.DecodeString() - } - } - - yyms1 = true - if yymg1 { - yymv1, yymok1 = yyv1[yymk1] - if yymok1 { - yyms1 = false - } - } else { - yymv1 = nil - } - z.DecSendContainerState(codecSelfer_containerMapValue5247) - if r.TryDecodeAsNil() { - if yymv1 != nil { - *yymv1 = DeploymentState{} - } - } else { - if yymv1 == nil { - yymv1 = new(DeploymentState) - } - yymv1.CodecDecodeSelf(d) - } - - if yyms1 && yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } else if yyl1 < 0 { - for yyj1 := 0; !r.CheckBreak(); yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey5247) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv5 := &yymk1 - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - *((*string)(yyv5)) = r.DecodeString() - } - } - - yyms1 = true - if yymg1 { - yymv1, yymok1 = yyv1[yymk1] - if yymok1 { - yyms1 = false - } - } else { - yymv1 = nil - } - z.DecSendContainerState(codecSelfer_containerMapValue5247) - if r.TryDecodeAsNil() { - if yymv1 != nil { - *yymv1 = DeploymentState{} - } - } else { - if yymv1 == nil { - yymv1 = new(DeploymentState) - } - yymv1.CodecDecodeSelf(d) - } - - if yyms1 && yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } // else len==0: TODO: Should we clear map entries? - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x codecSelfer5247) encMapstringPtrtoResources(v map[string]*Resources, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeMapStart(len(v)) - for yyk1, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - yym2 := z.EncBinary() - _ = yym2 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(yyk1)) - } - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x codecSelfer5247) decMapstringPtrtoResources(v *map[string]*Resources, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyl1 := r.ReadMapStart() - yybh1 := z.DecBasicHandle() - if yyv1 == nil { - yyrl1, _ := z.DecInferLen(yyl1, yybh1.MaxInitLen, 24) - yyv1 = make(map[string]*Resources, yyrl1) - *v = yyv1 - } - var yymk1 string - var yymv1 *Resources - var yymg1, yyms1, yymok1 bool - if yybh1.MapValueReset { - yymg1 = true - } - if yyl1 > 0 { - for yyj1 := 0; yyj1 < yyl1; yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey5247) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv2 := &yymk1 - yym3 := z.DecBinary() - _ = yym3 - if false { - } else { - *((*string)(yyv2)) = r.DecodeString() - } - } - - yyms1 = true - if yymg1 { - yymv1, yymok1 = yyv1[yymk1] - if yymok1 { - yyms1 = false - } - } else { - yymv1 = nil - } - z.DecSendContainerState(codecSelfer_containerMapValue5247) - if r.TryDecodeAsNil() { - if yymv1 != nil { - *yymv1 = Resources{} - } - } else { - if yymv1 == nil { - yymv1 = new(Resources) - } - yymv1.CodecDecodeSelf(d) - } - - if yyms1 && yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } else if yyl1 < 0 { - for yyj1 := 0; !r.CheckBreak(); yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey5247) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv5 := &yymk1 - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - *((*string)(yyv5)) = r.DecodeString() - } - } - - yyms1 = true - if yymg1 { - yymv1, yymok1 = yyv1[yymk1] - if yymok1 { - yyms1 = false - } - } else { - yymv1 = nil - } - z.DecSendContainerState(codecSelfer_containerMapValue5247) - if r.TryDecodeAsNil() { - if yymv1 != nil { - *yymv1 = Resources{} - } - } else { - if yymv1 == nil { - yymv1 = new(Resources) - } - yymv1.CodecDecodeSelf(d) - } - - if yyms1 && yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } // else len==0: TODO: Should we clear map entries? - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x codecSelfer5247) encMapstringPtrtoTaskState(v map[string]*TaskState, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeMapStart(len(v)) - for yyk1, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - yym2 := z.EncBinary() - _ = yym2 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(yyk1)) - } - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x codecSelfer5247) decMapstringPtrtoTaskState(v *map[string]*TaskState, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyl1 := r.ReadMapStart() - yybh1 := z.DecBasicHandle() - if yyv1 == nil { - yyrl1, _ := z.DecInferLen(yyl1, yybh1.MaxInitLen, 24) - yyv1 = make(map[string]*TaskState, yyrl1) - *v = yyv1 - } - var yymk1 string - var yymv1 *TaskState - var yymg1, yyms1, yymok1 bool - if yybh1.MapValueReset { - yymg1 = true - } - if yyl1 > 0 { - for yyj1 := 0; yyj1 < yyl1; yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey5247) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv2 := &yymk1 - yym3 := z.DecBinary() - _ = yym3 - if false { - } else { - *((*string)(yyv2)) = r.DecodeString() - } - } - - yyms1 = true - if yymg1 { - yymv1, yymok1 = yyv1[yymk1] - if yymok1 { - yyms1 = false - } - } else { - yymv1 = nil - } - z.DecSendContainerState(codecSelfer_containerMapValue5247) - if r.TryDecodeAsNil() { - if yymv1 != nil { - *yymv1 = TaskState{} - } - } else { - if yymv1 == nil { - yymv1 = new(TaskState) - } - yymv1.CodecDecodeSelf(d) - } - - if yyms1 && yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } else if yyl1 < 0 { - for yyj1 := 0; !r.CheckBreak(); yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey5247) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv5 := &yymk1 - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - *((*string)(yyv5)) = r.DecodeString() - } - } - - yyms1 = true - if yymg1 { - yymv1, yymok1 = yyv1[yymk1] - if yymok1 { - yyms1 = false - } - } else { - yymv1 = nil - } - z.DecSendContainerState(codecSelfer_containerMapValue5247) - if r.TryDecodeAsNil() { - if yymv1 != nil { - *yymv1 = TaskState{} - } - } else { - if yymv1 == nil { - yymv1 = new(TaskState) - } - yymv1.CodecDecodeSelf(d) - } - - if yyms1 && yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } // else len==0: TODO: Should we clear map entries? - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x codecSelfer5247) encMapstringSlicePtrtoAllocation(v map[string][]*Allocation, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeMapStart(len(v)) - for yyk1, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - yym2 := z.EncBinary() - _ = yym2 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(yyk1)) - } - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yym3 := z.EncBinary() - _ = yym3 - if false { - } else { - h.encSlicePtrtoAllocation(([]*Allocation)(yyv1), e) - } - } - } - z.EncSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x codecSelfer5247) decMapstringSlicePtrtoAllocation(v *map[string][]*Allocation, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyl1 := r.ReadMapStart() - yybh1 := z.DecBasicHandle() - if yyv1 == nil { - yyrl1, _ := z.DecInferLen(yyl1, yybh1.MaxInitLen, 40) - yyv1 = make(map[string][]*Allocation, yyrl1) - *v = yyv1 - } - var yymk1 string - var yymv1 []*Allocation - var yymg1 bool - if yybh1.MapValueReset { - yymg1 = true - } - if yyl1 > 0 { - for yyj1 := 0; yyj1 < yyl1; yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey5247) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv2 := &yymk1 - yym3 := z.DecBinary() - _ = yym3 - if false { - } else { - *((*string)(yyv2)) = r.DecodeString() - } - } - - if yymg1 { - yymv1 = yyv1[yymk1] - } else { - yymv1 = nil - } - z.DecSendContainerState(codecSelfer_containerMapValue5247) - if r.TryDecodeAsNil() { - yymv1 = nil - } else { - yyv4 := &yymv1 - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSlicePtrtoAllocation((*[]*Allocation)(yyv4), d) - } - } - - if yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } else if yyl1 < 0 { - for yyj1 := 0; !r.CheckBreak(); yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey5247) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv6 := &yymk1 - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - - if yymg1 { - yymv1 = yyv1[yymk1] - } else { - yymv1 = nil - } - z.DecSendContainerState(codecSelfer_containerMapValue5247) - if r.TryDecodeAsNil() { - yymv1 = nil - } else { - yyv8 := &yymv1 - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - h.decSlicePtrtoAllocation((*[]*Allocation)(yyv8), d) - } - } - - if yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } // else len==0: TODO: Should we clear map entries? - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x codecSelfer5247) encMapstringPtrtoDesiredUpdates(v map[string]*DesiredUpdates, e *codec1978.Encoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeMapStart(len(v)) - for yyk1, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerMapKey5247) - yym2 := z.EncBinary() - _ = yym2 - if false { - } else { - r.EncodeString(codecSelferC_UTF85247, string(yyk1)) - } - z.EncSendContainerState(codecSelfer_containerMapValue5247) - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - z.EncSendContainerState(codecSelfer_containerMapEnd5247) -} - -func (x codecSelfer5247) decMapstringPtrtoDesiredUpdates(v *map[string]*DesiredUpdates, d *codec1978.Decoder) { - var h codecSelfer5247 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyl1 := r.ReadMapStart() - yybh1 := z.DecBasicHandle() - if yyv1 == nil { - yyrl1, _ := z.DecInferLen(yyl1, yybh1.MaxInitLen, 24) - yyv1 = make(map[string]*DesiredUpdates, yyrl1) - *v = yyv1 - } - var yymk1 string - var yymv1 *DesiredUpdates - var yymg1, yyms1, yymok1 bool - if yybh1.MapValueReset { - yymg1 = true - } - if yyl1 > 0 { - for yyj1 := 0; yyj1 < yyl1; yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey5247) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv2 := &yymk1 - yym3 := z.DecBinary() - _ = yym3 - if false { - } else { - *((*string)(yyv2)) = r.DecodeString() - } - } - - yyms1 = true - if yymg1 { - yymv1, yymok1 = yyv1[yymk1] - if yymok1 { - yyms1 = false - } - } else { - yymv1 = nil - } - z.DecSendContainerState(codecSelfer_containerMapValue5247) - if r.TryDecodeAsNil() { - if yymv1 != nil { - *yymv1 = DesiredUpdates{} - } - } else { - if yymv1 == nil { - yymv1 = new(DesiredUpdates) - } - yymv1.CodecDecodeSelf(d) - } - - if yyms1 && yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } else if yyl1 < 0 { - for yyj1 := 0; !r.CheckBreak(); yyj1++ { - z.DecSendContainerState(codecSelfer_containerMapKey5247) - if r.TryDecodeAsNil() { - yymk1 = "" - } else { - yyv5 := &yymk1 - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - *((*string)(yyv5)) = r.DecodeString() - } - } - - yyms1 = true - if yymg1 { - yymv1, yymok1 = yyv1[yymk1] - if yymok1 { - yyms1 = false - } - } else { - yymv1 = nil - } - z.DecSendContainerState(codecSelfer_containerMapValue5247) - if r.TryDecodeAsNil() { - if yymv1 != nil { - *yymv1 = DesiredUpdates{} - } - } else { - if yymv1 == nil { - yymv1 = new(DesiredUpdates) - } - yymv1.CodecDecodeSelf(d) - } - - if yyms1 && yyv1 != nil { - yyv1[yymk1] = yymv1 - } - } - } // else len==0: TODO: Should we clear map entries? - z.DecSendContainerState(codecSelfer_containerMapEnd5247) -} diff --git a/nomad/structs/structs.go b/nomad/structs/structs.go index f62b5e89a..5c0f72b5f 100644 --- a/nomad/structs/structs.go +++ b/nomad/structs/structs.go @@ -20,10 +20,13 @@ import ( "strings" "time" + "golang.org/x/crypto/blake2b" + "github.com/gorhill/cronexpr" "github.com/hashicorp/consul/api" "github.com/hashicorp/go-multierror" - version "github.com/hashicorp/go-version" + "github.com/hashicorp/go-version" + "github.com/hashicorp/nomad/acl" "github.com/hashicorp/nomad/helper" "github.com/hashicorp/nomad/helper/args" "github.com/mitchellh/copystructure" @@ -33,8 +36,13 @@ import ( ) var ( - ErrNoLeader = fmt.Errorf("No cluster leader") - ErrNoRegionPath = fmt.Errorf("No path to region") + ErrNoLeader = fmt.Errorf("No cluster leader") + ErrNoRegionPath = fmt.Errorf("No path to region") + ErrTokenNotFound = errors.New("ACL token not found") + ErrPermissionDenied = errors.New("Permission denied") + + // validPolicyName is used to validate a policy name + validPolicyName = regexp.MustCompile("^[a-zA-Z0-9-]{1,128}$") ) type MessageType uint8 @@ -59,6 +67,11 @@ const ( DeploymentAllocHealthRequestType DeploymentDeleteRequestType JobStabilityRequestType + ACLPolicyUpsertRequestType + ACLPolicyDeleteRequestType + ACLTokenUpsertRequestType + ACLTokenDeleteRequestType + ACLTokenBootstrapRequestType ) const ( @@ -87,6 +100,19 @@ const ( GetterModeAny = "any" GetterModeFile = "file" GetterModeDir = "dir" + + // maxPolicyDescriptionLength limits a policy description length + maxPolicyDescriptionLength = 256 + + // maxTokenNameLength limits a ACL token name length + maxTokenNameLength = 64 + + // ACLClientToken and ACLManagementToken are the only types of tokens + ACLClientToken = "client" + ACLManagementToken = "management" + + // DefaultNamespace is the default namespace. + DefaultNamespace = "default" ) // Context defines the scope in which a search for Nomad object operates, and @@ -127,6 +153,9 @@ type QueryOptions struct { // If set, used as prefix for resource list searches Prefix string + + // SecretID is secret portion of the ACL token used for the request + SecretID string } func (q QueryOptions) RequestRegion() string { @@ -145,6 +174,9 @@ func (q QueryOptions) AllowStaleRead() bool { type WriteRequest struct { // The target region for this write Region string + + // SecretID is secret portion of the ACL token used for the request + SecretID string } func (w WriteRequest) RequestRegion() string { @@ -5324,3 +5356,308 @@ func IsRecoverable(e error) bool { } return false } + +// ACLPolicy is used to represent an ACL policy +type ACLPolicy struct { + Name string // Unique name + Description string // Human readable + Rules string // HCL or JSON format + Hash []byte + CreateIndex uint64 + ModifyIndex uint64 +} + +// SetHash is used to compute and set the hash of the ACL policy +func (c *ACLPolicy) SetHash() []byte { + // Initialize a 256bit Blake2 hash (32 bytes) + hash, err := blake2b.New256(nil) + if err != nil { + panic(err) + } + + // Write all the user set fields + hash.Write([]byte(c.Name)) + hash.Write([]byte(c.Description)) + hash.Write([]byte(c.Rules)) + + // Finalize the hash + hashVal := hash.Sum(nil) + + // Set and return the hash + c.Hash = hashVal + return hashVal +} + +func (a *ACLPolicy) Stub() *ACLPolicyListStub { + return &ACLPolicyListStub{ + Name: a.Name, + Description: a.Description, + Hash: a.Hash, + CreateIndex: a.CreateIndex, + ModifyIndex: a.ModifyIndex, + } +} + +func (a *ACLPolicy) Validate() error { + var mErr multierror.Error + if !validPolicyName.MatchString(a.Name) { + err := fmt.Errorf("invalid name '%s'", a.Name) + mErr.Errors = append(mErr.Errors, err) + } + if _, err := acl.Parse(a.Rules); err != nil { + err = fmt.Errorf("failed to parse rules: %v", err) + mErr.Errors = append(mErr.Errors, err) + } + if len(a.Description) > maxPolicyDescriptionLength { + err := fmt.Errorf("description longer than %d", maxPolicyDescriptionLength) + mErr.Errors = append(mErr.Errors, err) + } + return mErr.ErrorOrNil() +} + +// ACLPolicyListStub is used to for listing ACL policies +type ACLPolicyListStub struct { + Name string + Description string + Hash []byte + CreateIndex uint64 + ModifyIndex uint64 +} + +// ACLPolicyListRequest is used to request a list of policies +type ACLPolicyListRequest struct { + QueryOptions +} + +// ACLPolicySpecificRequest is used to query a specific policy +type ACLPolicySpecificRequest struct { + Name string + QueryOptions +} + +// ACLPolicySetRequest is used to query a set of policies +type ACLPolicySetRequest struct { + Names []string + QueryOptions +} + +// ACLPolicyListResponse is used for a list request +type ACLPolicyListResponse struct { + Policies []*ACLPolicyListStub + QueryMeta +} + +// SingleACLPolicyResponse is used to return a single policy +type SingleACLPolicyResponse struct { + Policy *ACLPolicy + QueryMeta +} + +// ACLPolicySetResponse is used to return a set of policies +type ACLPolicySetResponse struct { + Policies map[string]*ACLPolicy + QueryMeta +} + +// ACLPolicyDeleteRequest is used to delete a set of policies +type ACLPolicyDeleteRequest struct { + Names []string + WriteRequest +} + +// ACLPolicyUpsertRequest is used to upsert a set of policies +type ACLPolicyUpsertRequest struct { + Policies []*ACLPolicy + WriteRequest +} + +// ACLToken represents a client token which is used to Authenticate +type ACLToken struct { + AccessorID string // Public Accessor ID (UUID) + SecretID string // Secret ID, private (UUID) + Name string // Human friendly name + Type string // Client or Management + Policies []string // Policies this token ties to + Global bool // Global or Region local + Hash []byte + CreateTime time.Time // Time of creation + CreateIndex uint64 + ModifyIndex uint64 +} + +var ( + // AnonymousACLToken is used no SecretID is provided, and the + // request is made anonymously. + AnonymousACLToken = &ACLToken{ + AccessorID: "anonymous", + Name: "Anonymous Token", + Type: ACLClientToken, + Policies: []string{"anonymous"}, + Global: false, + } +) + +type ACLTokenListStub struct { + AccessorID string + Name string + Type string + Policies []string + Global bool + Hash []byte + CreateTime time.Time + CreateIndex uint64 + ModifyIndex uint64 +} + +// SetHash is used to compute and set the hash of the ACL token +func (a *ACLToken) SetHash() []byte { + // Initialize a 256bit Blake2 hash (32 bytes) + hash, err := blake2b.New256(nil) + if err != nil { + panic(err) + } + + // Write all the user set fields + hash.Write([]byte(a.Name)) + hash.Write([]byte(a.Type)) + for _, policyName := range a.Policies { + hash.Write([]byte(policyName)) + } + if a.Global { + hash.Write([]byte("global")) + } else { + hash.Write([]byte("local")) + } + + // Finalize the hash + hashVal := hash.Sum(nil) + + // Set and return the hash + a.Hash = hashVal + return hashVal +} + +func (a *ACLToken) Stub() *ACLTokenListStub { + return &ACLTokenListStub{ + AccessorID: a.AccessorID, + Name: a.Name, + Type: a.Type, + Policies: a.Policies, + Global: a.Global, + Hash: a.Hash, + CreateTime: a.CreateTime, + CreateIndex: a.CreateIndex, + ModifyIndex: a.ModifyIndex, + } +} + +// Validate is used to sanity check a token +func (a *ACLToken) Validate() error { + var mErr multierror.Error + if len(a.Name) > maxTokenNameLength { + mErr.Errors = append(mErr.Errors, fmt.Errorf("token name too long")) + } + switch a.Type { + case ACLClientToken: + if len(a.Policies) == 0 { + mErr.Errors = append(mErr.Errors, fmt.Errorf("client token missing policies")) + } + case ACLManagementToken: + if len(a.Policies) != 0 { + mErr.Errors = append(mErr.Errors, fmt.Errorf("management token cannot be associated with policies")) + } + default: + mErr.Errors = append(mErr.Errors, fmt.Errorf("token type must be client or management")) + } + return mErr.ErrorOrNil() +} + +// PolicySubset checks if a given set of policies is a subset of the token +func (a *ACLToken) PolicySubset(policies []string) bool { + // Hot-path the management tokens, superset of all policies. + if a.Type == ACLManagementToken { + return true + } + associatedPolicies := make(map[string]struct{}, len(a.Policies)) + for _, policy := range a.Policies { + associatedPolicies[policy] = struct{}{} + } + for _, policy := range policies { + if _, ok := associatedPolicies[policy]; !ok { + return false + } + } + return true +} + +// ACLTokenListRequest is used to request a list of tokens +type ACLTokenListRequest struct { + GlobalOnly bool + QueryOptions +} + +// ACLTokenSpecificRequest is used to query a specific token +type ACLTokenSpecificRequest struct { + AccessorID string + QueryOptions +} + +// ACLTokenSetRequest is used to query a set of tokens +type ACLTokenSetRequest struct { + AccessorIDS []string + QueryOptions +} + +// ACLTokenListResponse is used for a list request +type ACLTokenListResponse struct { + Tokens []*ACLTokenListStub + QueryMeta +} + +// SingleACLTokenResponse is used to return a single token +type SingleACLTokenResponse struct { + Token *ACLToken + QueryMeta +} + +// ACLTokenSetResponse is used to return a set of token +type ACLTokenSetResponse struct { + Tokens map[string]*ACLToken // Keyed by Accessor ID + QueryMeta +} + +// ResolveACLTokenRequest is used to resolve a specific token +type ResolveACLTokenRequest struct { + SecretID string + QueryOptions +} + +// ResolveACLTokenResponse is used to resolve a single token +type ResolveACLTokenResponse struct { + Token *ACLToken + QueryMeta +} + +// ACLTokenDeleteRequest is used to delete a set of tokens +type ACLTokenDeleteRequest struct { + AccessorIDs []string + WriteRequest +} + +// ACLTokenBootstrapRequest is used to bootstrap ACLs +type ACLTokenBootstrapRequest struct { + Token *ACLToken // Not client specifiable + WriteRequest +} + +// ACLTokenUpsertRequest is used to upsert a set of tokens +type ACLTokenUpsertRequest struct { + Tokens []*ACLToken + WriteRequest +} + +// ACLTokenUpsertResponse is used to return from an ACLTokenUpsertRequest +type ACLTokenUpsertResponse struct { + Tokens []*ACLToken + WriteMeta +} diff --git a/nomad/structs/structs_test.go b/nomad/structs/structs_test.go index cfe7c2158..b46e69fbd 100644 --- a/nomad/structs/structs_test.go +++ b/nomad/structs/structs_test.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/consul/api" "github.com/hashicorp/go-multierror" "github.com/kr/pretty" + "github.com/stretchr/testify/assert" ) func TestJob_Validate(t *testing.T) { @@ -2264,3 +2265,109 @@ func TestIsRecoverable(t *testing.T) { t.Errorf("Explicitly recoverable errors *should* be recoverable") } } + +func TestACLTokenValidate(t *testing.T) { + tk := &ACLToken{} + + // Mising a type + err := tk.Validate() + assert.NotNil(t, err) + if !strings.Contains(err.Error(), "client or management") { + t.Fatalf("bad: %v", err) + } + + // Missing policies + tk.Type = ACLClientToken + err = tk.Validate() + assert.NotNil(t, err) + if !strings.Contains(err.Error(), "missing policies") { + t.Fatalf("bad: %v", err) + } + + // Invalid policices + tk.Type = ACLManagementToken + tk.Policies = []string{"foo"} + err = tk.Validate() + assert.NotNil(t, err) + if !strings.Contains(err.Error(), "associated with policies") { + t.Fatalf("bad: %v", err) + } + + // Name too long policices + tk.Name = GenerateUUID() + GenerateUUID() + tk.Policies = nil + err = tk.Validate() + assert.NotNil(t, err) + if !strings.Contains(err.Error(), "too long") { + t.Fatalf("bad: %v", err) + } + + // Make it valid + tk.Name = "foo" + err = tk.Validate() + assert.Nil(t, err) +} + +func TestACLTokenPolicySubset(t *testing.T) { + tk := &ACLToken{ + Type: ACLClientToken, + Policies: []string{"foo", "bar", "baz"}, + } + + assert.Equal(t, true, tk.PolicySubset([]string{"foo", "bar", "baz"})) + assert.Equal(t, true, tk.PolicySubset([]string{"foo", "bar"})) + assert.Equal(t, true, tk.PolicySubset([]string{"foo"})) + assert.Equal(t, true, tk.PolicySubset([]string{})) + assert.Equal(t, false, tk.PolicySubset([]string{"foo", "bar", "new"})) + assert.Equal(t, false, tk.PolicySubset([]string{"new"})) + + tk = &ACLToken{ + Type: ACLManagementToken, + } + + assert.Equal(t, true, tk.PolicySubset([]string{"foo", "bar", "baz"})) + assert.Equal(t, true, tk.PolicySubset([]string{"foo", "bar"})) + assert.Equal(t, true, tk.PolicySubset([]string{"foo"})) + assert.Equal(t, true, tk.PolicySubset([]string{})) + assert.Equal(t, true, tk.PolicySubset([]string{"foo", "bar", "new"})) + assert.Equal(t, true, tk.PolicySubset([]string{"new"})) +} + +func TestACLTokenSetHash(t *testing.T) { + tk := &ACLToken{ + Name: "foo", + Type: ACLClientToken, + Policies: []string{"foo", "bar"}, + Global: false, + } + out1 := tk.SetHash() + assert.NotNil(t, out1) + assert.NotNil(t, tk.Hash) + assert.Equal(t, out1, tk.Hash) + + tk.Policies = []string{"foo"} + out2 := tk.SetHash() + assert.NotNil(t, out2) + assert.NotNil(t, tk.Hash) + assert.Equal(t, out2, tk.Hash) + assert.NotEqual(t, out1, out2) +} + +func TestACLPolicySetHash(t *testing.T) { + ap := &ACLPolicy{ + Name: "foo", + Description: "great policy", + Rules: "node { policy = \"read\" }", + } + out1 := ap.SetHash() + assert.NotNil(t, out1) + assert.NotNil(t, ap.Hash) + assert.Equal(t, out1, ap.Hash) + + ap.Rules = "node { policy = \"write\" }" + out2 := ap.SetHash() + assert.NotNil(t, out2) + assert.NotNil(t, ap.Hash) + assert.Equal(t, out2, ap.Hash) + assert.NotEqual(t, out1, out2) +} diff --git a/testutil/server.go b/testutil/server.go index 9c83bcef9..5f55b0743 100644 --- a/testutil/server.go +++ b/testutil/server.go @@ -42,6 +42,7 @@ type TestServerConfig struct { Server *ServerConfig `json:"server,omitempty"` Client *ClientConfig `json:"client,omitempty"` Vault *VaultConfig `json:"vault,omitempty"` + ACL *ACLConfig `json:"acl,omitempty"` DevMode bool `json:"-"` Stdout, Stderr io.Writer `json:"-"` } @@ -76,6 +77,11 @@ type VaultConfig struct { Enabled bool `json:"enabled"` } +// ACLConfig is used to configure ACLs +type ACLConfig struct { + Enabled bool `json:"enabled"` +} + // ServerConfigCallback is a function interface which can be // passed to NewTestServerConfig to modify the server config. type ServerConfigCallback func(c *TestServerConfig) @@ -110,6 +116,9 @@ func defaultServerConfig() *TestServerConfig { Vault: &VaultConfig{ Enabled: false, }, + ACL: &ACLConfig{ + Enabled: false, + }, } } diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b.go b/vendor/golang.org/x/crypto/blake2b/blake2b.go new file mode 100644 index 000000000..7f0a86e44 --- /dev/null +++ b/vendor/golang.org/x/crypto/blake2b/blake2b.go @@ -0,0 +1,207 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package blake2b implements the BLAKE2b hash algorithm defined by RFC 7693 +// and the extendable output function (XOF) BLAKE2Xb. +// +// For a detailed specification of BLAKE2b see https://blake2.net/blake2.pdf +// and for BLAKE2Xb see https://blake2.net/blake2x.pdf +// +// If you aren't sure which function you need, use BLAKE2b (Sum512 or New512). +// If you need a secret-key MAC (message authentication code), use the New512 +// function with a non-nil key. +// +// BLAKE2X is a construction to compute hash values larger than 64 bytes. It +// can produce hash values between 0 and 4 GiB. +package blake2b + +import ( + "encoding/binary" + "errors" + "hash" +) + +const ( + // The blocksize of BLAKE2b in bytes. + BlockSize = 128 + // The hash size of BLAKE2b-512 in bytes. + Size = 64 + // The hash size of BLAKE2b-384 in bytes. + Size384 = 48 + // The hash size of BLAKE2b-256 in bytes. + Size256 = 32 +) + +var ( + useAVX2 bool + useAVX bool + useSSE4 bool +) + +var errKeySize = errors.New("blake2b: invalid key size") + +var iv = [8]uint64{ + 0x6a09e667f3bcc908, 0xbb67ae8584caa73b, 0x3c6ef372fe94f82b, 0xa54ff53a5f1d36f1, + 0x510e527fade682d1, 0x9b05688c2b3e6c1f, 0x1f83d9abfb41bd6b, 0x5be0cd19137e2179, +} + +// Sum512 returns the BLAKE2b-512 checksum of the data. +func Sum512(data []byte) [Size]byte { + var sum [Size]byte + checkSum(&sum, Size, data) + return sum +} + +// Sum384 returns the BLAKE2b-384 checksum of the data. +func Sum384(data []byte) [Size384]byte { + var sum [Size]byte + var sum384 [Size384]byte + checkSum(&sum, Size384, data) + copy(sum384[:], sum[:Size384]) + return sum384 +} + +// Sum256 returns the BLAKE2b-256 checksum of the data. +func Sum256(data []byte) [Size256]byte { + var sum [Size]byte + var sum256 [Size256]byte + checkSum(&sum, Size256, data) + copy(sum256[:], sum[:Size256]) + return sum256 +} + +// New512 returns a new hash.Hash computing the BLAKE2b-512 checksum. A non-nil +// key turns the hash into a MAC. The key must between zero and 64 bytes long. +func New512(key []byte) (hash.Hash, error) { return newDigest(Size, key) } + +// New384 returns a new hash.Hash computing the BLAKE2b-384 checksum. A non-nil +// key turns the hash into a MAC. The key must between zero and 64 bytes long. +func New384(key []byte) (hash.Hash, error) { return newDigest(Size384, key) } + +// New256 returns a new hash.Hash computing the BLAKE2b-256 checksum. A non-nil +// key turns the hash into a MAC. The key must between zero and 64 bytes long. +func New256(key []byte) (hash.Hash, error) { return newDigest(Size256, key) } + +func newDigest(hashSize int, key []byte) (*digest, error) { + if len(key) > Size { + return nil, errKeySize + } + d := &digest{ + size: hashSize, + keyLen: len(key), + } + copy(d.key[:], key) + d.Reset() + return d, nil +} + +func checkSum(sum *[Size]byte, hashSize int, data []byte) { + h := iv + h[0] ^= uint64(hashSize) | (1 << 16) | (1 << 24) + var c [2]uint64 + + if length := len(data); length > BlockSize { + n := length &^ (BlockSize - 1) + if length == n { + n -= BlockSize + } + hashBlocks(&h, &c, 0, data[:n]) + data = data[n:] + } + + var block [BlockSize]byte + offset := copy(block[:], data) + remaining := uint64(BlockSize - offset) + if c[0] < remaining { + c[1]-- + } + c[0] -= remaining + + hashBlocks(&h, &c, 0xFFFFFFFFFFFFFFFF, block[:]) + + for i, v := range h[:(hashSize+7)/8] { + binary.LittleEndian.PutUint64(sum[8*i:], v) + } +} + +type digest struct { + h [8]uint64 + c [2]uint64 + size int + block [BlockSize]byte + offset int + + key [BlockSize]byte + keyLen int +} + +func (d *digest) BlockSize() int { return BlockSize } + +func (d *digest) Size() int { return d.size } + +func (d *digest) Reset() { + d.h = iv + d.h[0] ^= uint64(d.size) | (uint64(d.keyLen) << 8) | (1 << 16) | (1 << 24) + d.offset, d.c[0], d.c[1] = 0, 0, 0 + if d.keyLen > 0 { + d.block = d.key + d.offset = BlockSize + } +} + +func (d *digest) Write(p []byte) (n int, err error) { + n = len(p) + + if d.offset > 0 { + remaining := BlockSize - d.offset + if n <= remaining { + d.offset += copy(d.block[d.offset:], p) + return + } + copy(d.block[d.offset:], p[:remaining]) + hashBlocks(&d.h, &d.c, 0, d.block[:]) + d.offset = 0 + p = p[remaining:] + } + + if length := len(p); length > BlockSize { + nn := length &^ (BlockSize - 1) + if length == nn { + nn -= BlockSize + } + hashBlocks(&d.h, &d.c, 0, p[:nn]) + p = p[nn:] + } + + if len(p) > 0 { + d.offset += copy(d.block[:], p) + } + + return +} + +func (d *digest) Sum(sum []byte) []byte { + var hash [Size]byte + d.finalize(&hash) + return append(sum, hash[:d.size]...) +} + +func (d *digest) finalize(hash *[Size]byte) { + var block [BlockSize]byte + copy(block[:], d.block[:d.offset]) + remaining := uint64(BlockSize - d.offset) + + c := d.c + if c[0] < remaining { + c[1]-- + } + c[0] -= remaining + + h := d.h + hashBlocks(&h, &c, 0xFFFFFFFFFFFFFFFF, block[:]) + + for i, v := range h { + binary.LittleEndian.PutUint64(hash[8*i:], v) + } +} diff --git a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go new file mode 100644 index 000000000..8c41cf6c7 --- /dev/null +++ b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go @@ -0,0 +1,43 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.7,amd64,!gccgo,!appengine + +package blake2b + +func init() { + useAVX2 = supportsAVX2() + useAVX = supportsAVX() + useSSE4 = supportsSSE4() +} + +//go:noescape +func supportsSSE4() bool + +//go:noescape +func supportsAVX() bool + +//go:noescape +func supportsAVX2() bool + +//go:noescape +func hashBlocksAVX2(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) + +//go:noescape +func hashBlocksAVX(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) + +//go:noescape +func hashBlocksSSE4(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) + +func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) { + if useAVX2 { + hashBlocksAVX2(h, c, flag, blocks) + } else if useAVX { + hashBlocksAVX(h, c, flag, blocks) + } else if useSSE4 { + hashBlocksSSE4(h, c, flag, blocks) + } else { + hashBlocksGeneric(h, c, flag, blocks) + } +} diff --git a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s new file mode 100644 index 000000000..784bce6a9 --- /dev/null +++ b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s @@ -0,0 +1,762 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.7,amd64,!gccgo,!appengine + +#include "textflag.h" + +DATA ·AVX2_iv0<>+0x00(SB)/8, $0x6a09e667f3bcc908 +DATA ·AVX2_iv0<>+0x08(SB)/8, $0xbb67ae8584caa73b +DATA ·AVX2_iv0<>+0x10(SB)/8, $0x3c6ef372fe94f82b +DATA ·AVX2_iv0<>+0x18(SB)/8, $0xa54ff53a5f1d36f1 +GLOBL ·AVX2_iv0<>(SB), (NOPTR+RODATA), $32 + +DATA ·AVX2_iv1<>+0x00(SB)/8, $0x510e527fade682d1 +DATA ·AVX2_iv1<>+0x08(SB)/8, $0x9b05688c2b3e6c1f +DATA ·AVX2_iv1<>+0x10(SB)/8, $0x1f83d9abfb41bd6b +DATA ·AVX2_iv1<>+0x18(SB)/8, $0x5be0cd19137e2179 +GLOBL ·AVX2_iv1<>(SB), (NOPTR+RODATA), $32 + +DATA ·AVX2_c40<>+0x00(SB)/8, $0x0201000706050403 +DATA ·AVX2_c40<>+0x08(SB)/8, $0x0a09080f0e0d0c0b +DATA ·AVX2_c40<>+0x10(SB)/8, $0x0201000706050403 +DATA ·AVX2_c40<>+0x18(SB)/8, $0x0a09080f0e0d0c0b +GLOBL ·AVX2_c40<>(SB), (NOPTR+RODATA), $32 + +DATA ·AVX2_c48<>+0x00(SB)/8, $0x0100070605040302 +DATA ·AVX2_c48<>+0x08(SB)/8, $0x09080f0e0d0c0b0a +DATA ·AVX2_c48<>+0x10(SB)/8, $0x0100070605040302 +DATA ·AVX2_c48<>+0x18(SB)/8, $0x09080f0e0d0c0b0a +GLOBL ·AVX2_c48<>(SB), (NOPTR+RODATA), $32 + +DATA ·AVX_iv0<>+0x00(SB)/8, $0x6a09e667f3bcc908 +DATA ·AVX_iv0<>+0x08(SB)/8, $0xbb67ae8584caa73b +GLOBL ·AVX_iv0<>(SB), (NOPTR+RODATA), $16 + +DATA ·AVX_iv1<>+0x00(SB)/8, $0x3c6ef372fe94f82b +DATA ·AVX_iv1<>+0x08(SB)/8, $0xa54ff53a5f1d36f1 +GLOBL ·AVX_iv1<>(SB), (NOPTR+RODATA), $16 + +DATA ·AVX_iv2<>+0x00(SB)/8, $0x510e527fade682d1 +DATA ·AVX_iv2<>+0x08(SB)/8, $0x9b05688c2b3e6c1f +GLOBL ·AVX_iv2<>(SB), (NOPTR+RODATA), $16 + +DATA ·AVX_iv3<>+0x00(SB)/8, $0x1f83d9abfb41bd6b +DATA ·AVX_iv3<>+0x08(SB)/8, $0x5be0cd19137e2179 +GLOBL ·AVX_iv3<>(SB), (NOPTR+RODATA), $16 + +DATA ·AVX_c40<>+0x00(SB)/8, $0x0201000706050403 +DATA ·AVX_c40<>+0x08(SB)/8, $0x0a09080f0e0d0c0b +GLOBL ·AVX_c40<>(SB), (NOPTR+RODATA), $16 + +DATA ·AVX_c48<>+0x00(SB)/8, $0x0100070605040302 +DATA ·AVX_c48<>+0x08(SB)/8, $0x09080f0e0d0c0b0a +GLOBL ·AVX_c48<>(SB), (NOPTR+RODATA), $16 + +#define VPERMQ_0x39_Y1_Y1 BYTE $0xc4; BYTE $0xe3; BYTE $0xfd; BYTE $0x00; BYTE $0xc9; BYTE $0x39 +#define VPERMQ_0x93_Y1_Y1 BYTE $0xc4; BYTE $0xe3; BYTE $0xfd; BYTE $0x00; BYTE $0xc9; BYTE $0x93 +#define VPERMQ_0x4E_Y2_Y2 BYTE $0xc4; BYTE $0xe3; BYTE $0xfd; BYTE $0x00; BYTE $0xd2; BYTE $0x4e +#define VPERMQ_0x93_Y3_Y3 BYTE $0xc4; BYTE $0xe3; BYTE $0xfd; BYTE $0x00; BYTE $0xdb; BYTE $0x93 +#define VPERMQ_0x39_Y3_Y3 BYTE $0xc4; BYTE $0xe3; BYTE $0xfd; BYTE $0x00; BYTE $0xdb; BYTE $0x39 + +#define ROUND_AVX2(m0, m1, m2, m3, t, c40, c48) \ + VPADDQ m0, Y0, Y0; \ + VPADDQ Y1, Y0, Y0; \ + VPXOR Y0, Y3, Y3; \ + VPSHUFD $-79, Y3, Y3; \ + VPADDQ Y3, Y2, Y2; \ + VPXOR Y2, Y1, Y1; \ + VPSHUFB c40, Y1, Y1; \ + VPADDQ m1, Y0, Y0; \ + VPADDQ Y1, Y0, Y0; \ + VPXOR Y0, Y3, Y3; \ + VPSHUFB c48, Y3, Y3; \ + VPADDQ Y3, Y2, Y2; \ + VPXOR Y2, Y1, Y1; \ + VPADDQ Y1, Y1, t; \ + VPSRLQ $63, Y1, Y1; \ + VPXOR t, Y1, Y1; \ + VPERMQ_0x39_Y1_Y1; \ + VPERMQ_0x4E_Y2_Y2; \ + VPERMQ_0x93_Y3_Y3; \ + VPADDQ m2, Y0, Y0; \ + VPADDQ Y1, Y0, Y0; \ + VPXOR Y0, Y3, Y3; \ + VPSHUFD $-79, Y3, Y3; \ + VPADDQ Y3, Y2, Y2; \ + VPXOR Y2, Y1, Y1; \ + VPSHUFB c40, Y1, Y1; \ + VPADDQ m3, Y0, Y0; \ + VPADDQ Y1, Y0, Y0; \ + VPXOR Y0, Y3, Y3; \ + VPSHUFB c48, Y3, Y3; \ + VPADDQ Y3, Y2, Y2; \ + VPXOR Y2, Y1, Y1; \ + VPADDQ Y1, Y1, t; \ + VPSRLQ $63, Y1, Y1; \ + VPXOR t, Y1, Y1; \ + VPERMQ_0x39_Y3_Y3; \ + VPERMQ_0x4E_Y2_Y2; \ + VPERMQ_0x93_Y1_Y1 + +#define VMOVQ_SI_X11_0 BYTE $0xC5; BYTE $0x7A; BYTE $0x7E; BYTE $0x1E +#define VMOVQ_SI_X12_0 BYTE $0xC5; BYTE $0x7A; BYTE $0x7E; BYTE $0x26 +#define VMOVQ_SI_X13_0 BYTE $0xC5; BYTE $0x7A; BYTE $0x7E; BYTE $0x2E +#define VMOVQ_SI_X14_0 BYTE $0xC5; BYTE $0x7A; BYTE $0x7E; BYTE $0x36 +#define VMOVQ_SI_X15_0 BYTE $0xC5; BYTE $0x7A; BYTE $0x7E; BYTE $0x3E + +#define VMOVQ_SI_X11(n) BYTE $0xC5; BYTE $0x7A; BYTE $0x7E; BYTE $0x5E; BYTE $n +#define VMOVQ_SI_X12(n) BYTE $0xC5; BYTE $0x7A; BYTE $0x7E; BYTE $0x66; BYTE $n +#define VMOVQ_SI_X13(n) BYTE $0xC5; BYTE $0x7A; BYTE $0x7E; BYTE $0x6E; BYTE $n +#define VMOVQ_SI_X14(n) BYTE $0xC5; BYTE $0x7A; BYTE $0x7E; BYTE $0x76; BYTE $n +#define VMOVQ_SI_X15(n) BYTE $0xC5; BYTE $0x7A; BYTE $0x7E; BYTE $0x7E; BYTE $n + +#define VPINSRQ_1_SI_X11_0 BYTE $0xC4; BYTE $0x63; BYTE $0xA1; BYTE $0x22; BYTE $0x1E; BYTE $0x01 +#define VPINSRQ_1_SI_X12_0 BYTE $0xC4; BYTE $0x63; BYTE $0x99; BYTE $0x22; BYTE $0x26; BYTE $0x01 +#define VPINSRQ_1_SI_X13_0 BYTE $0xC4; BYTE $0x63; BYTE $0x91; BYTE $0x22; BYTE $0x2E; BYTE $0x01 +#define VPINSRQ_1_SI_X14_0 BYTE $0xC4; BYTE $0x63; BYTE $0x89; BYTE $0x22; BYTE $0x36; BYTE $0x01 +#define VPINSRQ_1_SI_X15_0 BYTE $0xC4; BYTE $0x63; BYTE $0x81; BYTE $0x22; BYTE $0x3E; BYTE $0x01 + +#define VPINSRQ_1_SI_X11(n) BYTE $0xC4; BYTE $0x63; BYTE $0xA1; BYTE $0x22; BYTE $0x5E; BYTE $n; BYTE $0x01 +#define VPINSRQ_1_SI_X12(n) BYTE $0xC4; BYTE $0x63; BYTE $0x99; BYTE $0x22; BYTE $0x66; BYTE $n; BYTE $0x01 +#define VPINSRQ_1_SI_X13(n) BYTE $0xC4; BYTE $0x63; BYTE $0x91; BYTE $0x22; BYTE $0x6E; BYTE $n; BYTE $0x01 +#define VPINSRQ_1_SI_X14(n) BYTE $0xC4; BYTE $0x63; BYTE $0x89; BYTE $0x22; BYTE $0x76; BYTE $n; BYTE $0x01 +#define VPINSRQ_1_SI_X15(n) BYTE $0xC4; BYTE $0x63; BYTE $0x81; BYTE $0x22; BYTE $0x7E; BYTE $n; BYTE $0x01 + +#define VMOVQ_R8_X15 BYTE $0xC4; BYTE $0x41; BYTE $0xF9; BYTE $0x6E; BYTE $0xF8 +#define VPINSRQ_1_R9_X15 BYTE $0xC4; BYTE $0x43; BYTE $0x81; BYTE $0x22; BYTE $0xF9; BYTE $0x01 + +// load msg: Y12 = (i0, i1, i2, i3) +// i0, i1, i2, i3 must not be 0 +#define LOAD_MSG_AVX2_Y12(i0, i1, i2, i3) \ + VMOVQ_SI_X12(i0*8); \ + VMOVQ_SI_X11(i2*8); \ + VPINSRQ_1_SI_X12(i1*8); \ + VPINSRQ_1_SI_X11(i3*8); \ + VINSERTI128 $1, X11, Y12, Y12 + +// load msg: Y13 = (i0, i1, i2, i3) +// i0, i1, i2, i3 must not be 0 +#define LOAD_MSG_AVX2_Y13(i0, i1, i2, i3) \ + VMOVQ_SI_X13(i0*8); \ + VMOVQ_SI_X11(i2*8); \ + VPINSRQ_1_SI_X13(i1*8); \ + VPINSRQ_1_SI_X11(i3*8); \ + VINSERTI128 $1, X11, Y13, Y13 + +// load msg: Y14 = (i0, i1, i2, i3) +// i0, i1, i2, i3 must not be 0 +#define LOAD_MSG_AVX2_Y14(i0, i1, i2, i3) \ + VMOVQ_SI_X14(i0*8); \ + VMOVQ_SI_X11(i2*8); \ + VPINSRQ_1_SI_X14(i1*8); \ + VPINSRQ_1_SI_X11(i3*8); \ + VINSERTI128 $1, X11, Y14, Y14 + +// load msg: Y15 = (i0, i1, i2, i3) +// i0, i1, i2, i3 must not be 0 +#define LOAD_MSG_AVX2_Y15(i0, i1, i2, i3) \ + VMOVQ_SI_X15(i0*8); \ + VMOVQ_SI_X11(i2*8); \ + VPINSRQ_1_SI_X15(i1*8); \ + VPINSRQ_1_SI_X11(i3*8); \ + VINSERTI128 $1, X11, Y15, Y15 + +#define LOAD_MSG_AVX2_0_2_4_6_1_3_5_7_8_10_12_14_9_11_13_15() \ + VMOVQ_SI_X12_0; \ + VMOVQ_SI_X11(4*8); \ + VPINSRQ_1_SI_X12(2*8); \ + VPINSRQ_1_SI_X11(6*8); \ + VINSERTI128 $1, X11, Y12, Y12; \ + LOAD_MSG_AVX2_Y13(1, 3, 5, 7); \ + LOAD_MSG_AVX2_Y14(8, 10, 12, 14); \ + LOAD_MSG_AVX2_Y15(9, 11, 13, 15) + +#define LOAD_MSG_AVX2_14_4_9_13_10_8_15_6_1_0_11_5_12_2_7_3() \ + LOAD_MSG_AVX2_Y12(14, 4, 9, 13); \ + LOAD_MSG_AVX2_Y13(10, 8, 15, 6); \ + VMOVQ_SI_X11(11*8); \ + VPSHUFD $0x4E, 0*8(SI), X14; \ + VPINSRQ_1_SI_X11(5*8); \ + VINSERTI128 $1, X11, Y14, Y14; \ + LOAD_MSG_AVX2_Y15(12, 2, 7, 3) + +#define LOAD_MSG_AVX2_11_12_5_15_8_0_2_13_10_3_7_9_14_6_1_4() \ + VMOVQ_SI_X11(5*8); \ + VMOVDQU 11*8(SI), X12; \ + VPINSRQ_1_SI_X11(15*8); \ + VINSERTI128 $1, X11, Y12, Y12; \ + VMOVQ_SI_X13(8*8); \ + VMOVQ_SI_X11(2*8); \ + VPINSRQ_1_SI_X13_0; \ + VPINSRQ_1_SI_X11(13*8); \ + VINSERTI128 $1, X11, Y13, Y13; \ + LOAD_MSG_AVX2_Y14(10, 3, 7, 9); \ + LOAD_MSG_AVX2_Y15(14, 6, 1, 4) + +#define LOAD_MSG_AVX2_7_3_13_11_9_1_12_14_2_5_4_15_6_10_0_8() \ + LOAD_MSG_AVX2_Y12(7, 3, 13, 11); \ + LOAD_MSG_AVX2_Y13(9, 1, 12, 14); \ + LOAD_MSG_AVX2_Y14(2, 5, 4, 15); \ + VMOVQ_SI_X15(6*8); \ + VMOVQ_SI_X11_0; \ + VPINSRQ_1_SI_X15(10*8); \ + VPINSRQ_1_SI_X11(8*8); \ + VINSERTI128 $1, X11, Y15, Y15 + +#define LOAD_MSG_AVX2_9_5_2_10_0_7_4_15_14_11_6_3_1_12_8_13() \ + LOAD_MSG_AVX2_Y12(9, 5, 2, 10); \ + VMOVQ_SI_X13_0; \ + VMOVQ_SI_X11(4*8); \ + VPINSRQ_1_SI_X13(7*8); \ + VPINSRQ_1_SI_X11(15*8); \ + VINSERTI128 $1, X11, Y13, Y13; \ + LOAD_MSG_AVX2_Y14(14, 11, 6, 3); \ + LOAD_MSG_AVX2_Y15(1, 12, 8, 13) + +#define LOAD_MSG_AVX2_2_6_0_8_12_10_11_3_4_7_15_1_13_5_14_9() \ + VMOVQ_SI_X12(2*8); \ + VMOVQ_SI_X11_0; \ + VPINSRQ_1_SI_X12(6*8); \ + VPINSRQ_1_SI_X11(8*8); \ + VINSERTI128 $1, X11, Y12, Y12; \ + LOAD_MSG_AVX2_Y13(12, 10, 11, 3); \ + LOAD_MSG_AVX2_Y14(4, 7, 15, 1); \ + LOAD_MSG_AVX2_Y15(13, 5, 14, 9) + +#define LOAD_MSG_AVX2_12_1_14_4_5_15_13_10_0_6_9_8_7_3_2_11() \ + LOAD_MSG_AVX2_Y12(12, 1, 14, 4); \ + LOAD_MSG_AVX2_Y13(5, 15, 13, 10); \ + VMOVQ_SI_X14_0; \ + VPSHUFD $0x4E, 8*8(SI), X11; \ + VPINSRQ_1_SI_X14(6*8); \ + VINSERTI128 $1, X11, Y14, Y14; \ + LOAD_MSG_AVX2_Y15(7, 3, 2, 11) + +#define LOAD_MSG_AVX2_13_7_12_3_11_14_1_9_5_15_8_2_0_4_6_10() \ + LOAD_MSG_AVX2_Y12(13, 7, 12, 3); \ + LOAD_MSG_AVX2_Y13(11, 14, 1, 9); \ + LOAD_MSG_AVX2_Y14(5, 15, 8, 2); \ + VMOVQ_SI_X15_0; \ + VMOVQ_SI_X11(6*8); \ + VPINSRQ_1_SI_X15(4*8); \ + VPINSRQ_1_SI_X11(10*8); \ + VINSERTI128 $1, X11, Y15, Y15 + +#define LOAD_MSG_AVX2_6_14_11_0_15_9_3_8_12_13_1_10_2_7_4_5() \ + VMOVQ_SI_X12(6*8); \ + VMOVQ_SI_X11(11*8); \ + VPINSRQ_1_SI_X12(14*8); \ + VPINSRQ_1_SI_X11_0; \ + VINSERTI128 $1, X11, Y12, Y12; \ + LOAD_MSG_AVX2_Y13(15, 9, 3, 8); \ + VMOVQ_SI_X11(1*8); \ + VMOVDQU 12*8(SI), X14; \ + VPINSRQ_1_SI_X11(10*8); \ + VINSERTI128 $1, X11, Y14, Y14; \ + VMOVQ_SI_X15(2*8); \ + VMOVDQU 4*8(SI), X11; \ + VPINSRQ_1_SI_X15(7*8); \ + VINSERTI128 $1, X11, Y15, Y15 + +#define LOAD_MSG_AVX2_10_8_7_1_2_4_6_5_15_9_3_13_11_14_12_0() \ + LOAD_MSG_AVX2_Y12(10, 8, 7, 1); \ + VMOVQ_SI_X13(2*8); \ + VPSHUFD $0x4E, 5*8(SI), X11; \ + VPINSRQ_1_SI_X13(4*8); \ + VINSERTI128 $1, X11, Y13, Y13; \ + LOAD_MSG_AVX2_Y14(15, 9, 3, 13); \ + VMOVQ_SI_X15(11*8); \ + VMOVQ_SI_X11(12*8); \ + VPINSRQ_1_SI_X15(14*8); \ + VPINSRQ_1_SI_X11_0; \ + VINSERTI128 $1, X11, Y15, Y15 + +// func hashBlocksAVX2(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) +TEXT ·hashBlocksAVX2(SB), 4, $320-48 // frame size = 288 + 32 byte alignment + MOVQ h+0(FP), AX + MOVQ c+8(FP), BX + MOVQ flag+16(FP), CX + MOVQ blocks_base+24(FP), SI + MOVQ blocks_len+32(FP), DI + + MOVQ SP, DX + MOVQ SP, R9 + ADDQ $31, R9 + ANDQ $~31, R9 + MOVQ R9, SP + + MOVQ CX, 16(SP) + XORQ CX, CX + MOVQ CX, 24(SP) + + VMOVDQU ·AVX2_c40<>(SB), Y4 + VMOVDQU ·AVX2_c48<>(SB), Y5 + + VMOVDQU 0(AX), Y8 + VMOVDQU 32(AX), Y9 + VMOVDQU ·AVX2_iv0<>(SB), Y6 + VMOVDQU ·AVX2_iv1<>(SB), Y7 + + MOVQ 0(BX), R8 + MOVQ 8(BX), R9 + MOVQ R9, 8(SP) + +loop: + ADDQ $128, R8 + MOVQ R8, 0(SP) + CMPQ R8, $128 + JGE noinc + INCQ R9 + MOVQ R9, 8(SP) + +noinc: + VMOVDQA Y8, Y0 + VMOVDQA Y9, Y1 + VMOVDQA Y6, Y2 + VPXOR 0(SP), Y7, Y3 + + LOAD_MSG_AVX2_0_2_4_6_1_3_5_7_8_10_12_14_9_11_13_15() + VMOVDQA Y12, 32(SP) + VMOVDQA Y13, 64(SP) + VMOVDQA Y14, 96(SP) + VMOVDQA Y15, 128(SP) + ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) + LOAD_MSG_AVX2_14_4_9_13_10_8_15_6_1_0_11_5_12_2_7_3() + VMOVDQA Y12, 160(SP) + VMOVDQA Y13, 192(SP) + VMOVDQA Y14, 224(SP) + VMOVDQA Y15, 256(SP) + + ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) + LOAD_MSG_AVX2_11_12_5_15_8_0_2_13_10_3_7_9_14_6_1_4() + ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) + LOAD_MSG_AVX2_7_3_13_11_9_1_12_14_2_5_4_15_6_10_0_8() + ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) + LOAD_MSG_AVX2_9_5_2_10_0_7_4_15_14_11_6_3_1_12_8_13() + ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) + LOAD_MSG_AVX2_2_6_0_8_12_10_11_3_4_7_15_1_13_5_14_9() + ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) + LOAD_MSG_AVX2_12_1_14_4_5_15_13_10_0_6_9_8_7_3_2_11() + ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) + LOAD_MSG_AVX2_13_7_12_3_11_14_1_9_5_15_8_2_0_4_6_10() + ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) + LOAD_MSG_AVX2_6_14_11_0_15_9_3_8_12_13_1_10_2_7_4_5() + ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) + LOAD_MSG_AVX2_10_8_7_1_2_4_6_5_15_9_3_13_11_14_12_0() + ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) + + ROUND_AVX2(32(SP), 64(SP), 96(SP), 128(SP), Y10, Y4, Y5) + ROUND_AVX2(160(SP), 192(SP), 224(SP), 256(SP), Y10, Y4, Y5) + + VPXOR Y0, Y8, Y8 + VPXOR Y1, Y9, Y9 + VPXOR Y2, Y8, Y8 + VPXOR Y3, Y9, Y9 + + LEAQ 128(SI), SI + SUBQ $128, DI + JNE loop + + MOVQ R8, 0(BX) + MOVQ R9, 8(BX) + + VMOVDQU Y8, 0(AX) + VMOVDQU Y9, 32(AX) + VZEROUPPER + + MOVQ DX, SP + RET + +#define VPUNPCKLQDQ_X2_X2_X15 BYTE $0xC5; BYTE $0x69; BYTE $0x6C; BYTE $0xFA +#define VPUNPCKLQDQ_X3_X3_X15 BYTE $0xC5; BYTE $0x61; BYTE $0x6C; BYTE $0xFB +#define VPUNPCKLQDQ_X7_X7_X15 BYTE $0xC5; BYTE $0x41; BYTE $0x6C; BYTE $0xFF +#define VPUNPCKLQDQ_X13_X13_X15 BYTE $0xC4; BYTE $0x41; BYTE $0x11; BYTE $0x6C; BYTE $0xFD +#define VPUNPCKLQDQ_X14_X14_X15 BYTE $0xC4; BYTE $0x41; BYTE $0x09; BYTE $0x6C; BYTE $0xFE + +#define VPUNPCKHQDQ_X15_X2_X2 BYTE $0xC4; BYTE $0xC1; BYTE $0x69; BYTE $0x6D; BYTE $0xD7 +#define VPUNPCKHQDQ_X15_X3_X3 BYTE $0xC4; BYTE $0xC1; BYTE $0x61; BYTE $0x6D; BYTE $0xDF +#define VPUNPCKHQDQ_X15_X6_X6 BYTE $0xC4; BYTE $0xC1; BYTE $0x49; BYTE $0x6D; BYTE $0xF7 +#define VPUNPCKHQDQ_X15_X7_X7 BYTE $0xC4; BYTE $0xC1; BYTE $0x41; BYTE $0x6D; BYTE $0xFF +#define VPUNPCKHQDQ_X15_X3_X2 BYTE $0xC4; BYTE $0xC1; BYTE $0x61; BYTE $0x6D; BYTE $0xD7 +#define VPUNPCKHQDQ_X15_X7_X6 BYTE $0xC4; BYTE $0xC1; BYTE $0x41; BYTE $0x6D; BYTE $0xF7 +#define VPUNPCKHQDQ_X15_X13_X3 BYTE $0xC4; BYTE $0xC1; BYTE $0x11; BYTE $0x6D; BYTE $0xDF +#define VPUNPCKHQDQ_X15_X13_X7 BYTE $0xC4; BYTE $0xC1; BYTE $0x11; BYTE $0x6D; BYTE $0xFF + +#define SHUFFLE_AVX() \ + VMOVDQA X6, X13; \ + VMOVDQA X2, X14; \ + VMOVDQA X4, X6; \ + VPUNPCKLQDQ_X13_X13_X15; \ + VMOVDQA X5, X4; \ + VMOVDQA X6, X5; \ + VPUNPCKHQDQ_X15_X7_X6; \ + VPUNPCKLQDQ_X7_X7_X15; \ + VPUNPCKHQDQ_X15_X13_X7; \ + VPUNPCKLQDQ_X3_X3_X15; \ + VPUNPCKHQDQ_X15_X2_X2; \ + VPUNPCKLQDQ_X14_X14_X15; \ + VPUNPCKHQDQ_X15_X3_X3; \ + +#define SHUFFLE_AVX_INV() \ + VMOVDQA X2, X13; \ + VMOVDQA X4, X14; \ + VPUNPCKLQDQ_X2_X2_X15; \ + VMOVDQA X5, X4; \ + VPUNPCKHQDQ_X15_X3_X2; \ + VMOVDQA X14, X5; \ + VPUNPCKLQDQ_X3_X3_X15; \ + VMOVDQA X6, X14; \ + VPUNPCKHQDQ_X15_X13_X3; \ + VPUNPCKLQDQ_X7_X7_X15; \ + VPUNPCKHQDQ_X15_X6_X6; \ + VPUNPCKLQDQ_X14_X14_X15; \ + VPUNPCKHQDQ_X15_X7_X7; \ + +#define HALF_ROUND_AVX(v0, v1, v2, v3, v4, v5, v6, v7, m0, m1, m2, m3, t0, c40, c48) \ + VPADDQ m0, v0, v0; \ + VPADDQ v2, v0, v0; \ + VPADDQ m1, v1, v1; \ + VPADDQ v3, v1, v1; \ + VPXOR v0, v6, v6; \ + VPXOR v1, v7, v7; \ + VPSHUFD $-79, v6, v6; \ + VPSHUFD $-79, v7, v7; \ + VPADDQ v6, v4, v4; \ + VPADDQ v7, v5, v5; \ + VPXOR v4, v2, v2; \ + VPXOR v5, v3, v3; \ + VPSHUFB c40, v2, v2; \ + VPSHUFB c40, v3, v3; \ + VPADDQ m2, v0, v0; \ + VPADDQ v2, v0, v0; \ + VPADDQ m3, v1, v1; \ + VPADDQ v3, v1, v1; \ + VPXOR v0, v6, v6; \ + VPXOR v1, v7, v7; \ + VPSHUFB c48, v6, v6; \ + VPSHUFB c48, v7, v7; \ + VPADDQ v6, v4, v4; \ + VPADDQ v7, v5, v5; \ + VPXOR v4, v2, v2; \ + VPXOR v5, v3, v3; \ + VPADDQ v2, v2, t0; \ + VPSRLQ $63, v2, v2; \ + VPXOR t0, v2, v2; \ + VPADDQ v3, v3, t0; \ + VPSRLQ $63, v3, v3; \ + VPXOR t0, v3, v3 + +// load msg: X12 = (i0, i1), X13 = (i2, i3), X14 = (i4, i5), X15 = (i6, i7) +// i0, i1, i2, i3, i4, i5, i6, i7 must not be 0 +#define LOAD_MSG_AVX(i0, i1, i2, i3, i4, i5, i6, i7) \ + VMOVQ_SI_X12(i0*8); \ + VMOVQ_SI_X13(i2*8); \ + VMOVQ_SI_X14(i4*8); \ + VMOVQ_SI_X15(i6*8); \ + VPINSRQ_1_SI_X12(i1*8); \ + VPINSRQ_1_SI_X13(i3*8); \ + VPINSRQ_1_SI_X14(i5*8); \ + VPINSRQ_1_SI_X15(i7*8) + +// load msg: X12 = (0, 2), X13 = (4, 6), X14 = (1, 3), X15 = (5, 7) +#define LOAD_MSG_AVX_0_2_4_6_1_3_5_7() \ + VMOVQ_SI_X12_0; \ + VMOVQ_SI_X13(4*8); \ + VMOVQ_SI_X14(1*8); \ + VMOVQ_SI_X15(5*8); \ + VPINSRQ_1_SI_X12(2*8); \ + VPINSRQ_1_SI_X13(6*8); \ + VPINSRQ_1_SI_X14(3*8); \ + VPINSRQ_1_SI_X15(7*8) + +// load msg: X12 = (1, 0), X13 = (11, 5), X14 = (12, 2), X15 = (7, 3) +#define LOAD_MSG_AVX_1_0_11_5_12_2_7_3() \ + VPSHUFD $0x4E, 0*8(SI), X12; \ + VMOVQ_SI_X13(11*8); \ + VMOVQ_SI_X14(12*8); \ + VMOVQ_SI_X15(7*8); \ + VPINSRQ_1_SI_X13(5*8); \ + VPINSRQ_1_SI_X14(2*8); \ + VPINSRQ_1_SI_X15(3*8) + +// load msg: X12 = (11, 12), X13 = (5, 15), X14 = (8, 0), X15 = (2, 13) +#define LOAD_MSG_AVX_11_12_5_15_8_0_2_13() \ + VMOVDQU 11*8(SI), X12; \ + VMOVQ_SI_X13(5*8); \ + VMOVQ_SI_X14(8*8); \ + VMOVQ_SI_X15(2*8); \ + VPINSRQ_1_SI_X13(15*8); \ + VPINSRQ_1_SI_X14_0; \ + VPINSRQ_1_SI_X15(13*8) + +// load msg: X12 = (2, 5), X13 = (4, 15), X14 = (6, 10), X15 = (0, 8) +#define LOAD_MSG_AVX_2_5_4_15_6_10_0_8() \ + VMOVQ_SI_X12(2*8); \ + VMOVQ_SI_X13(4*8); \ + VMOVQ_SI_X14(6*8); \ + VMOVQ_SI_X15_0; \ + VPINSRQ_1_SI_X12(5*8); \ + VPINSRQ_1_SI_X13(15*8); \ + VPINSRQ_1_SI_X14(10*8); \ + VPINSRQ_1_SI_X15(8*8) + +// load msg: X12 = (9, 5), X13 = (2, 10), X14 = (0, 7), X15 = (4, 15) +#define LOAD_MSG_AVX_9_5_2_10_0_7_4_15() \ + VMOVQ_SI_X12(9*8); \ + VMOVQ_SI_X13(2*8); \ + VMOVQ_SI_X14_0; \ + VMOVQ_SI_X15(4*8); \ + VPINSRQ_1_SI_X12(5*8); \ + VPINSRQ_1_SI_X13(10*8); \ + VPINSRQ_1_SI_X14(7*8); \ + VPINSRQ_1_SI_X15(15*8) + +// load msg: X12 = (2, 6), X13 = (0, 8), X14 = (12, 10), X15 = (11, 3) +#define LOAD_MSG_AVX_2_6_0_8_12_10_11_3() \ + VMOVQ_SI_X12(2*8); \ + VMOVQ_SI_X13_0; \ + VMOVQ_SI_X14(12*8); \ + VMOVQ_SI_X15(11*8); \ + VPINSRQ_1_SI_X12(6*8); \ + VPINSRQ_1_SI_X13(8*8); \ + VPINSRQ_1_SI_X14(10*8); \ + VPINSRQ_1_SI_X15(3*8) + +// load msg: X12 = (0, 6), X13 = (9, 8), X14 = (7, 3), X15 = (2, 11) +#define LOAD_MSG_AVX_0_6_9_8_7_3_2_11() \ + MOVQ 0*8(SI), X12; \ + VPSHUFD $0x4E, 8*8(SI), X13; \ + MOVQ 7*8(SI), X14; \ + MOVQ 2*8(SI), X15; \ + VPINSRQ_1_SI_X12(6*8); \ + VPINSRQ_1_SI_X14(3*8); \ + VPINSRQ_1_SI_X15(11*8) + +// load msg: X12 = (6, 14), X13 = (11, 0), X14 = (15, 9), X15 = (3, 8) +#define LOAD_MSG_AVX_6_14_11_0_15_9_3_8() \ + MOVQ 6*8(SI), X12; \ + MOVQ 11*8(SI), X13; \ + MOVQ 15*8(SI), X14; \ + MOVQ 3*8(SI), X15; \ + VPINSRQ_1_SI_X12(14*8); \ + VPINSRQ_1_SI_X13_0; \ + VPINSRQ_1_SI_X14(9*8); \ + VPINSRQ_1_SI_X15(8*8) + +// load msg: X12 = (5, 15), X13 = (8, 2), X14 = (0, 4), X15 = (6, 10) +#define LOAD_MSG_AVX_5_15_8_2_0_4_6_10() \ + MOVQ 5*8(SI), X12; \ + MOVQ 8*8(SI), X13; \ + MOVQ 0*8(SI), X14; \ + MOVQ 6*8(SI), X15; \ + VPINSRQ_1_SI_X12(15*8); \ + VPINSRQ_1_SI_X13(2*8); \ + VPINSRQ_1_SI_X14(4*8); \ + VPINSRQ_1_SI_X15(10*8) + +// load msg: X12 = (12, 13), X13 = (1, 10), X14 = (2, 7), X15 = (4, 5) +#define LOAD_MSG_AVX_12_13_1_10_2_7_4_5() \ + VMOVDQU 12*8(SI), X12; \ + MOVQ 1*8(SI), X13; \ + MOVQ 2*8(SI), X14; \ + VPINSRQ_1_SI_X13(10*8); \ + VPINSRQ_1_SI_X14(7*8); \ + VMOVDQU 4*8(SI), X15 + +// load msg: X12 = (15, 9), X13 = (3, 13), X14 = (11, 14), X15 = (12, 0) +#define LOAD_MSG_AVX_15_9_3_13_11_14_12_0() \ + MOVQ 15*8(SI), X12; \ + MOVQ 3*8(SI), X13; \ + MOVQ 11*8(SI), X14; \ + MOVQ 12*8(SI), X15; \ + VPINSRQ_1_SI_X12(9*8); \ + VPINSRQ_1_SI_X13(13*8); \ + VPINSRQ_1_SI_X14(14*8); \ + VPINSRQ_1_SI_X15_0 + +// func hashBlocksAVX(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) +TEXT ·hashBlocksAVX(SB), 4, $288-48 // frame size = 272 + 16 byte alignment + MOVQ h+0(FP), AX + MOVQ c+8(FP), BX + MOVQ flag+16(FP), CX + MOVQ blocks_base+24(FP), SI + MOVQ blocks_len+32(FP), DI + + MOVQ SP, BP + MOVQ SP, R9 + ADDQ $15, R9 + ANDQ $~15, R9 + MOVQ R9, SP + + VMOVDQU ·AVX_c40<>(SB), X0 + VMOVDQU ·AVX_c48<>(SB), X1 + VMOVDQA X0, X8 + VMOVDQA X1, X9 + + VMOVDQU ·AVX_iv3<>(SB), X0 + VMOVDQA X0, 0(SP) + XORQ CX, 0(SP) // 0(SP) = ·AVX_iv3 ^ (CX || 0) + + VMOVDQU 0(AX), X10 + VMOVDQU 16(AX), X11 + VMOVDQU 32(AX), X2 + VMOVDQU 48(AX), X3 + + MOVQ 0(BX), R8 + MOVQ 8(BX), R9 + +loop: + ADDQ $128, R8 + CMPQ R8, $128 + JGE noinc + INCQ R9 + +noinc: + VMOVQ_R8_X15 + VPINSRQ_1_R9_X15 + + VMOVDQA X10, X0 + VMOVDQA X11, X1 + VMOVDQU ·AVX_iv0<>(SB), X4 + VMOVDQU ·AVX_iv1<>(SB), X5 + VMOVDQU ·AVX_iv2<>(SB), X6 + + VPXOR X15, X6, X6 + VMOVDQA 0(SP), X7 + + LOAD_MSG_AVX_0_2_4_6_1_3_5_7() + VMOVDQA X12, 16(SP) + VMOVDQA X13, 32(SP) + VMOVDQA X14, 48(SP) + VMOVDQA X15, 64(SP) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX() + LOAD_MSG_AVX(8, 10, 12, 14, 9, 11, 13, 15) + VMOVDQA X12, 80(SP) + VMOVDQA X13, 96(SP) + VMOVDQA X14, 112(SP) + VMOVDQA X15, 128(SP) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX_INV() + + LOAD_MSG_AVX(14, 4, 9, 13, 10, 8, 15, 6) + VMOVDQA X12, 144(SP) + VMOVDQA X13, 160(SP) + VMOVDQA X14, 176(SP) + VMOVDQA X15, 192(SP) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX() + LOAD_MSG_AVX_1_0_11_5_12_2_7_3() + VMOVDQA X12, 208(SP) + VMOVDQA X13, 224(SP) + VMOVDQA X14, 240(SP) + VMOVDQA X15, 256(SP) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX_INV() + + LOAD_MSG_AVX_11_12_5_15_8_0_2_13() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX() + LOAD_MSG_AVX(10, 3, 7, 9, 14, 6, 1, 4) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX_INV() + + LOAD_MSG_AVX(7, 3, 13, 11, 9, 1, 12, 14) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX() + LOAD_MSG_AVX_2_5_4_15_6_10_0_8() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX_INV() + + LOAD_MSG_AVX_9_5_2_10_0_7_4_15() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX() + LOAD_MSG_AVX(14, 11, 6, 3, 1, 12, 8, 13) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX_INV() + + LOAD_MSG_AVX_2_6_0_8_12_10_11_3() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX() + LOAD_MSG_AVX(4, 7, 15, 1, 13, 5, 14, 9) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX_INV() + + LOAD_MSG_AVX(12, 1, 14, 4, 5, 15, 13, 10) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX() + LOAD_MSG_AVX_0_6_9_8_7_3_2_11() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX_INV() + + LOAD_MSG_AVX(13, 7, 12, 3, 11, 14, 1, 9) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX() + LOAD_MSG_AVX_5_15_8_2_0_4_6_10() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX_INV() + + LOAD_MSG_AVX_6_14_11_0_15_9_3_8() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX() + LOAD_MSG_AVX_12_13_1_10_2_7_4_5() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX_INV() + + LOAD_MSG_AVX(10, 8, 7, 1, 2, 4, 6, 5) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX() + LOAD_MSG_AVX_15_9_3_13_11_14_12_0() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) + SHUFFLE_AVX_INV() + + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 16(SP), 32(SP), 48(SP), 64(SP), X15, X8, X9) + SHUFFLE_AVX() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 80(SP), 96(SP), 112(SP), 128(SP), X15, X8, X9) + SHUFFLE_AVX_INV() + + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 144(SP), 160(SP), 176(SP), 192(SP), X15, X8, X9) + SHUFFLE_AVX() + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 208(SP), 224(SP), 240(SP), 256(SP), X15, X8, X9) + SHUFFLE_AVX_INV() + + VMOVDQU 32(AX), X14 + VMOVDQU 48(AX), X15 + VPXOR X0, X10, X10 + VPXOR X1, X11, X11 + VPXOR X2, X14, X14 + VPXOR X3, X15, X15 + VPXOR X4, X10, X10 + VPXOR X5, X11, X11 + VPXOR X6, X14, X2 + VPXOR X7, X15, X3 + VMOVDQU X2, 32(AX) + VMOVDQU X3, 48(AX) + + LEAQ 128(SI), SI + SUBQ $128, DI + JNE loop + + VMOVDQU X10, 0(AX) + VMOVDQU X11, 16(AX) + + MOVQ R8, 0(BX) + MOVQ R9, 8(BX) + VZEROUPPER + + MOVQ BP, SP + RET + +// func supportsAVX2() bool +TEXT ·supportsAVX2(SB), 4, $0-1 + MOVQ runtime·support_avx2(SB), AX + MOVB AX, ret+0(FP) + RET + +// func supportsAVX() bool +TEXT ·supportsAVX(SB), 4, $0-1 + MOVQ runtime·support_avx(SB), AX + MOVB AX, ret+0(FP) + RET diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go b/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go new file mode 100644 index 000000000..2ab7c30fc --- /dev/null +++ b/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go @@ -0,0 +1,25 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !go1.7,amd64,!gccgo,!appengine + +package blake2b + +func init() { + useSSE4 = supportsSSE4() +} + +//go:noescape +func supportsSSE4() bool + +//go:noescape +func hashBlocksSSE4(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) + +func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) { + if useSSE4 { + hashBlocksSSE4(h, c, flag, blocks) + } else { + hashBlocksGeneric(h, c, flag, blocks) + } +} diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s b/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s new file mode 100644 index 000000000..64530740b --- /dev/null +++ b/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s @@ -0,0 +1,290 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build amd64,!gccgo,!appengine + +#include "textflag.h" + +DATA ·iv0<>+0x00(SB)/8, $0x6a09e667f3bcc908 +DATA ·iv0<>+0x08(SB)/8, $0xbb67ae8584caa73b +GLOBL ·iv0<>(SB), (NOPTR+RODATA), $16 + +DATA ·iv1<>+0x00(SB)/8, $0x3c6ef372fe94f82b +DATA ·iv1<>+0x08(SB)/8, $0xa54ff53a5f1d36f1 +GLOBL ·iv1<>(SB), (NOPTR+RODATA), $16 + +DATA ·iv2<>+0x00(SB)/8, $0x510e527fade682d1 +DATA ·iv2<>+0x08(SB)/8, $0x9b05688c2b3e6c1f +GLOBL ·iv2<>(SB), (NOPTR+RODATA), $16 + +DATA ·iv3<>+0x00(SB)/8, $0x1f83d9abfb41bd6b +DATA ·iv3<>+0x08(SB)/8, $0x5be0cd19137e2179 +GLOBL ·iv3<>(SB), (NOPTR+RODATA), $16 + +DATA ·c40<>+0x00(SB)/8, $0x0201000706050403 +DATA ·c40<>+0x08(SB)/8, $0x0a09080f0e0d0c0b +GLOBL ·c40<>(SB), (NOPTR+RODATA), $16 + +DATA ·c48<>+0x00(SB)/8, $0x0100070605040302 +DATA ·c48<>+0x08(SB)/8, $0x09080f0e0d0c0b0a +GLOBL ·c48<>(SB), (NOPTR+RODATA), $16 + +#define SHUFFLE(v2, v3, v4, v5, v6, v7, t1, t2) \ + MOVO v4, t1; \ + MOVO v5, v4; \ + MOVO t1, v5; \ + MOVO v6, t1; \ + PUNPCKLQDQ v6, t2; \ + PUNPCKHQDQ v7, v6; \ + PUNPCKHQDQ t2, v6; \ + PUNPCKLQDQ v7, t2; \ + MOVO t1, v7; \ + MOVO v2, t1; \ + PUNPCKHQDQ t2, v7; \ + PUNPCKLQDQ v3, t2; \ + PUNPCKHQDQ t2, v2; \ + PUNPCKLQDQ t1, t2; \ + PUNPCKHQDQ t2, v3 + +#define SHUFFLE_INV(v2, v3, v4, v5, v6, v7, t1, t2) \ + MOVO v4, t1; \ + MOVO v5, v4; \ + MOVO t1, v5; \ + MOVO v2, t1; \ + PUNPCKLQDQ v2, t2; \ + PUNPCKHQDQ v3, v2; \ + PUNPCKHQDQ t2, v2; \ + PUNPCKLQDQ v3, t2; \ + MOVO t1, v3; \ + MOVO v6, t1; \ + PUNPCKHQDQ t2, v3; \ + PUNPCKLQDQ v7, t2; \ + PUNPCKHQDQ t2, v6; \ + PUNPCKLQDQ t1, t2; \ + PUNPCKHQDQ t2, v7 + +#define HALF_ROUND(v0, v1, v2, v3, v4, v5, v6, v7, m0, m1, m2, m3, t0, c40, c48) \ + PADDQ m0, v0; \ + PADDQ m1, v1; \ + PADDQ v2, v0; \ + PADDQ v3, v1; \ + PXOR v0, v6; \ + PXOR v1, v7; \ + PSHUFD $0xB1, v6, v6; \ + PSHUFD $0xB1, v7, v7; \ + PADDQ v6, v4; \ + PADDQ v7, v5; \ + PXOR v4, v2; \ + PXOR v5, v3; \ + PSHUFB c40, v2; \ + PSHUFB c40, v3; \ + PADDQ m2, v0; \ + PADDQ m3, v1; \ + PADDQ v2, v0; \ + PADDQ v3, v1; \ + PXOR v0, v6; \ + PXOR v1, v7; \ + PSHUFB c48, v6; \ + PSHUFB c48, v7; \ + PADDQ v6, v4; \ + PADDQ v7, v5; \ + PXOR v4, v2; \ + PXOR v5, v3; \ + MOVOU v2, t0; \ + PADDQ v2, t0; \ + PSRLQ $63, v2; \ + PXOR t0, v2; \ + MOVOU v3, t0; \ + PADDQ v3, t0; \ + PSRLQ $63, v3; \ + PXOR t0, v3 + +#define LOAD_MSG(m0, m1, m2, m3, src, i0, i1, i2, i3, i4, i5, i6, i7) \ + MOVQ i0*8(src), m0; \ + PINSRQ $1, i1*8(src), m0; \ + MOVQ i2*8(src), m1; \ + PINSRQ $1, i3*8(src), m1; \ + MOVQ i4*8(src), m2; \ + PINSRQ $1, i5*8(src), m2; \ + MOVQ i6*8(src), m3; \ + PINSRQ $1, i7*8(src), m3 + +// func hashBlocksSSE4(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) +TEXT ·hashBlocksSSE4(SB), 4, $288-48 // frame size = 272 + 16 byte alignment + MOVQ h+0(FP), AX + MOVQ c+8(FP), BX + MOVQ flag+16(FP), CX + MOVQ blocks_base+24(FP), SI + MOVQ blocks_len+32(FP), DI + + MOVQ SP, BP + MOVQ SP, R9 + ADDQ $15, R9 + ANDQ $~15, R9 + MOVQ R9, SP + + MOVOU ·iv3<>(SB), X0 + MOVO X0, 0(SP) + XORQ CX, 0(SP) // 0(SP) = ·iv3 ^ (CX || 0) + + MOVOU ·c40<>(SB), X13 + MOVOU ·c48<>(SB), X14 + + MOVOU 0(AX), X12 + MOVOU 16(AX), X15 + + MOVQ 0(BX), R8 + MOVQ 8(BX), R9 + +loop: + ADDQ $128, R8 + CMPQ R8, $128 + JGE noinc + INCQ R9 + +noinc: + MOVQ R8, X8 + PINSRQ $1, R9, X8 + + MOVO X12, X0 + MOVO X15, X1 + MOVOU 32(AX), X2 + MOVOU 48(AX), X3 + MOVOU ·iv0<>(SB), X4 + MOVOU ·iv1<>(SB), X5 + MOVOU ·iv2<>(SB), X6 + + PXOR X8, X6 + MOVO 0(SP), X7 + + LOAD_MSG(X8, X9, X10, X11, SI, 0, 2, 4, 6, 1, 3, 5, 7) + MOVO X8, 16(SP) + MOVO X9, 32(SP) + MOVO X10, 48(SP) + MOVO X11, 64(SP) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + LOAD_MSG(X8, X9, X10, X11, SI, 8, 10, 12, 14, 9, 11, 13, 15) + MOVO X8, 80(SP) + MOVO X9, 96(SP) + MOVO X10, 112(SP) + MOVO X11, 128(SP) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) + + LOAD_MSG(X8, X9, X10, X11, SI, 14, 4, 9, 13, 10, 8, 15, 6) + MOVO X8, 144(SP) + MOVO X9, 160(SP) + MOVO X10, 176(SP) + MOVO X11, 192(SP) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + LOAD_MSG(X8, X9, X10, X11, SI, 1, 0, 11, 5, 12, 2, 7, 3) + MOVO X8, 208(SP) + MOVO X9, 224(SP) + MOVO X10, 240(SP) + MOVO X11, 256(SP) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) + + LOAD_MSG(X8, X9, X10, X11, SI, 11, 12, 5, 15, 8, 0, 2, 13) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + LOAD_MSG(X8, X9, X10, X11, SI, 10, 3, 7, 9, 14, 6, 1, 4) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) + + LOAD_MSG(X8, X9, X10, X11, SI, 7, 3, 13, 11, 9, 1, 12, 14) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + LOAD_MSG(X8, X9, X10, X11, SI, 2, 5, 4, 15, 6, 10, 0, 8) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) + + LOAD_MSG(X8, X9, X10, X11, SI, 9, 5, 2, 10, 0, 7, 4, 15) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + LOAD_MSG(X8, X9, X10, X11, SI, 14, 11, 6, 3, 1, 12, 8, 13) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) + + LOAD_MSG(X8, X9, X10, X11, SI, 2, 6, 0, 8, 12, 10, 11, 3) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + LOAD_MSG(X8, X9, X10, X11, SI, 4, 7, 15, 1, 13, 5, 14, 9) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) + + LOAD_MSG(X8, X9, X10, X11, SI, 12, 1, 14, 4, 5, 15, 13, 10) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + LOAD_MSG(X8, X9, X10, X11, SI, 0, 6, 9, 8, 7, 3, 2, 11) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) + + LOAD_MSG(X8, X9, X10, X11, SI, 13, 7, 12, 3, 11, 14, 1, 9) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + LOAD_MSG(X8, X9, X10, X11, SI, 5, 15, 8, 2, 0, 4, 6, 10) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) + + LOAD_MSG(X8, X9, X10, X11, SI, 6, 14, 11, 0, 15, 9, 3, 8) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + LOAD_MSG(X8, X9, X10, X11, SI, 12, 13, 1, 10, 2, 7, 4, 5) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) + + LOAD_MSG(X8, X9, X10, X11, SI, 10, 8, 7, 1, 2, 4, 6, 5) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + LOAD_MSG(X8, X9, X10, X11, SI, 15, 9, 3, 13, 11, 14, 12, 0) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) + + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 16(SP), 32(SP), 48(SP), 64(SP), X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 80(SP), 96(SP), 112(SP), 128(SP), X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) + + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 144(SP), 160(SP), 176(SP), 192(SP), X11, X13, X14) + SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 208(SP), 224(SP), 240(SP), 256(SP), X11, X13, X14) + SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) + + MOVOU 32(AX), X10 + MOVOU 48(AX), X11 + PXOR X0, X12 + PXOR X1, X15 + PXOR X2, X10 + PXOR X3, X11 + PXOR X4, X12 + PXOR X5, X15 + PXOR X6, X10 + PXOR X7, X11 + MOVOU X10, 32(AX) + MOVOU X11, 48(AX) + + LEAQ 128(SI), SI + SUBQ $128, DI + JNE loop + + MOVOU X12, 0(AX) + MOVOU X15, 16(AX) + + MOVQ R8, 0(BX) + MOVQ R9, 8(BX) + + MOVQ BP, SP + RET + +// func supportsSSE4() bool +TEXT ·supportsSSE4(SB), 4, $0-1 + MOVL $1, AX + CPUID + SHRL $19, CX // Bit 19 indicates SSE4 support + ANDL $1, CX // CX != 0 if support SSE4 + MOVB CX, ret+0(FP) + RET diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b_generic.go b/vendor/golang.org/x/crypto/blake2b/blake2b_generic.go new file mode 100644 index 000000000..4bd2abc91 --- /dev/null +++ b/vendor/golang.org/x/crypto/blake2b/blake2b_generic.go @@ -0,0 +1,179 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package blake2b + +import "encoding/binary" + +// the precomputed values for BLAKE2b +// there are 12 16-byte arrays - one for each round +// the entries are calculated from the sigma constants. +var precomputed = [12][16]byte{ + {0, 2, 4, 6, 1, 3, 5, 7, 8, 10, 12, 14, 9, 11, 13, 15}, + {14, 4, 9, 13, 10, 8, 15, 6, 1, 0, 11, 5, 12, 2, 7, 3}, + {11, 12, 5, 15, 8, 0, 2, 13, 10, 3, 7, 9, 14, 6, 1, 4}, + {7, 3, 13, 11, 9, 1, 12, 14, 2, 5, 4, 15, 6, 10, 0, 8}, + {9, 5, 2, 10, 0, 7, 4, 15, 14, 11, 6, 3, 1, 12, 8, 13}, + {2, 6, 0, 8, 12, 10, 11, 3, 4, 7, 15, 1, 13, 5, 14, 9}, + {12, 1, 14, 4, 5, 15, 13, 10, 0, 6, 9, 8, 7, 3, 2, 11}, + {13, 7, 12, 3, 11, 14, 1, 9, 5, 15, 8, 2, 0, 4, 6, 10}, + {6, 14, 11, 0, 15, 9, 3, 8, 12, 13, 1, 10, 2, 7, 4, 5}, + {10, 8, 7, 1, 2, 4, 6, 5, 15, 9, 3, 13, 11, 14, 12, 0}, + {0, 2, 4, 6, 1, 3, 5, 7, 8, 10, 12, 14, 9, 11, 13, 15}, // equal to the first + {14, 4, 9, 13, 10, 8, 15, 6, 1, 0, 11, 5, 12, 2, 7, 3}, // equal to the second +} + +func hashBlocksGeneric(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) { + var m [16]uint64 + c0, c1 := c[0], c[1] + + for i := 0; i < len(blocks); { + c0 += BlockSize + if c0 < BlockSize { + c1++ + } + + v0, v1, v2, v3, v4, v5, v6, v7 := h[0], h[1], h[2], h[3], h[4], h[5], h[6], h[7] + v8, v9, v10, v11, v12, v13, v14, v15 := iv[0], iv[1], iv[2], iv[3], iv[4], iv[5], iv[6], iv[7] + v12 ^= c0 + v13 ^= c1 + v14 ^= flag + + for j := range m { + m[j] = binary.LittleEndian.Uint64(blocks[i:]) + i += 8 + } + + for j := range precomputed { + s := &(precomputed[j]) + + v0 += m[s[0]] + v0 += v4 + v12 ^= v0 + v12 = v12<<(64-32) | v12>>32 + v8 += v12 + v4 ^= v8 + v4 = v4<<(64-24) | v4>>24 + v1 += m[s[1]] + v1 += v5 + v13 ^= v1 + v13 = v13<<(64-32) | v13>>32 + v9 += v13 + v5 ^= v9 + v5 = v5<<(64-24) | v5>>24 + v2 += m[s[2]] + v2 += v6 + v14 ^= v2 + v14 = v14<<(64-32) | v14>>32 + v10 += v14 + v6 ^= v10 + v6 = v6<<(64-24) | v6>>24 + v3 += m[s[3]] + v3 += v7 + v15 ^= v3 + v15 = v15<<(64-32) | v15>>32 + v11 += v15 + v7 ^= v11 + v7 = v7<<(64-24) | v7>>24 + + v0 += m[s[4]] + v0 += v4 + v12 ^= v0 + v12 = v12<<(64-16) | v12>>16 + v8 += v12 + v4 ^= v8 + v4 = v4<<(64-63) | v4>>63 + v1 += m[s[5]] + v1 += v5 + v13 ^= v1 + v13 = v13<<(64-16) | v13>>16 + v9 += v13 + v5 ^= v9 + v5 = v5<<(64-63) | v5>>63 + v2 += m[s[6]] + v2 += v6 + v14 ^= v2 + v14 = v14<<(64-16) | v14>>16 + v10 += v14 + v6 ^= v10 + v6 = v6<<(64-63) | v6>>63 + v3 += m[s[7]] + v3 += v7 + v15 ^= v3 + v15 = v15<<(64-16) | v15>>16 + v11 += v15 + v7 ^= v11 + v7 = v7<<(64-63) | v7>>63 + + v0 += m[s[8]] + v0 += v5 + v15 ^= v0 + v15 = v15<<(64-32) | v15>>32 + v10 += v15 + v5 ^= v10 + v5 = v5<<(64-24) | v5>>24 + v1 += m[s[9]] + v1 += v6 + v12 ^= v1 + v12 = v12<<(64-32) | v12>>32 + v11 += v12 + v6 ^= v11 + v6 = v6<<(64-24) | v6>>24 + v2 += m[s[10]] + v2 += v7 + v13 ^= v2 + v13 = v13<<(64-32) | v13>>32 + v8 += v13 + v7 ^= v8 + v7 = v7<<(64-24) | v7>>24 + v3 += m[s[11]] + v3 += v4 + v14 ^= v3 + v14 = v14<<(64-32) | v14>>32 + v9 += v14 + v4 ^= v9 + v4 = v4<<(64-24) | v4>>24 + + v0 += m[s[12]] + v0 += v5 + v15 ^= v0 + v15 = v15<<(64-16) | v15>>16 + v10 += v15 + v5 ^= v10 + v5 = v5<<(64-63) | v5>>63 + v1 += m[s[13]] + v1 += v6 + v12 ^= v1 + v12 = v12<<(64-16) | v12>>16 + v11 += v12 + v6 ^= v11 + v6 = v6<<(64-63) | v6>>63 + v2 += m[s[14]] + v2 += v7 + v13 ^= v2 + v13 = v13<<(64-16) | v13>>16 + v8 += v13 + v7 ^= v8 + v7 = v7<<(64-63) | v7>>63 + v3 += m[s[15]] + v3 += v4 + v14 ^= v3 + v14 = v14<<(64-16) | v14>>16 + v9 += v14 + v4 ^= v9 + v4 = v4<<(64-63) | v4>>63 + + } + + h[0] ^= v0 ^ v8 + h[1] ^= v1 ^ v9 + h[2] ^= v2 ^ v10 + h[3] ^= v3 ^ v11 + h[4] ^= v4 ^ v12 + h[5] ^= v5 ^ v13 + h[6] ^= v6 ^ v14 + h[7] ^= v7 ^ v15 + } + c[0], c[1] = c0, c1 +} diff --git a/vendor/golang.org/x/crypto/blake2b/blake2x.go b/vendor/golang.org/x/crypto/blake2b/blake2x.go new file mode 100644 index 000000000..c814496a7 --- /dev/null +++ b/vendor/golang.org/x/crypto/blake2b/blake2x.go @@ -0,0 +1,177 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package blake2b + +import ( + "encoding/binary" + "errors" + "io" +) + +// XOF defines the interface to hash functions that +// support arbitrary-length output. +type XOF interface { + // Write absorbs more data into the hash's state. It panics if called + // after Read. + io.Writer + + // Read reads more output from the hash. It returns io.EOF if the limit + // has been reached. + io.Reader + + // Clone returns a copy of the XOF in its current state. + Clone() XOF + + // Reset resets the XOF to its initial state. + Reset() +} + +// OutputLengthUnknown can be used as the size argument to NewXOF to indicate +// the the length of the output is not known in advance. +const OutputLengthUnknown = 0 + +// magicUnknownOutputLength is a magic value for the output size that indicates +// an unknown number of output bytes. +const magicUnknownOutputLength = (1 << 32) - 1 + +// maxOutputLength is the absolute maximum number of bytes to produce when the +// number of output bytes is unknown. +const maxOutputLength = (1 << 32) * 64 + +// NewXOF creates a new variable-output-length hash. The hash either produce a +// known number of bytes (1 <= size < 2**32-1), or an unknown number of bytes +// (size == OutputLengthUnknown). In the latter case, an absolute limit of +// 256GiB applies. +// +// A non-nil key turns the hash into a MAC. The key must between +// zero and 32 bytes long. +func NewXOF(size uint32, key []byte) (XOF, error) { + if len(key) > Size { + return nil, errKeySize + } + if size == magicUnknownOutputLength { + // 2^32-1 indicates an unknown number of bytes and thus isn't a + // valid length. + return nil, errors.New("blake2b: XOF length too large") + } + if size == OutputLengthUnknown { + size = magicUnknownOutputLength + } + x := &xof{ + d: digest{ + size: Size, + keyLen: len(key), + }, + length: size, + } + copy(x.d.key[:], key) + x.Reset() + return x, nil +} + +type xof struct { + d digest + length uint32 + remaining uint64 + cfg, root, block [Size]byte + offset int + nodeOffset uint32 + readMode bool +} + +func (x *xof) Write(p []byte) (n int, err error) { + if x.readMode { + panic("blake2b: write to XOF after read") + } + return x.d.Write(p) +} + +func (x *xof) Clone() XOF { + clone := *x + return &clone +} + +func (x *xof) Reset() { + x.cfg[0] = byte(Size) + binary.LittleEndian.PutUint32(x.cfg[4:], uint32(Size)) // leaf length + binary.LittleEndian.PutUint32(x.cfg[12:], x.length) // XOF length + x.cfg[17] = byte(Size) // inner hash size + + x.d.Reset() + x.d.h[1] ^= uint64(x.length) << 32 + + x.remaining = uint64(x.length) + if x.remaining == magicUnknownOutputLength { + x.remaining = maxOutputLength + } + x.offset, x.nodeOffset = 0, 0 + x.readMode = false +} + +func (x *xof) Read(p []byte) (n int, err error) { + if !x.readMode { + x.d.finalize(&x.root) + x.readMode = true + } + + if x.remaining == 0 { + return 0, io.EOF + } + + n = len(p) + if uint64(n) > x.remaining { + n = int(x.remaining) + p = p[:n] + } + + if x.offset > 0 { + blockRemaining := Size - x.offset + if n < blockRemaining { + x.offset += copy(p, x.block[x.offset:]) + x.remaining -= uint64(n) + return + } + copy(p, x.block[x.offset:]) + p = p[blockRemaining:] + x.offset = 0 + x.remaining -= uint64(blockRemaining) + } + + for len(p) >= Size { + binary.LittleEndian.PutUint32(x.cfg[8:], x.nodeOffset) + x.nodeOffset++ + + x.d.initConfig(&x.cfg) + x.d.Write(x.root[:]) + x.d.finalize(&x.block) + + copy(p, x.block[:]) + p = p[Size:] + x.remaining -= uint64(Size) + } + + if todo := len(p); todo > 0 { + if x.remaining < uint64(Size) { + x.cfg[0] = byte(x.remaining) + } + binary.LittleEndian.PutUint32(x.cfg[8:], x.nodeOffset) + x.nodeOffset++ + + x.d.initConfig(&x.cfg) + x.d.Write(x.root[:]) + x.d.finalize(&x.block) + + x.offset = copy(p, x.block[:todo]) + x.remaining -= uint64(todo) + } + return +} + +func (d *digest) initConfig(cfg *[Size]byte) { + d.offset, d.c[0], d.c[1] = 0, 0, 0 + for i := range d.h { + d.h[i] = iv[i] ^ binary.LittleEndian.Uint64(cfg[i*8:]) + } +} diff --git a/vendor/golang.org/x/crypto/blake2b/register.go b/vendor/golang.org/x/crypto/blake2b/register.go new file mode 100644 index 000000000..efd689af4 --- /dev/null +++ b/vendor/golang.org/x/crypto/blake2b/register.go @@ -0,0 +1,32 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.9 + +package blake2b + +import ( + "crypto" + "hash" +) + +func init() { + newHash256 := func() hash.Hash { + h, _ := New256(nil) + return h + } + newHash384 := func() hash.Hash { + h, _ := New384(nil) + return h + } + + newHash512 := func() hash.Hash { + h, _ := New512(nil) + return h + } + + crypto.RegisterHash(crypto.BLAKE2b_256, newHash256) + crypto.RegisterHash(crypto.BLAKE2b_384, newHash384) + crypto.RegisterHash(crypto.BLAKE2b_512, newHash512) +} diff --git a/vendor/vendor.json b/vendor/vendor.json index ab20a7786..1a38adc04 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -1290,6 +1290,12 @@ "path": "golang.org/x/crypto/ssh/terminal", "revision": "eb71ad9bd329b5ac0fd0148dd99bd62e8be8e035", "revisionTime": "2017-08-07T10:11:13Z" + }, + { + "checksumSHA1": "pE9lQ5mMiW10+m6CS9XQDhSACNU=", + "path": "golang.org/x/crypto/blake2b", + "revision": "eb71ad9bd329b5ac0fd0148dd99bd62e8be8e035", + "revisionTime": "2017-08-07T10:11:13Z" }, { "checksumSHA1": "9jjO5GjLa0XF/nfWihF02RoH4qc=", diff --git a/website/source/api/acl-policies.html.md b/website/source/api/acl-policies.html.md new file mode 100644 index 000000000..a9891b18a --- /dev/null +++ b/website/source/api/acl-policies.html.md @@ -0,0 +1,162 @@ +--- +layout: api +page_title: ACL Policies - HTTP API +sidebar_current: api-acl-policies +description: |- + The /acl/policy endpoints are used to configure and manage ACL policies. +--- + +# ACL Policies HTTP API + +The `/acl/policies` and `/acl/policy/` endpoints are used to manage ACL policies. +For more details about ACLs, please see the [ACL Guide](/guides/acl.html). + +## List Policies + +This endpoint lists all ACL policies. This lists the policies that have been replicated +to the region, and may lag behind the authoritative region. + +| Method | Path | Produces | +| ------ | ---------------------------- | -------------------------- | +| `GET` | `/acl/policies` | `application/json` | + +The table below shows this endpoint's support for +[blocking queries](/api/index.html#blocking-queries), [consistency modes](/api/index.html#consistency-modes) and +[required ACLs](/api/index.html#acls). + +| Blocking Queries | Consistency Modes | ACL Required | +| ---------------- | ----------------- | ------------ | +| `YES` | `all` | `management` | + + +### Sample Request + +```text +$ curl \ + https://nomad.rocks/v1/acl/policies +``` + +### Sample Response + +```json +[ + { + "Name": "foo", + "Description": "", + "CreateIndex": 12, + "ModifyIndex": 13, + } +] +``` + +## Create or Update Policy + +This endpoint creates or updates an ACL Policy. This request is always forwarded to the +authoritative region. + +| Method | Path | Produces | +| ------ | ---------------------------- | -------------------------- | +| `POST` | `/acl/policy/:policy_name` | `(empty body)` | + +The table below shows this endpoint's support for +[blocking queries](/api/index.html#blocking-queries) and +[required ACLs](/api/index.html#acls). + +| Blocking Queries | ACL Required | +| ---------------- | ------------------ | +| `NO` | `management` | + +### Parameters + +- `Name` `(string: )` - Specifies the name of the policy. + Creates the policy if the name does not exist, otherwise updates the existing policy. + +- `Description` `(string: )` - Specifies a human readable description. + +- `Rules` `(string: )` - Specifies the Policy rules in HCL or JSON format. + +### Sample Payload + +```json +{ + "Name": "my-policy", + "Description": "This is a great policy", + "Rules": "" +} +``` + +### Sample Request + +```text +$ curl \ + --request POST \ + --data @payload.json \ + https://nomad.rocks/v1/acl/policy/my-policy +``` + +## Read Policy + +This endpoint reads an ACL policy with the given name. This queries the policy that have been +replicated to the region, and may lag behind the authoritative region. + + +| Method | Path | Produces | +| ------ | ---------------------------- | -------------------------- | +| `GET` | `/acl/policy/:policy_name` | `application/json` | + +The table below shows this endpoint's support for +[blocking queries](/api/index.html#blocking-queries), [consistency modes](/api/index.html#consistency-modes) and +[required ACLs](/api/index.html#acls). + +| Blocking Queries | Consistency Modes | ACL Required | +| ---------------- | ----------------- | ------------ | +| `YES` | `all` | `management` | + +### Sample Request + +```text +$ curl \ + https://nomad.rocks/v1/acl/policy/foo +``` + +### Sample Response + +```json +{ + "Name": "foo", + "Rules": "", + "Description": "", + "CreateIndex": 12, + "ModifyIndex": 13 +} +``` + +## Delete Policy + +This endpoint deletes the named ACL policy. This request is always forwarded to the +authoritative region. + +| Method | Path | Produces | +| -------- | ---------------------------- | -------------------------- | +| `DELETE` | `/acl/policy/:policy_name` | `(empty body)` | + +The table below shows this endpoint's support for +[blocking queries](/api/index.html#blocking-queries) and +[required ACLs](/api/index.html#acls). + +| Blocking Queries | ACL Required | +| ---------------- | ------------- | +| `NO` | `management` | + +### Parameters + +- `policy_name` `(string: )` - Specifies the policy name to delete. + +### Sample Request + +```text +$ curl \ + --request DELETE \ + https://nomad.rocks/v1/acl/policy/foo +``` + diff --git a/website/source/api/acl-tokens.html.md b/website/source/api/acl-tokens.html.md new file mode 100644 index 000000000..f5fe576fb --- /dev/null +++ b/website/source/api/acl-tokens.html.md @@ -0,0 +1,298 @@ +--- +layout: api +page_title: ACL Tokens - HTTP API +sidebar_current: api-acl-tokens +description: |- + The /acl/token/ endpoints are used to configure and manage ACL tokens. +--- + +# ACL Tokens HTTP API + +The `/acl/bootstrap`, `/acl/tokens`, and `/acl/token/` endpoints are used to manage ACL tokens. +For more details about ACLs, please see the [ACL Guide](/guides/acl.html). + +## Bootstrap Token + +This endpoint is used to bootstrap the ACL system and provide the initial management token. +This request is always forwarded to the authoritative region. It can only be invoked once. + +| Method | Path | Produces | +| ------ | ---------------------------- | -------------------------- | +| `POST` | `/acl/bootstrap` | `application/json` | + +The table below shows this endpoint's support for +[blocking queries](/api/index.html#blocking-queries) and +[required ACLs](/api/index.html#acls). + +| Blocking Queries | ACL Required | +| ---------------- | ------------------ | +| `NO` | `none` | + +### Sample Request + +```text +$ curl \ + --request POST \ + https://nomad.rocks/v1/acl/bootstrap +``` + +### Sample Response + +```json +{ + "AccessorID":"b780e702-98ce-521f-2e5f-c6b87de05b24", + "SecretID":"3f4a0fcd-7c42-773c-25db-2d31ba0c05fe", + "Name":"Bootstrap Token", + "Type":"management", + "Policies":null, + "Global":true, + "CreateTime":"2017-08-23T22:47:14.695408057Z", + "CreateIndex":7, + "ModifyIndex":7 +} +``` + +## List Tokens + +This endpoint lists all ACL tokens. This lists the local tokens and the global +tokens which have been replicated to the region, and may lag behind the authoritative region. + +| Method | Path | Produces | +| ------ | ---------------------------- | -------------------------- | +| `GET` | `/acl/tokens` | `application/json` | + +The table below shows this endpoint's support for +[blocking queries](/api/index.html#blocking-queries), [consistency modes](/api/index.html#consistency-modes) and +[required ACLs](/api/index.html#acls). + +| Blocking Queries | Consistency Modes | ACL Required | +| ---------------- | ----------------- | ------------ | +| `YES` | `all` | `management` | + + +### Sample Request + +```text +$ curl \ + https://nomad.rocks/v1/acl/tokens +``` + +### Sample Response + +```json +[ + { + "AccessorID": "b780e702-98ce-521f-2e5f-c6b87de05b24", + "Name": "Bootstrap Token", + "Type": "management", + "Policies": null, + "Global": true, + "CreateTime": "2017-08-23T22:47:14.695408057Z", + "CreateIndex": 7, + "ModifyIndex": 7 + } +] +``` + +## Create Token + +This endpoint creates an ACL Token. If the token is a global token, the request +is forwarded to the authoritative region. + +| Method | Path | Produces | +| ------ | ---------------------------- | -------------------------- | +| `POST` | `/acl/token` | `application/json` | + +The table below shows this endpoint's support for +[blocking queries](/api/index.html#blocking-queries) and +[required ACLs](/api/index.html#acls). + +| Blocking Queries | ACL Required | +| ---------------- | ------------------ | +| `NO` | `management` | + +### Parameters + +- `Name` `(string: )` - Specifies the human readable name of the token. + +- `Type` `(string: )` - Specifies the type of token. Must be either `client` or `management`. + +- `Policies` `(array: )` - Must be null or blank for `management` type tokens, otherwise must specify at least one policy for `client` type tokens. + +- `Global` `(bool: )` - If true, indicates this token should be replicated globally to all regions. Otherwise, this token is created local to the target region. + +### Sample Payload + +```json +{ + "Name": "Readonly token", + "Type": "client", + "Policies": ["readonly"], + "Global": false +} +``` + +### Sample Request + +```text +$ curl \ + --request POST \ + --data @payload.json \ + https://nomad.rocks/v1/acl/token +``` + +### Sample Response + +```json +{ + "AccessorID": "aa534e09-6a07-0a45-2295-a7f77063d429", + "SecretID": "8176afd3-772d-0b71-8f85-7fa5d903e9d4", + "Name": "Readonly token", + "Type": "client", + "Policies": [ + "readonly" + ], + "Global": false, + "CreateTime": "2017-08-23T23:25:41.429154233Z", + "CreateIndex": 52, + "ModifyIndex": 52 +} +``` + +## Update Token + +This endpoint updates an existing ACL Token. If the token is a global token, the request +is forwarded to the authoritative region. Note that a token cannot be switched from global +to local or visa versa. + +| Method | Path | Produces | +| ------ | ---------------------------- | -------------------------- | +| `POST` | `/acl/token/:accessor_id` | `application/json` | + +The table below shows this endpoint's support for +[blocking queries](/api/index.html#blocking-queries) and +[required ACLs](/api/index.html#acls). + +| Blocking Queries | ACL Required | +| ---------------- | ------------------ | +| `NO` | `management` | + +### Parameters + +- `AccessorID` `(string: )` - Specifies the token (by accessor) that is being updated. Must match payload body and request path. + +- `Name` `(string: )` - Specifies the human readable name of the token. + +- `Type` `(string: )` - Specifies the type of token. Must be either `client` or `management`. + +- `Policies` `(array: )` - Must be null or blank for `management` type tokens, otherwise must specify at least one policy for `client` type tokens. + +### Sample Payload + +```json +{ + "AccessorID": "aa534e09-6a07-0a45-2295-a7f77063d429", + "Name": "Read-write token", + "Type": "client", + "Policies": ["readwrite"], +} +``` + +### Sample Request + +```text +$ curl \ + --request POST \ + --data @payload.json \ + https://nomad.rocks/v1/acl/token/aa534e09-6a07-0a45-2295-a7f77063d429 +``` + +### Sample Response + +```json +{ + "AccessorID": "aa534e09-6a07-0a45-2295-a7f77063d429", + "SecretID": "8176afd3-772d-0b71-8f85-7fa5d903e9d4", + "Name": "Read-write token", + "Type": "client", + "Policies": [ + "readwrite" + ], + "Global": false, + "CreateTime": "2017-08-23T23:25:41.429154233Z", + "CreateIndex": 52, + "ModifyIndex": 64 +} +``` + +## Read Token + +This endpoint reads an ACL token with the given accessor. If the token is a global token +which has been replicated to the region it may lag behind the authoritative region. + +| Method | Path | Produces | +| ------ | ---------------------------- | -------------------------- | +| `GET` | `/acl/token/:accessor_id` | `application/json` | + +The table below shows this endpoint's support for +[blocking queries](/api/index.html#blocking-queries), [consistency modes](/api/index.html#consistency-modes) and +[required ACLs](/api/index.html#acls). + +| Blocking Queries | Consistency Modes | ACL Required | +| ---------------- | ----------------- | ------------ | +| `YES` | `all` | `management` | + +### Sample Request + +```text +$ curl \ + https://nomad.rocks/v1/acl/token/aa534e09-6a07-0a45-2295-a7f77063d429 +``` + +### Sample Response + +```json +{ + "AccessorID": "aa534e09-6a07-0a45-2295-a7f77063d429", + "SecretID": "8176afd3-772d-0b71-8f85-7fa5d903e9d4", + "Name": "Read-write token", + "Type": "client", + "Policies": [ + "readwrite" + ], + "Global": false, + "CreateTime": "2017-08-23T23:25:41.429154233Z", + "CreateIndex": 52, + "ModifyIndex": 64 +} +``` + +## Delete Token + +This endpoint deletes the ACL token by accessor. This request is forwarded to the +authoritative region for global tokens. + +| Method | Path | Produces | +| -------- | ---------------------------- | -------------------------- | +| `DELETE` | `/acl/token/:accessor_id` | `(empty body)` | + +The table below shows this endpoint's support for +[blocking queries](/api/index.html#blocking-queries) and +[required ACLs](/api/index.html#acls). + +| Blocking Queries | ACL Required | +| ---------------- | ------------- | +| `NO` | `management` | + +### Parameters + +- `accessor_id` `(string: )` - Specifies the ACL token accessor ID. + +### Sample Request + +```text +$ curl \ + --request DELETE \ + https://nomad.rocks/v1/acl/token/aa534e09-6a07-0a45-2295-a7f77063d429 +``` + diff --git a/website/source/api/index.html.md b/website/source/api/index.html.md index 0cd44ad60..856ae4061 100644 --- a/website/source/api/index.html.md +++ b/website/source/api/index.html.md @@ -73,11 +73,21 @@ administration. ## ACLs -The Nomad API does not support ACLs at this time. +Several endpoints in Nomad use or require ACL tokens to operate. The token are used to authenticate the request and determine if the request is allowed based on the associated authorizations. Tokens are specified per-request by using the `X-Nomad-Token` request header set to the `SecretID` of an ACL Token. + +For more details about ACLs, please see the [ACL Guide](/guides/acl.html). ## Authentication -The Nomad API does not support authentication at this time. +When ACLs are enabled, a Nomad token should be provided to API requests using the `X-Nomad-Token` header. When using authentication, clients should communicate via TLS. + +Here is an example using curl: + +```text +$ curl \ + --header "X-Nomad-Token: aa534e09-6a07-0a45-2295-a7f77063d429" \ + https://nomad.rocks/v1/jobs +``` ## Blocking Queries diff --git a/website/source/assets/images/acl.jpg b/website/source/assets/images/acl.jpg new file mode 100644 index 000000000..9e9338235 --- /dev/null +++ b/website/source/assets/images/acl.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8d0d99cbeb263dfe8315629363e9e98541fc3651725b74ecbf59966dfd4b5b4 +size 51650 diff --git a/website/source/docs/agent/configuration/acl.html.md b/website/source/docs/agent/configuration/acl.html.md new file mode 100644 index 000000000..0cd0a9c45 --- /dev/null +++ b/website/source/docs/agent/configuration/acl.html.md @@ -0,0 +1,50 @@ +--- +layout: "docs" +page_title: "acl Stanza - Agent Configuration" +sidebar_current: "docs-agent-configuration-acl" +description: |- + The "acl" stanza configures the Nomad agent to enable ACLs and tune various parameters. +--- + +# `acl` Stanza + + + + + + +
Placement + **acl** +
+ +The `acl` stanza configures the Nomad agent to enable ACLs and tunes various ACL parameters. + +```hcl +acl { + enabled = true + token_ttl = "30s" + policy_ttl = "60s" +} +``` + +## `acl` Parameters + +- `enabled` `(bool: false)` - Specifies if ACL enforcement is enabled. All other + client configuration options depend on this value. + +- `token_ttl` `(string: "30s")` - Specifies the maximum time-to-live (TTL) for + cached ACL tokens. This does not affect servers, since they do not cache tokens. + Setting this value lower reduces how stale a token can be, but increases + the request load against servers. If a client cannot reach a server, for example + because of an outage, the TTL will be ignored and the cached value used. + +- `policy_ttl` `(string: "30s")` - Specifies the maximum time-to-live (TTL) for + cached ACL policies. This does not affect servers, since they do not cache policies. + Setting this value lower reduces how stale a policy can be, but increases + the request load against servers. If a client cannot reach a server, for example + because of an outage, the TTL will be ignored and the cached value used. + +- `replication_token` `(string: "")` - Specifies the Secret ID of the ACL token + to use for replicating policies and tokens. This is used by servers in non-authoritative + region to mirror the policies and tokens into the local region. + diff --git a/website/source/docs/agent/configuration/index.html.md b/website/source/docs/agent/configuration/index.html.md index da1164a8b..854c7c395 100644 --- a/website/source/docs/agent/configuration/index.html.md +++ b/website/source/docs/agent/configuration/index.html.md @@ -74,6 +74,8 @@ testing. ## General Parameters +- `acl` ([ACL][acl]: nil) - Specifies configuration which is specific to ACLs. + - `addresses` `(Addresses: see below)` - Specifies the bind address for individual network services. Any values configured in this stanza take precedence over the default [bind_addr](#bind_addr). @@ -230,3 +232,4 @@ http_api_response_headers { [tls]: /docs/agent/configuration/tls.html "Nomad Agent tls Configuration" [client]: /docs/agent/configuration/client.html "Nomad Agent client Configuration" [server]: /docs/agent/configuration/server.html "Nomad Agent server Configuration" +[acl]: /docs/agent/configuration/acl.html "Nomad Agent ACL Configuration" diff --git a/website/source/docs/agent/configuration/server.html.md b/website/source/docs/agent/configuration/server.html.md index 1e55aedc4..265db668d 100644 --- a/website/source/docs/agent/configuration/server.html.md +++ b/website/source/docs/agent/configuration/server.html.md @@ -34,6 +34,11 @@ server { ## `server` Parameters +- `authoritative_region` `(string: "")` - Specifies the authoritative region, which + provides a single source of truth for global configurations such as ACL Policies and + global ACL tokens. Non-authoritative regions will replicate from the authoritative + to act as a mirror. By default, the local region is assumed to be authoritative. + - `bootstrap_expect` `(int: required)` - Specifies the number of server nodes to wait for before bootstrapping. It is most common to use the odd-numbered integers `3` or `5` for this value, depending on the cluster size. A value of diff --git a/website/source/guides/acl.html.markdown b/website/source/guides/acl.html.markdown new file mode 100644 index 000000000..e5b62fb58 --- /dev/null +++ b/website/source/guides/acl.html.markdown @@ -0,0 +1,312 @@ +--- +layout: "guides" +page_title: "ACLs" +sidebar_current: "guides-acl" +description: |- + Don't panic! This is a critical first step. Depending on your deployment + configuration, it may take only a single server failure for cluster + unavailability. Recovery requires an operator to intervene, but recovery is + straightforward. +--- + +# ACL System + +Nomad provides an optional Access Control List (ACL) system which can be used to control access to data and APIs. The ACL is [Capability-based](https://en.wikipedia.org/wiki/Capability-based_security), relying on tokens which are associated with policies to determine which fine grained rules can be applied. Nomad's capability based ACL system is very similar to the design of [AWS IAM](https://aws.amazon.com/iam/). + +# ACL System Overview + +The ACL system is designed to be easy to use and fast to enforce while providing administrative insight. At the highest level, there are three major components to the ACL system: + +![ACL Overview](/assets/images/acl.jpg) + + * **ACL Policies**. No permissions are granted by default, making Nomad a default-deny or whitelist system. Policies allow a set of capabilities or actions to be granted or whitelisted. For example, a "readonly" policy might only grant the ability to list and inspect running jobs, but not to submit new ones. + + * **ACL Tokens**. Requests to Nomad are authenticated by using bearer token. Each ACL token has a public Accessor ID which is used to name a token, and a Secret ID which is used to make requests to Nomad. The Secret ID is provided using a request header (`X-Nomad-Token`) and is used to authenticate the caller. Token are either `management` or `client` types. The `management` tokens are effectively "root" in the system, and can perform any operation. The `client` tokens are associated with one or more ACL policies which grant specific capabilities. + + * **Capabilities**. Capabilties are the set of actions that can be performed. This includes listing jobs, submitting jobs, querying nodes, etc. A `management` token is granted all capabilities, while `client` tokens are granted specific capabilties via ACL Policies. The full set of capabilities is discussed below in the rule specifications. + +### ACL Policies + +An ACL policy is a named set of rules. Each policy must have a unique name, an optional description, and a rule set. +A client ACL token can be associated with multiple policies, and a request is allowed if _any_ of the associated policies grant the capability. +Management tokens cannot be associated with policies because they are granted all capabilities. + +The special `anonymous` policy can be defined to grant capabilities to requests which are made anonymously. An anonymous request is a request made to Nomad without the `X-Nomad-Token` header specified. This can be used to allow anonymous users to list jobs and view their status, while requiring authenticated requests to submit new jobs or modify existing jobs. By default, there is no `anonymous` policy set meaning all anonymous requests are denied. + +### ACL Tokens + +ACL tokens are used to authenticate requests and determine if the caller is authorized to perform an action. Each ACL token has a public Accessor ID which is used to identify the token, a Secret ID which is used to make requests to Nomad, and an optional human readable name. All `client` type tokens are associated with one or more policies, and can perform an action if any associated policy allows it. Tokens can be associated with policies which do not exist, which are the equivalent of granting no capabilities. The `management` type tokens cannot be associated with policies, but can perform any action. + +When ACL tokens are created, they can be optionally marked as `Global`. This causes them to be created in the authoritative region and replicated to all other regions. Otherwise, tokens are created locally in the region the request was made and not replicated. Local tokens cannot be used for cross-region requests since they are not replicated between regions. + +### Capabilities and Scope + +The following table summarizes the ACL Rules that are available for constructing policy rules: + +| Policy | Scope | +| ---------- | -------------------------------------------- | +| [namespace](#namespace-rules) | Job related operations by namespace | +| [agent](#agent-rules) | Utility operations in the Agent API | +| [node](#node-rules) | Node-level catalog operations | +| [operator](#operator-rules) | Cluster-level operations in the Operator API | + +Constructing rules from these policies is covered in detail in the Rule Specification section below. + +### Multi-Region Configuration + +Nomad supports multi-datacenter and multi-region configurations. A single region is able to service multiple datacenters, and all servers in a region replicate their state between each other. In a multi-region configuration, there is a set of servers per region. Each region operates independently and is loosely coupled to allow jobs to be scheduled in any region and requests to flow transparently to the correct region. + +When ACLs are enabled, Nomad depends on an "authoritative region" to act as a single source of truth for ACL policies and global ACL tokens. The authoritative region is configured in the [`server` stanza](/docs/agent/configuration/server.html) of agents, and all regions must share a single a single authoritative source. Any ACL policies or global ACL tokens are created in the authoritative region first. All other regions replicate ACL policies and global ACL tokens to act as local mirrors. This allows policies to be administered centrally, and for enforcement to be local to each region for low latency. + +Global ACL tokens are used to allow cross region requests. Standard ACL tokens are created in a single target region and not replicated. This means if a request takes place between regions, global tokens must be used so that both regions will have the token registered. + +# Configuring ACLs + +ACLs are not enabled by default, and must be enabled. Clients and Servers need to set `enabled` in the [`acl` stanza](/docs/agent/configuration/acl.html). This enables the [ACL Policy](/api/acl-policies.html) and [ACL Token](/api/acl-tokens.html) APIs, as well as endpoint enforcement. + +For multi-region configurations, all servers must be configured to use a single [authoritative region](/docs/agent/configuration/server.html#authoritative_region). The authoritative region is responsible for managing ACL policies and global tokens. Servers in other regions will replicate policies and global tokens to act as a mirror, and must have their [`replication_token`](/docs/agent/configuration/acl.html#replication_token) configured. + +# Bootstrapping ACLs + +Bootstrapping ACLs on a new cluster requires a few steps, outlined below: + +### Enable ACLs on Nomad Servers + +The APIs needed to manage policies and tokens are not enabled until ACLs are enabled. To begin, we need to enable the ACLs on the servers. If a multi-region setup is used, the authoritiative region should be enabled first. For each server: + +1. Set `enabled = true` in the [`acl` stanza](/docs/agent/configuration/acl.html#enabled). +1. Set `authoritative_region` in the [`server` stanza](/docs/agent/configuration/server.html#authoritative_region). +1. For servers outside the authoritative region, set `replication_token` in the [`acl` stanza](/docs/agent/configuration/acl.html#replication_token). Replication tokens should be `management` type tokens which are either created in the authoritative region, or created as Global tokens. +1. Restarting the Nomad server to pick the new configuration. + +Please take care to restart the servers one at a time, and ensure each server has joined and is operating correctly before restarting another. + +### Generate the initial token + +Once the ACL system is enabled, we need to generate our initial token. This first token is used to bootstrap the system and care should be taken not to lose it. Once the ACL system is enabled, we use the [Bootstrap API](/api/acl-tokens.html#bootstrap-token): + +```text +$ curl \ + --request POST \ + https://nomad.rocks/v1/acl/bootstrap?pretty=true +``` +```json +{ + "AccessorID":"b780e702-98ce-521f-2e5f-c6b87de05b24", + "SecretID":"3f4a0fcd-7c42-773c-25db-2d31ba0c05fe", + "Name":"Bootstrap Token", + "Type":"management", + "Policies":null, + "Global":true, + "CreateTime":"2017-08-23T22:47:14.695408057Z", + "CreateIndex":7, + "ModifyIndex":7 +} +``` + +Once the initial bootstrap is performed, it _cannot be performed again_. Make sure to save this AccessorID and SecretID. +The bootstrap token is a `management` type token, meaning it can perform any operation. It should be used to setup the ACL policies and create additional ACL tokens. The bootstrap token can be deleted and is like any other token, so care should be taken to not revoke all management tokens. + +### Enable ACLs on Nomad Clients + +To enforce client endpoints, we need to enable ACLs on clients as well. This is simpler than servers, and we just need to set `enabled = true` in the [`acl` stanza](/docs/agent/configuration/acl.html). Once configured, we need to restart the client for the change. + + +### Set an Anonymous Policy (Optional) + +The ACL system uses a whitelist or default-deny model. This means by default no permissions are granted. +For clients making requests without ACL tokens, we may want to grant some basic level of access. This is done by setting rules +on the special "anonymous" policy. This policy is applied to any requests made without a token. + +To permit anonymous users to read, we can setup the following policy: + +```text +# Store our token secret ID +$ export NOMAD_TOKEN="BOOTSTRAP_SECRET_ID" + +# Write out the payload +$ cat > payload.json < + > + ACL Policies + + + > + ACL Tokens + + > Agent diff --git a/website/source/layouts/docs.erb b/website/source/layouts/docs.erb index ad14e19ec..8db66ab10 100644 --- a/website/source/layouts/docs.erb +++ b/website/source/layouts/docs.erb @@ -300,6 +300,9 @@ > Configuration