mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-09-29 19:41:15 +02:00
Badger store: avoid code duplication by using generic methods (#369)
* Badger store: avoid code duplication by using generic methods * No need to return PT, can return just *T
This commit is contained in:
@@ -14,6 +14,8 @@ type ClusterSettings struct {
|
||||
SchedulerProfile SchedulerProfile `json:"schedulerProfile,omitempty"`
|
||||
}
|
||||
|
||||
func (clusterSettings *ClusterSettings) SetVersion(_ uint64) {}
|
||||
|
||||
func NewSchedulerProfile(value string) (SchedulerProfile, error) {
|
||||
switch value {
|
||||
case string(SchedulerProfileOptimizeUtilization):
|
||||
|
||||
@@ -6,3 +6,5 @@ type ServiceAccount struct {
|
||||
|
||||
Meta
|
||||
}
|
||||
|
||||
func (serviceAccount *ServiceAccount) SetVersion(_ uint64) {}
|
||||
|
||||
@@ -97,6 +97,10 @@ type VM struct {
|
||||
Meta
|
||||
}
|
||||
|
||||
func (vm *VM) SetVersion(version uint64) {
|
||||
vm.Version = version
|
||||
}
|
||||
|
||||
type VMSpec struct {
|
||||
NetSoftnetDeprecated bool `json:"net-softnet,omitempty"`
|
||||
NetSoftnet bool `json:"netSoftnet,omitempty"`
|
||||
|
||||
@@ -30,3 +30,5 @@ type Worker struct {
|
||||
func (worker Worker) Offline(workerOfflineTimeout time.Duration) bool {
|
||||
return time.Since(worker.LastSeen) > workerOfflineTimeout
|
||||
}
|
||||
|
||||
func (worker *Worker) SetVersion(_ uint64) {}
|
||||
|
||||
Reference in New Issue
Block a user