update client

This commit is contained in:
2025-12-26 14:23:54 +03:00
parent f4962e54a3
commit a5659c5d02
75 changed files with 2436 additions and 288 deletions

View File

@@ -1,13 +1,28 @@
package value
import (
"errors"
"time"
"gitoa.ru/go-4devs/config"
)
var (
emptyValue = Empty{Err: nil}
)
func EmptyValue() config.Value {
return emptyValue
}
type Empty struct {
Err error
}
func IsEmpty(v config.Value) bool {
return v == nil || v == emptyValue
}
func (e Empty) Unmarshal(_ any) error {
return e.Err
}
@@ -83,3 +98,13 @@ func (e Empty) Duration() time.Duration {
func (e Empty) Time() time.Time {
return time.Time{}
}
func (e Empty) Any() any {
return e.Err
}
func (e Empty) IsEquals(v config.Value) bool {
em, ok := v.(Empty)
return ok && errors.Is(em.Err, e.Err)
}