2020-09-18 18:05:15 +00:00
|
|
|
// Code generated by mog. DO NOT EDIT.
|
|
|
|
|
|
|
|
package pbservice
|
|
|
|
|
|
|
|
import structs "github.com/hashicorp/consul/agent/structs"
|
|
|
|
|
|
|
|
func CheckTypeToStructs(s CheckType) structs.CheckType {
|
|
|
|
var t structs.CheckType
|
|
|
|
t.CheckID = s.CheckID
|
|
|
|
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-07-25 20:08:44 +00:00
|
|
|
t.H2PINGDisableTLS = s.H2PINGDisableTLS
|
2020-09-18 18:05:15 +00:00
|
|
|
t.Header = MapHeadersToStructs(s.Header)
|
|
|
|
t.Method = s.Method
|
|
|
|
t.Body = s.Body
|
|
|
|
t.TCP = s.TCP
|
|
|
|
t.Interval = s.Interval
|
|
|
|
t.AliasNode = s.AliasNode
|
|
|
|
t.AliasService = s.AliasService
|
|
|
|
t.DockerContainerID = s.DockerContainerID
|
|
|
|
t.Shell = s.Shell
|
|
|
|
t.GRPC = s.GRPC
|
|
|
|
t.GRPCUseTLS = s.GRPCUseTLS
|
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.Timeout = s.Timeout
|
|
|
|
t.TTL = s.TTL
|
|
|
|
t.SuccessBeforePassing = int(s.SuccessBeforePassing)
|
|
|
|
t.FailuresBeforeCritical = int(s.FailuresBeforeCritical)
|
2021-09-14 16:47:52 +00:00
|
|
|
t.FailuresBeforeWarning = int(s.FailuresBeforeWarning)
|
2020-09-18 18:05:15 +00:00
|
|
|
t.ProxyHTTP = s.ProxyHTTP
|
|
|
|
t.ProxyGRPC = s.ProxyGRPC
|
|
|
|
t.DeregisterCriticalServiceAfter = s.DeregisterCriticalServiceAfter
|
|
|
|
t.OutputMaxSize = int(s.OutputMaxSize)
|
|
|
|
return t
|
|
|
|
}
|
|
|
|
func NewCheckTypeFromStructs(t structs.CheckType) CheckType {
|
|
|
|
var s CheckType
|
|
|
|
s.CheckID = t.CheckID
|
|
|
|
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-07-25 20:08:44 +00:00
|
|
|
s.H2PINGDisableTLS = t.H2PINGDisableTLS
|
2020-09-18 18:05:15 +00:00
|
|
|
s.Header = NewMapHeadersFromStructs(t.Header)
|
|
|
|
s.Method = t.Method
|
|
|
|
s.Body = t.Body
|
|
|
|
s.TCP = t.TCP
|
|
|
|
s.Interval = t.Interval
|
|
|
|
s.AliasNode = t.AliasNode
|
|
|
|
s.AliasService = t.AliasService
|
|
|
|
s.DockerContainerID = t.DockerContainerID
|
|
|
|
s.Shell = t.Shell
|
|
|
|
s.GRPC = t.GRPC
|
|
|
|
s.GRPCUseTLS = t.GRPCUseTLS
|
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.Timeout = t.Timeout
|
|
|
|
s.TTL = t.TTL
|
|
|
|
s.SuccessBeforePassing = int32(t.SuccessBeforePassing)
|
|
|
|
s.FailuresBeforeCritical = int32(t.FailuresBeforeCritical)
|
2021-09-14 16:47:52 +00:00
|
|
|
s.FailuresBeforeWarning = int32(t.FailuresBeforeWarning)
|
2020-09-18 18:05:15 +00:00
|
|
|
s.ProxyHTTP = t.ProxyHTTP
|
|
|
|
s.ProxyGRPC = t.ProxyGRPC
|
|
|
|
s.DeregisterCriticalServiceAfter = t.DeregisterCriticalServiceAfter
|
|
|
|
s.OutputMaxSize = int32(t.OutputMaxSize)
|
|
|
|
return s
|
|
|
|
}
|
|
|
|
func HealthCheckToStructs(s HealthCheck) structs.HealthCheck {
|
|
|
|
var t structs.HealthCheck
|
|
|
|
t.Node = s.Node
|
|
|
|
t.CheckID = s.CheckID
|
|
|
|
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
|
2021-05-12 20:51:39 +00:00
|
|
|
t.ExposedPort = int(s.ExposedPort)
|
2020-09-18 18:05:15 +00:00
|
|
|
t.Definition = HealthCheckDefinitionToStructs(s.Definition)
|
|
|
|
t.EnterpriseMeta = EnterpriseMetaToStructs(s.EnterpriseMeta)
|
|
|
|
t.RaftIndex = RaftIndexToStructs(s.RaftIndex)
|
2021-08-03 22:26:49 +00:00
|
|
|
t.Interval = s.Interval
|
|
|
|
t.Timeout = s.Timeout
|
2020-09-18 18:05:15 +00:00
|
|
|
return t
|
|
|
|
}
|
|
|
|
func NewHealthCheckFromStructs(t structs.HealthCheck) HealthCheck {
|
|
|
|
var s HealthCheck
|
|
|
|
s.Node = t.Node
|
|
|
|
s.CheckID = t.CheckID
|
|
|
|
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
|
2021-05-12 20:51:39 +00:00
|
|
|
s.ExposedPort = int32(t.ExposedPort)
|
2020-09-18 18:05:15 +00:00
|
|
|
s.Definition = NewHealthCheckDefinitionFromStructs(t.Definition)
|
|
|
|
s.EnterpriseMeta = NewEnterpriseMetaFromStructs(t.EnterpriseMeta)
|
|
|
|
s.RaftIndex = NewRaftIndexFromStructs(t.RaftIndex)
|
2021-08-03 22:26:49 +00:00
|
|
|
s.Interval = t.Interval
|
|
|
|
s.Timeout = t.Timeout
|
2020-09-18 18:05:15 +00:00
|
|
|
return s
|
|
|
|
}
|
|
|
|
func HealthCheckDefinitionToStructs(s HealthCheckDefinition) structs.HealthCheckDefinition {
|
|
|
|
var t structs.HealthCheckDefinition
|
|
|
|
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
|
|
|
|
t.TCP = s.TCP
|
2021-04-15 19:21:44 +00:00
|
|
|
t.H2PING = s.H2PING
|
2021-07-25 20:08:44 +00:00
|
|
|
t.H2PINGDisableTLS = s.H2PINGDisableTLS
|
2020-09-18 18:05:15 +00:00
|
|
|
t.Interval = s.Interval
|
|
|
|
t.OutputMaxSize = uint(s.OutputMaxSize)
|
|
|
|
t.Timeout = s.Timeout
|
|
|
|
t.DeregisterCriticalServiceAfter = s.DeregisterCriticalServiceAfter
|
|
|
|
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
|
|
|
|
t.TTL = s.TTL
|
|
|
|
return t
|
|
|
|
}
|
|
|
|
func NewHealthCheckDefinitionFromStructs(t structs.HealthCheckDefinition) HealthCheckDefinition {
|
|
|
|
var s HealthCheckDefinition
|
|
|
|
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
|
|
|
|
s.TCP = t.TCP
|
2021-04-15 19:21:44 +00:00
|
|
|
s.H2PING = t.H2PING
|
2021-07-25 20:08:44 +00:00
|
|
|
s.H2PINGDisableTLS = t.H2PINGDisableTLS
|
2020-09-18 18:05:15 +00:00
|
|
|
s.Interval = t.Interval
|
|
|
|
s.OutputMaxSize = uint32(t.OutputMaxSize)
|
|
|
|
s.Timeout = t.Timeout
|
|
|
|
s.DeregisterCriticalServiceAfter = t.DeregisterCriticalServiceAfter
|
|
|
|
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
|
|
|
|
s.TTL = t.TTL
|
|
|
|
return s
|
|
|
|
}
|