2020-09-18 18:05:15 +00:00
|
|
|
// Code generated by mog. DO NOT EDIT.
|
|
|
|
|
|
|
|
package pbservice
|
|
|
|
|
2022-03-23 16:10:03 +00:00
|
|
|
import "github.com/hashicorp/consul/agent/structs"
|
2020-09-18 18:05:15 +00:00
|
|
|
|
2022-03-23 16:10:03 +00:00
|
|
|
func NodeToStructs(s *Node, t *structs.Node) {
|
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
t.ID = NodeIDType(s.ID)
|
2020-09-18 18:05:15 +00:00
|
|
|
t.Node = s.Node
|
|
|
|
t.Address = s.Address
|
|
|
|
t.Datacenter = s.Datacenter
|
2021-07-22 19:33:22 +00:00
|
|
|
t.Partition = s.Partition
|
peering: initial sync (#12842)
- Add endpoints related to peering: read, list, generate token, initiate peering
- Update node/service/check table indexing to account for peers
- Foundational changes for pushing service updates to a peer
- Plumb peer name through Health.ServiceNodes path
see: ENT-1765, ENT-1280, ENT-1283, ENT-1283, ENT-1756, ENT-1739, ENT-1750, ENT-1679,
ENT-1709, ENT-1704, ENT-1690, ENT-1689, ENT-1702, ENT-1701, ENT-1683, ENT-1663,
ENT-1650, ENT-1678, ENT-1628, ENT-1658, ENT-1640, ENT-1637, ENT-1597, ENT-1634,
ENT-1613, ENT-1616, ENT-1617, ENT-1591, ENT-1588, ENT-1596, ENT-1572, ENT-1555
Co-authored-by: R.B. Boyer <rb@hashicorp.com>
Co-authored-by: freddygv <freddy@hashicorp.com>
Co-authored-by: Chris S. Kim <ckim@hashicorp.com>
Co-authored-by: Evan Culver <eculver@hashicorp.com>
Co-authored-by: Nitya Dhanushkodi <nitya@hashicorp.com>
2022-04-21 22:34:40 +00:00
|
|
|
t.PeerName = s.PeerName
|
2020-09-18 18:05:15 +00:00
|
|
|
t.TaggedAddresses = s.TaggedAddresses
|
|
|
|
t.Meta = s.Meta
|
2023-03-10 14:36:15 +00:00
|
|
|
t.Locality = LocalityToStructs(s.Locality)
|
2020-09-18 18:05:15 +00:00
|
|
|
t.RaftIndex = RaftIndexToStructs(s.RaftIndex)
|
|
|
|
}
|
2022-03-23 16:10:03 +00:00
|
|
|
func NodeFromStructs(t *structs.Node, s *Node) {
|
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
s.ID = string(t.ID)
|
2020-09-18 18:05:15 +00:00
|
|
|
s.Node = t.Node
|
|
|
|
s.Address = t.Address
|
|
|
|
s.Datacenter = t.Datacenter
|
2021-07-22 19:33:22 +00:00
|
|
|
s.Partition = t.Partition
|
peering: initial sync (#12842)
- Add endpoints related to peering: read, list, generate token, initiate peering
- Update node/service/check table indexing to account for peers
- Foundational changes for pushing service updates to a peer
- Plumb peer name through Health.ServiceNodes path
see: ENT-1765, ENT-1280, ENT-1283, ENT-1283, ENT-1756, ENT-1739, ENT-1750, ENT-1679,
ENT-1709, ENT-1704, ENT-1690, ENT-1689, ENT-1702, ENT-1701, ENT-1683, ENT-1663,
ENT-1650, ENT-1678, ENT-1628, ENT-1658, ENT-1640, ENT-1637, ENT-1597, ENT-1634,
ENT-1613, ENT-1616, ENT-1617, ENT-1591, ENT-1588, ENT-1596, ENT-1572, ENT-1555
Co-authored-by: R.B. Boyer <rb@hashicorp.com>
Co-authored-by: freddygv <freddy@hashicorp.com>
Co-authored-by: Chris S. Kim <ckim@hashicorp.com>
Co-authored-by: Evan Culver <eculver@hashicorp.com>
Co-authored-by: Nitya Dhanushkodi <nitya@hashicorp.com>
2022-04-21 22:34:40 +00:00
|
|
|
s.PeerName = t.PeerName
|
2020-09-18 18:05:15 +00:00
|
|
|
s.TaggedAddresses = t.TaggedAddresses
|
|
|
|
s.Meta = t.Meta
|
2023-03-10 14:36:15 +00:00
|
|
|
s.Locality = LocalityFromStructs(t.Locality)
|
2020-09-18 18:05:15 +00:00
|
|
|
s.RaftIndex = NewRaftIndexFromStructs(t.RaftIndex)
|
|
|
|
}
|
2022-03-23 16:10:03 +00:00
|
|
|
func NodeServiceToStructs(s *NodeService, t *structs.NodeService) {
|
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
t.Kind = structs.ServiceKind(s.Kind)
|
2020-09-18 18:05:15 +00:00
|
|
|
t.ID = s.ID
|
|
|
|
t.Service = s.Service
|
|
|
|
t.Tags = s.Tags
|
|
|
|
t.Address = s.Address
|
|
|
|
t.TaggedAddresses = MapStringServiceAddressToStructs(s.TaggedAddresses)
|
|
|
|
t.Meta = s.Meta
|
|
|
|
t.Port = int(s.Port)
|
2021-05-05 16:51:40 +00:00
|
|
|
t.SocketPath = s.SocketPath
|
2020-09-18 18:05:15 +00:00
|
|
|
t.Weights = WeightsPtrToStructs(s.Weights)
|
|
|
|
t.EnableTagOverride = s.EnableTagOverride
|
2023-03-10 14:36:15 +00:00
|
|
|
t.Locality = LocalityToStructs(s.Locality)
|
2022-03-23 16:10:03 +00:00
|
|
|
if s.Proxy != nil {
|
|
|
|
ConnectProxyConfigToStructs(s.Proxy, &t.Proxy)
|
|
|
|
}
|
|
|
|
if s.Connect != nil {
|
|
|
|
ServiceConnectToStructs(s.Connect, &t.Connect)
|
|
|
|
}
|
2020-09-18 18:05:15 +00:00
|
|
|
t.LocallyRegisteredAsSidecar = s.LocallyRegisteredAsSidecar
|
|
|
|
t.EnterpriseMeta = EnterpriseMetaToStructs(s.EnterpriseMeta)
|
peering: initial sync (#12842)
- Add endpoints related to peering: read, list, generate token, initiate peering
- Update node/service/check table indexing to account for peers
- Foundational changes for pushing service updates to a peer
- Plumb peer name through Health.ServiceNodes path
see: ENT-1765, ENT-1280, ENT-1283, ENT-1283, ENT-1756, ENT-1739, ENT-1750, ENT-1679,
ENT-1709, ENT-1704, ENT-1690, ENT-1689, ENT-1702, ENT-1701, ENT-1683, ENT-1663,
ENT-1650, ENT-1678, ENT-1628, ENT-1658, ENT-1640, ENT-1637, ENT-1597, ENT-1634,
ENT-1613, ENT-1616, ENT-1617, ENT-1591, ENT-1588, ENT-1596, ENT-1572, ENT-1555
Co-authored-by: R.B. Boyer <rb@hashicorp.com>
Co-authored-by: freddygv <freddy@hashicorp.com>
Co-authored-by: Chris S. Kim <ckim@hashicorp.com>
Co-authored-by: Evan Culver <eculver@hashicorp.com>
Co-authored-by: Nitya Dhanushkodi <nitya@hashicorp.com>
2022-04-21 22:34:40 +00:00
|
|
|
t.PeerName = s.PeerName
|
2020-09-18 18:05:15 +00:00
|
|
|
t.RaftIndex = RaftIndexToStructs(s.RaftIndex)
|
|
|
|
}
|
2022-03-23 16:10:03 +00:00
|
|
|
func NodeServiceFromStructs(t *structs.NodeService, s *NodeService) {
|
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
s.Kind = string(t.Kind)
|
2020-09-18 18:05:15 +00:00
|
|
|
s.ID = t.ID
|
|
|
|
s.Service = t.Service
|
|
|
|
s.Tags = t.Tags
|
|
|
|
s.Address = t.Address
|
|
|
|
s.TaggedAddresses = NewMapStringServiceAddressFromStructs(t.TaggedAddresses)
|
|
|
|
s.Meta = t.Meta
|
|
|
|
s.Port = int32(t.Port)
|
2021-05-05 16:51:40 +00:00
|
|
|
s.SocketPath = t.SocketPath
|
2020-09-18 18:05:15 +00:00
|
|
|
s.Weights = NewWeightsPtrFromStructs(t.Weights)
|
|
|
|
s.EnableTagOverride = t.EnableTagOverride
|
2023-03-10 14:36:15 +00:00
|
|
|
s.Locality = LocalityFromStructs(t.Locality)
|
2022-03-23 16:10:03 +00:00
|
|
|
{
|
|
|
|
var x ConnectProxyConfig
|
|
|
|
ConnectProxyConfigFromStructs(&t.Proxy, &x)
|
|
|
|
s.Proxy = &x
|
|
|
|
}
|
|
|
|
{
|
|
|
|
var x ServiceConnect
|
|
|
|
ServiceConnectFromStructs(&t.Connect, &x)
|
|
|
|
s.Connect = &x
|
|
|
|
}
|
2020-09-18 18:05:15 +00:00
|
|
|
s.LocallyRegisteredAsSidecar = t.LocallyRegisteredAsSidecar
|
|
|
|
s.EnterpriseMeta = NewEnterpriseMetaFromStructs(t.EnterpriseMeta)
|
peering: initial sync (#12842)
- Add endpoints related to peering: read, list, generate token, initiate peering
- Update node/service/check table indexing to account for peers
- Foundational changes for pushing service updates to a peer
- Plumb peer name through Health.ServiceNodes path
see: ENT-1765, ENT-1280, ENT-1283, ENT-1283, ENT-1756, ENT-1739, ENT-1750, ENT-1679,
ENT-1709, ENT-1704, ENT-1690, ENT-1689, ENT-1702, ENT-1701, ENT-1683, ENT-1663,
ENT-1650, ENT-1678, ENT-1628, ENT-1658, ENT-1640, ENT-1637, ENT-1597, ENT-1634,
ENT-1613, ENT-1616, ENT-1617, ENT-1591, ENT-1588, ENT-1596, ENT-1572, ENT-1555
Co-authored-by: R.B. Boyer <rb@hashicorp.com>
Co-authored-by: freddygv <freddy@hashicorp.com>
Co-authored-by: Chris S. Kim <ckim@hashicorp.com>
Co-authored-by: Evan Culver <eculver@hashicorp.com>
Co-authored-by: Nitya Dhanushkodi <nitya@hashicorp.com>
2022-04-21 22:34:40 +00:00
|
|
|
s.PeerName = t.PeerName
|
2020-09-18 18:05:15 +00:00
|
|
|
s.RaftIndex = NewRaftIndexFromStructs(t.RaftIndex)
|
|
|
|
}
|