frostfs-node/pkg/services/control/ir/server/prm.go
Leonard Lyubich dcfe9a6504 [#414] ir/control: Implement service server
Implement `ControlServiceServer` on `Server` type. The `Server` requires all
requests to be signed with keys from the so-called whitelist. To obtain
health status, it uses the abstraction in the form of `HealthChecker`
interface.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-15 15:21:52 +03:00

24 lines
448 B
Go

package control
import (
"crypto/ecdsa"
)
// Prm groups required parameters of
// Server's constructor.
type Prm struct {
key *ecdsa.PrivateKey
healthChecker HealthChecker
}
// SetPrivateKey sets private key to sign responses.
func (x *Prm) SetPrivateKey(key *ecdsa.PrivateKey) {
x.key = key
}
// SetHealthChecker sets HealthChecker to calculate
// health status.
func (x *Prm) SetHealthChecker(hc HealthChecker) {
x.healthChecker = hc
}