2023-03-28 19:39:22 +01:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-11 09:12:13 -04:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-03-28 19:39:22 +01:00
|
|
|
|
2014-01-20 16:44:23 -10:00
|
|
|
package agent
|
|
|
|
|
|
|
|
import (
|
2022-04-05 14:10:06 -07:00
|
|
|
"github.com/hashicorp/consul/acl"
|
2017-07-06 12:34:00 +02:00
|
|
|
"github.com/hashicorp/consul/agent/structs"
|
2016-06-06 13:19:31 -07:00
|
|
|
"github.com/hashicorp/consul/types"
|
2014-04-21 14:42:42 -07:00
|
|
|
)
|
|
|
|
|
2014-11-29 12:25:01 -08:00
|
|
|
// persistedCheck is used to serialize a check and write it to disk
|
|
|
|
// so that it may be restored later on.
|
|
|
|
type persistedCheck struct {
|
|
|
|
Check *structs.HealthCheck
|
2017-06-15 18:46:06 +02:00
|
|
|
ChkType *structs.CheckType
|
2015-04-27 19:01:02 -07:00
|
|
|
Token string
|
2019-09-24 10:04:48 -05:00
|
|
|
Source string
|
2014-11-29 12:25:01 -08:00
|
|
|
}
|
2015-01-09 16:43:24 -06:00
|
|
|
|
2015-06-05 16:17:07 -07:00
|
|
|
// persistedCheckState is used to persist the current state of a given
|
|
|
|
// check. This is different from the check definition, and includes an
|
|
|
|
// expiration timestamp which is used to determine staleness on later
|
|
|
|
// agent restarts.
|
|
|
|
type persistedCheckState struct {
|
2016-06-06 13:19:31 -07:00
|
|
|
CheckID types.CheckID
|
2015-06-05 16:17:07 -07:00
|
|
|
Output string
|
|
|
|
Status string
|
|
|
|
Expires int64
|
2022-04-05 14:10:06 -07:00
|
|
|
acl.EnterpriseMeta
|
2015-06-05 16:17:07 -07:00
|
|
|
}
|