open-nomad/nomad/mock/network.go
Seth Hoenig 297d386bdc client: add support for checks in nomad services
This PR adds support for specifying checks in services registered to
the built-in nomad service provider.

Currently only HTTP and TCP checks are supported, though more types
could be added later.
2022-07-12 17:09:50 -05:00

20 lines
487 B
Go

package mock
import (
"github.com/hashicorp/nomad/nomad/structs"
)
// NetworkStatus is a mock implementation of structs.NetworkStatus
type NetworkStatus struct {
address string
}
// NewNetworkStatus creates a mock NetworkStatus based on address.
func NewNetworkStatus(address string) structs.NetworkStatus {
return &NetworkStatus{address: address}
}
func (ns *NetworkStatus) NetworkStatus() *structs.AllocNetworkStatus {
return &structs.AllocNetworkStatus{Address: ns.address}
}