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 CheckTypeToStructs(s *CheckType, t *structs.CheckType) {
|
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
t.CheckID = CheckIDType(s.CheckID)
|
2020-09-18 18:05:15 +00:00
|
|
|
t.Name = s.Name
|
|
|
|
t.Status = s.Status
|
|
|
|
t.Notes = s.Notes
|
|
|
|
t.ScriptArgs = s.ScriptArgs
|
|
|
|
t.HTTP = s.HTTP
|
2021-04-15 19:21:44 +00:00
|
|
|
t.H2PING = s.H2PING
|
2021-10-05 01:36:18 +00:00
|
|
|
t.H2PingUseTLS = s.H2PingUseTLS
|
2020-09-18 18:05:15 +00:00
|
|
|
t.Header = MapHeadersToStructs(s.Header)
|
|
|
|
t.Method = s.Method
|
|
|
|
t.Body = s.Body
|
2022-04-01 21:31:15 +00:00
|
|
|
t.DisableRedirects = s.DisableRedirects
|
2020-09-18 18:05:15 +00:00
|
|
|
t.TCP = s.TCP
|
2022-06-06 19:13:19 +00:00
|
|
|
t.UDP = s.UDP
|
2022-03-23 16:10:03 +00:00
|
|
|
t.Interval = structs.DurationFromProto(s.Interval)
|
2020-09-18 18:05:15 +00:00
|
|
|
t.AliasNode = s.AliasNode
|
|
|
|
t.AliasService = s.AliasService
|
|
|
|
t.DockerContainerID = s.DockerContainerID
|
|
|
|
t.Shell = s.Shell
|
|
|
|
t.GRPC = s.GRPC
|
|
|
|
t.GRPCUseTLS = s.GRPCUseTLS
|
2022-06-07 17:27:14 +00:00
|
|
|
t.OSService = s.OSService
|
2021-02-25 06:35:34 +00:00
|
|
|
t.TLSServerName = s.TLSServerName
|
2020-09-18 18:05:15 +00:00
|
|
|
t.TLSSkipVerify = s.TLSSkipVerify
|
2022-03-23 16:10:03 +00:00
|
|
|
t.Timeout = structs.DurationFromProto(s.Timeout)
|
|
|
|
t.TTL = structs.DurationFromProto(s.TTL)
|
2020-09-18 18:05:15 +00:00
|
|
|
t.SuccessBeforePassing = int(s.SuccessBeforePassing)
|
2021-09-14 16:47:52 +00:00
|
|
|
t.FailuresBeforeWarning = int(s.FailuresBeforeWarning)
|
2022-03-23 16:10:03 +00:00
|
|
|
t.FailuresBeforeCritical = int(s.FailuresBeforeCritical)
|
2020-09-18 18:05:15 +00:00
|
|
|
t.ProxyHTTP = s.ProxyHTTP
|
|
|
|
t.ProxyGRPC = s.ProxyGRPC
|
2022-03-23 16:10:03 +00:00
|
|
|
t.DeregisterCriticalServiceAfter = structs.DurationFromProto(s.DeregisterCriticalServiceAfter)
|
2020-09-18 18:05:15 +00:00
|
|
|
t.OutputMaxSize = int(s.OutputMaxSize)
|
|
|
|
}
|
2022-03-23 16:10:03 +00:00
|
|
|
func CheckTypeFromStructs(t *structs.CheckType, s *CheckType) {
|
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
s.CheckID = string(t.CheckID)
|
2020-09-18 18:05:15 +00:00
|
|
|
s.Name = t.Name
|
|
|
|
s.Status = t.Status
|
|
|
|
s.Notes = t.Notes
|
|
|
|
s.ScriptArgs = t.ScriptArgs
|
|
|
|
s.HTTP = t.HTTP
|
2021-04-15 19:21:44 +00:00
|
|
|
s.H2PING = t.H2PING
|
2021-10-05 01:36:18 +00:00
|
|
|
s.H2PingUseTLS = t.H2PingUseTLS
|
2020-09-18 18:05:15 +00:00
|
|
|
s.Header = NewMapHeadersFromStructs(t.Header)
|
|
|
|
s.Method = t.Method
|
|
|
|
s.Body = t.Body
|
2022-04-01 21:31:15 +00:00
|
|
|
s.DisableRedirects = t.DisableRedirects
|
2020-09-18 18:05:15 +00:00
|
|
|
s.TCP = t.TCP
|
2022-06-06 19:13:19 +00:00
|
|
|
s.UDP = t.UDP
|
2022-03-23 16:10:03 +00:00
|
|
|
s.Interval = structs.DurationToProto(t.Interval)
|
2020-09-18 18:05:15 +00:00
|
|
|
s.AliasNode = t.AliasNode
|
|
|
|
s.AliasService = t.AliasService
|
|
|
|
s.DockerContainerID = t.DockerContainerID
|
|
|
|
s.Shell = t.Shell
|
|
|
|
s.GRPC = t.GRPC
|
|
|
|
s.GRPCUseTLS = t.GRPCUseTLS
|
2022-06-07 17:27:14 +00:00
|
|
|
s.OSService = t.OSService
|
2021-02-25 06:35:34 +00:00
|
|
|
s.TLSServerName = t.TLSServerName
|
2020-09-18 18:05:15 +00:00
|
|
|
s.TLSSkipVerify = t.TLSSkipVerify
|
2022-03-23 16:10:03 +00:00
|
|
|
s.Timeout = structs.DurationToProto(t.Timeout)
|
|
|
|
s.TTL = structs.DurationToProto(t.TTL)
|
2020-09-18 18:05:15 +00:00
|
|
|
s.SuccessBeforePassing = int32(t.SuccessBeforePassing)
|
2021-09-14 16:47:52 +00:00
|
|
|
s.FailuresBeforeWarning = int32(t.FailuresBeforeWarning)
|
2022-03-23 16:10:03 +00:00
|
|
|
s.FailuresBeforeCritical = int32(t.FailuresBeforeCritical)
|
2020-09-18 18:05:15 +00:00
|
|
|
s.ProxyHTTP = t.ProxyHTTP
|
|
|
|
s.ProxyGRPC = t.ProxyGRPC
|
2022-03-23 16:10:03 +00:00
|
|
|
s.DeregisterCriticalServiceAfter = structs.DurationToProto(t.DeregisterCriticalServiceAfter)
|
2020-09-18 18:05:15 +00:00
|
|
|
s.OutputMaxSize = int32(t.OutputMaxSize)
|
|
|
|
}
|
2022-03-23 16:10:03 +00:00
|
|
|
func HealthCheckToStructs(s *HealthCheck, t *structs.HealthCheck) {
|
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
2020-09-18 18:05:15 +00:00
|
|
|
t.Node = s.Node
|
2022-03-23 16:10:03 +00:00
|
|
|
t.CheckID = CheckIDType(s.CheckID)
|
2020-09-18 18:05:15 +00:00
|
|
|
t.Name = s.Name
|
|
|
|
t.Status = s.Status
|
|
|
|
t.Notes = s.Notes
|
|
|
|
t.Output = s.Output
|
|
|
|
t.ServiceID = s.ServiceID
|
|
|
|
t.ServiceName = s.ServiceName
|
|
|
|
t.ServiceTags = s.ServiceTags
|
|
|
|
t.Type = s.Type
|
2022-03-23 16:10:03 +00:00
|
|
|
t.Interval = s.Interval
|
|
|
|
t.Timeout = s.Timeout
|
2021-05-12 20:51:39 +00:00
|
|
|
t.ExposedPort = int(s.ExposedPort)
|
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
|
2022-03-23 16:10:03 +00:00
|
|
|
if s.Definition != nil {
|
|
|
|
HealthCheckDefinitionToStructs(s.Definition, &t.Definition)
|
2022-03-15 14:34:46 +00:00
|
|
|
}
|
2020-09-18 18:05:15 +00:00
|
|
|
t.EnterpriseMeta = EnterpriseMetaToStructs(s.EnterpriseMeta)
|
|
|
|
t.RaftIndex = RaftIndexToStructs(s.RaftIndex)
|
|
|
|
}
|
2022-03-23 16:10:03 +00:00
|
|
|
func HealthCheckFromStructs(t *structs.HealthCheck, s *HealthCheck) {
|
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
2020-09-18 18:05:15 +00:00
|
|
|
s.Node = t.Node
|
2022-03-23 16:10:03 +00:00
|
|
|
s.CheckID = string(t.CheckID)
|
2020-09-18 18:05:15 +00:00
|
|
|
s.Name = t.Name
|
|
|
|
s.Status = t.Status
|
|
|
|
s.Notes = t.Notes
|
|
|
|
s.Output = t.Output
|
|
|
|
s.ServiceID = t.ServiceID
|
|
|
|
s.ServiceName = t.ServiceName
|
|
|
|
s.ServiceTags = t.ServiceTags
|
|
|
|
s.Type = t.Type
|
2022-03-23 16:10:03 +00:00
|
|
|
s.Interval = t.Interval
|
|
|
|
s.Timeout = t.Timeout
|
2021-05-12 20:51:39 +00:00
|
|
|
s.ExposedPort = int32(t.ExposedPort)
|
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
|
2022-03-23 16:10:03 +00:00
|
|
|
{
|
|
|
|
var x HealthCheckDefinition
|
|
|
|
HealthCheckDefinitionFromStructs(&t.Definition, &x)
|
|
|
|
s.Definition = &x
|
|
|
|
}
|
2020-09-18 18:05:15 +00:00
|
|
|
s.EnterpriseMeta = NewEnterpriseMetaFromStructs(t.EnterpriseMeta)
|
|
|
|
s.RaftIndex = NewRaftIndexFromStructs(t.RaftIndex)
|
|
|
|
}
|
2022-03-23 16:10:03 +00:00
|
|
|
func HealthCheckDefinitionToStructs(s *HealthCheckDefinition, t *structs.HealthCheckDefinition) {
|
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
2020-09-18 18:05:15 +00:00
|
|
|
t.HTTP = s.HTTP
|
2021-02-25 06:35:34 +00:00
|
|
|
t.TLSServerName = s.TLSServerName
|
2020-09-18 18:05:15 +00:00
|
|
|
t.TLSSkipVerify = s.TLSSkipVerify
|
|
|
|
t.Header = MapHeadersToStructs(s.Header)
|
|
|
|
t.Method = s.Method
|
|
|
|
t.Body = s.Body
|
2022-04-01 21:31:15 +00:00
|
|
|
t.DisableRedirects = s.DisableRedirects
|
2020-09-18 18:05:15 +00:00
|
|
|
t.TCP = s.TCP
|
2022-06-06 19:13:19 +00:00
|
|
|
t.UDP = s.UDP
|
2021-04-15 19:21:44 +00:00
|
|
|
t.H2PING = s.H2PING
|
2022-09-21 12:10:21 +00:00
|
|
|
t.OSService = s.OSService
|
2021-10-05 01:36:18 +00:00
|
|
|
t.H2PingUseTLS = s.H2PingUseTLS
|
2022-03-23 16:10:03 +00:00
|
|
|
t.Interval = structs.DurationFromProto(s.Interval)
|
2020-09-18 18:05:15 +00:00
|
|
|
t.OutputMaxSize = uint(s.OutputMaxSize)
|
2022-03-23 16:10:03 +00:00
|
|
|
t.Timeout = structs.DurationFromProto(s.Timeout)
|
|
|
|
t.DeregisterCriticalServiceAfter = structs.DurationFromProto(s.DeregisterCriticalServiceAfter)
|
2020-09-18 18:05:15 +00:00
|
|
|
t.ScriptArgs = s.ScriptArgs
|
|
|
|
t.DockerContainerID = s.DockerContainerID
|
|
|
|
t.Shell = s.Shell
|
|
|
|
t.GRPC = s.GRPC
|
|
|
|
t.GRPCUseTLS = s.GRPCUseTLS
|
|
|
|
t.AliasNode = s.AliasNode
|
|
|
|
t.AliasService = s.AliasService
|
2022-03-23 16:10:03 +00:00
|
|
|
t.TTL = structs.DurationFromProto(s.TTL)
|
2020-09-18 18:05:15 +00:00
|
|
|
}
|
2022-03-23 16:10:03 +00:00
|
|
|
func HealthCheckDefinitionFromStructs(t *structs.HealthCheckDefinition, s *HealthCheckDefinition) {
|
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
2020-09-18 18:05:15 +00:00
|
|
|
s.HTTP = t.HTTP
|
2021-02-25 06:35:34 +00:00
|
|
|
s.TLSServerName = t.TLSServerName
|
2020-09-18 18:05:15 +00:00
|
|
|
s.TLSSkipVerify = t.TLSSkipVerify
|
|
|
|
s.Header = NewMapHeadersFromStructs(t.Header)
|
|
|
|
s.Method = t.Method
|
|
|
|
s.Body = t.Body
|
2022-04-01 21:31:15 +00:00
|
|
|
s.DisableRedirects = t.DisableRedirects
|
2020-09-18 18:05:15 +00:00
|
|
|
s.TCP = t.TCP
|
2022-06-06 19:13:19 +00:00
|
|
|
s.UDP = t.UDP
|
2021-04-15 19:21:44 +00:00
|
|
|
s.H2PING = t.H2PING
|
2022-09-21 12:10:21 +00:00
|
|
|
s.OSService = t.OSService
|
2021-10-05 01:36:18 +00:00
|
|
|
s.H2PingUseTLS = t.H2PingUseTLS
|
2022-03-23 16:10:03 +00:00
|
|
|
s.Interval = structs.DurationToProto(t.Interval)
|
2020-09-18 18:05:15 +00:00
|
|
|
s.OutputMaxSize = uint32(t.OutputMaxSize)
|
2022-03-23 16:10:03 +00:00
|
|
|
s.Timeout = structs.DurationToProto(t.Timeout)
|
|
|
|
s.DeregisterCriticalServiceAfter = structs.DurationToProto(t.DeregisterCriticalServiceAfter)
|
2020-09-18 18:05:15 +00:00
|
|
|
s.ScriptArgs = t.ScriptArgs
|
|
|
|
s.DockerContainerID = t.DockerContainerID
|
|
|
|
s.Shell = t.Shell
|
|
|
|
s.GRPC = t.GRPC
|
|
|
|
s.GRPCUseTLS = t.GRPCUseTLS
|
|
|
|
s.AliasNode = t.AliasNode
|
|
|
|
s.AliasService = t.AliasService
|
2022-03-23 16:10:03 +00:00
|
|
|
s.TTL = structs.DurationToProto(t.TTL)
|
2020-09-18 18:05:15 +00:00
|
|
|
}
|