open-consul/proto/private/pbservice/healthcheck.gen.go

191 lines
5.5 KiB
Go
Raw Normal View History

// Code generated by mog. DO NOT EDIT.
package pbservice
2022-03-23 16:10:03 +00:00
import "github.com/hashicorp/consul/agent/structs"
2022-03-23 16:10:03 +00:00
func CheckTypeToStructs(s *CheckType, t *structs.CheckType) {
if s == nil {
return
}
t.CheckID = CheckIDType(s.CheckID)
t.Name = s.Name
t.Status = s.Status
t.Notes = s.Notes
t.ScriptArgs = s.ScriptArgs
t.HTTP = s.HTTP
t.H2PING = s.H2PING
2021-10-05 01:36:18 +00:00
t.H2PingUseTLS = s.H2PingUseTLS
t.Header = MapHeadersToStructs(s.Header)
t.Method = s.Method
t.Body = s.Body
t.DisableRedirects = s.DisableRedirects
t.TCP = s.TCP
UDP check for service stanza #12221 (#12722) * UDP check for service stanza #12221 * add pass status on timeout condition * delete useless files * Update check_test.go improve comment in test * fix test * fix requested changes and update TestRuntimeConfig_Sanitize.golden * add freeport to TestCheckUDPCritical * improve comment for CheckUDP struct * fix requested changes * fix requested changes * fix requested changes * add UDP to proto * add UDP to proto and add a changelog * add requested test on agent_endpoint_test.go * add test for given endpoints * fix failing tests * add documentation for udp healthcheck * regenerate proto using buf * Update website/content/api-docs/agent/check.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/api-docs/agent/check.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/docs/discovery/checks.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/docs/ecs/configuration-reference.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/docs/ecs/configuration-reference.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * add debug echo * add debug circle-ci * add debug circle-ci bash * use echo instead of status_stage * remove debug and status from devtools script and use echo instead * Update website/content/api-docs/agent/check.mdx Co-authored-by: Jared Kirschner <85913323+jkirschner-hashicorp@users.noreply.github.com> * fix test * replace status_stage with status * replace functions with echo Co-authored-by: Dhia Ayachi <dhia@hashicorp.com> Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> Co-authored-by: Jared Kirschner <85913323+jkirschner-hashicorp@users.noreply.github.com>
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)
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
t.TLSServerName = s.TLSServerName
t.TLSSkipVerify = s.TLSSkipVerify
2022-03-23 16:10:03 +00:00
t.Timeout = structs.DurationFromProto(s.Timeout)
t.TTL = structs.DurationFromProto(s.TTL)
t.SuccessBeforePassing = int(s.SuccessBeforePassing)
t.FailuresBeforeWarning = int(s.FailuresBeforeWarning)
2022-03-23 16:10:03 +00:00
t.FailuresBeforeCritical = int(s.FailuresBeforeCritical)
t.ProxyHTTP = s.ProxyHTTP
t.ProxyGRPC = s.ProxyGRPC
2022-03-23 16:10:03 +00:00
t.DeregisterCriticalServiceAfter = structs.DurationFromProto(s.DeregisterCriticalServiceAfter)
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)
s.Name = t.Name
s.Status = t.Status
s.Notes = t.Notes
s.ScriptArgs = t.ScriptArgs
s.HTTP = t.HTTP
s.H2PING = t.H2PING
2021-10-05 01:36:18 +00:00
s.H2PingUseTLS = t.H2PingUseTLS
s.Header = NewMapHeadersFromStructs(t.Header)
s.Method = t.Method
s.Body = t.Body
s.DisableRedirects = t.DisableRedirects
s.TCP = t.TCP
UDP check for service stanza #12221 (#12722) * UDP check for service stanza #12221 * add pass status on timeout condition * delete useless files * Update check_test.go improve comment in test * fix test * fix requested changes and update TestRuntimeConfig_Sanitize.golden * add freeport to TestCheckUDPCritical * improve comment for CheckUDP struct * fix requested changes * fix requested changes * fix requested changes * add UDP to proto * add UDP to proto and add a changelog * add requested test on agent_endpoint_test.go * add test for given endpoints * fix failing tests * add documentation for udp healthcheck * regenerate proto using buf * Update website/content/api-docs/agent/check.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/api-docs/agent/check.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/docs/discovery/checks.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/docs/ecs/configuration-reference.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/docs/ecs/configuration-reference.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * add debug echo * add debug circle-ci * add debug circle-ci bash * use echo instead of status_stage * remove debug and status from devtools script and use echo instead * Update website/content/api-docs/agent/check.mdx Co-authored-by: Jared Kirschner <85913323+jkirschner-hashicorp@users.noreply.github.com> * fix test * replace status_stage with status * replace functions with echo Co-authored-by: Dhia Ayachi <dhia@hashicorp.com> Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> Co-authored-by: Jared Kirschner <85913323+jkirschner-hashicorp@users.noreply.github.com>
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)
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
s.TLSServerName = t.TLSServerName
s.TLSSkipVerify = t.TLSSkipVerify
2022-03-23 16:10:03 +00:00
s.Timeout = structs.DurationToProto(t.Timeout)
s.TTL = structs.DurationToProto(t.TTL)
s.SuccessBeforePassing = int32(t.SuccessBeforePassing)
s.FailuresBeforeWarning = int32(t.FailuresBeforeWarning)
2022-03-23 16:10:03 +00:00
s.FailuresBeforeCritical = int32(t.FailuresBeforeCritical)
s.ProxyHTTP = t.ProxyHTTP
s.ProxyGRPC = t.ProxyGRPC
2022-03-23 16:10:03 +00:00
s.DeregisterCriticalServiceAfter = structs.DurationToProto(t.DeregisterCriticalServiceAfter)
s.OutputMaxSize = int32(t.OutputMaxSize)
}
2022-03-23 16:10:03 +00:00
func HealthCheckToStructs(s *HealthCheck, t *structs.HealthCheck) {
if s == nil {
return
}
t.Node = s.Node
2022-03-23 16:10:03 +00:00
t.CheckID = CheckIDType(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
2022-03-23 16:10:03 +00:00
t.Interval = s.Interval
t.Timeout = s.Timeout
t.ExposedPort = int(s.ExposedPort)
t.PeerName = s.PeerName
2022-03-23 16:10:03 +00:00
if s.Definition != nil {
HealthCheckDefinitionToStructs(s.Definition, &t.Definition)
}
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
}
s.Node = t.Node
2022-03-23 16:10:03 +00:00
s.CheckID = string(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
2022-03-23 16:10:03 +00:00
s.Interval = t.Interval
s.Timeout = t.Timeout
s.ExposedPort = int32(t.ExposedPort)
s.PeerName = t.PeerName
2022-03-23 16:10:03 +00:00
{
var x HealthCheckDefinition
HealthCheckDefinitionFromStructs(&t.Definition, &x)
s.Definition = &x
}
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
}
t.HTTP = s.HTTP
t.TLSServerName = s.TLSServerName
t.TLSSkipVerify = s.TLSSkipVerify
t.Header = MapHeadersToStructs(s.Header)
t.Method = s.Method
t.Body = s.Body
t.DisableRedirects = s.DisableRedirects
t.TCP = s.TCP
UDP check for service stanza #12221 (#12722) * UDP check for service stanza #12221 * add pass status on timeout condition * delete useless files * Update check_test.go improve comment in test * fix test * fix requested changes and update TestRuntimeConfig_Sanitize.golden * add freeport to TestCheckUDPCritical * improve comment for CheckUDP struct * fix requested changes * fix requested changes * fix requested changes * add UDP to proto * add UDP to proto and add a changelog * add requested test on agent_endpoint_test.go * add test for given endpoints * fix failing tests * add documentation for udp healthcheck * regenerate proto using buf * Update website/content/api-docs/agent/check.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/api-docs/agent/check.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/docs/discovery/checks.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/docs/ecs/configuration-reference.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/docs/ecs/configuration-reference.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * add debug echo * add debug circle-ci * add debug circle-ci bash * use echo instead of status_stage * remove debug and status from devtools script and use echo instead * Update website/content/api-docs/agent/check.mdx Co-authored-by: Jared Kirschner <85913323+jkirschner-hashicorp@users.noreply.github.com> * fix test * replace status_stage with status * replace functions with echo Co-authored-by: Dhia Ayachi <dhia@hashicorp.com> Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> Co-authored-by: Jared Kirschner <85913323+jkirschner-hashicorp@users.noreply.github.com>
2022-06-06 19:13:19 +00:00
t.UDP = s.UDP
t.H2PING = s.H2PING
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)
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)
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)
}
2022-03-23 16:10:03 +00:00
func HealthCheckDefinitionFromStructs(t *structs.HealthCheckDefinition, s *HealthCheckDefinition) {
if s == nil {
return
}
s.HTTP = t.HTTP
s.TLSServerName = t.TLSServerName
s.TLSSkipVerify = t.TLSSkipVerify
s.Header = NewMapHeadersFromStructs(t.Header)
s.Method = t.Method
s.Body = t.Body
s.DisableRedirects = t.DisableRedirects
s.TCP = t.TCP
UDP check for service stanza #12221 (#12722) * UDP check for service stanza #12221 * add pass status on timeout condition * delete useless files * Update check_test.go improve comment in test * fix test * fix requested changes and update TestRuntimeConfig_Sanitize.golden * add freeport to TestCheckUDPCritical * improve comment for CheckUDP struct * fix requested changes * fix requested changes * fix requested changes * add UDP to proto * add UDP to proto and add a changelog * add requested test on agent_endpoint_test.go * add test for given endpoints * fix failing tests * add documentation for udp healthcheck * regenerate proto using buf * Update website/content/api-docs/agent/check.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/api-docs/agent/check.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/docs/discovery/checks.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/docs/ecs/configuration-reference.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/docs/ecs/configuration-reference.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * add debug echo * add debug circle-ci * add debug circle-ci bash * use echo instead of status_stage * remove debug and status from devtools script and use echo instead * Update website/content/api-docs/agent/check.mdx Co-authored-by: Jared Kirschner <85913323+jkirschner-hashicorp@users.noreply.github.com> * fix test * replace status_stage with status * replace functions with echo Co-authored-by: Dhia Ayachi <dhia@hashicorp.com> Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> Co-authored-by: Jared Kirschner <85913323+jkirschner-hashicorp@users.noreply.github.com>
2022-06-06 19:13:19 +00:00
s.UDP = t.UDP
s.H2PING = t.H2PING
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)
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)
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)
}