2023-03-28 18:39:22 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-11 13:12:13 +00:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-03-28 18:39:22 +00:00
|
|
|
|
2014-01-21 02:44:23 +00:00
|
|
|
package agent
|
|
|
|
|
|
|
|
import (
|
2022-04-05 21:10:06 +00:00
|
|
|
"github.com/hashicorp/consul/acl"
|
2017-07-06 10:34:00 +00:00
|
|
|
"github.com/hashicorp/consul/agent/structs"
|
2016-06-06 20:19:31 +00:00
|
|
|
"github.com/hashicorp/consul/types"
|
2014-04-21 21:42:42 +00:00
|
|
|
)
|
|
|
|
|
2014-11-29 20:25:01 +00: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 16:46:06 +00:00
|
|
|
ChkType *structs.CheckType
|
2015-04-28 02:01:02 +00:00
|
|
|
Token string
|
2019-09-24 15:04:48 +00:00
|
|
|
Source string
|
2014-11-29 20:25:01 +00:00
|
|
|
}
|
2015-01-09 22:43:24 +00:00
|
|
|
|
2015-06-05 23:17:07 +00: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 20:19:31 +00:00
|
|
|
CheckID types.CheckID
|
2015-06-05 23:17:07 +00:00
|
|
|
Output string
|
|
|
|
Status string
|
|
|
|
Expires int64
|
2022-04-05 21:10:06 +00:00
|
|
|
acl.EnterpriseMeta
|
2015-06-05 23:17:07 +00:00
|
|
|
}
|