github.com/TeaOSLab/EdgeNode@v1.3.8/internal/utils/kvstore/value_encoder_nil.go (about) 1 // Copyright 2024 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn . 2 3 package kvstore 4 5 type NilValueEncoder[T []byte] struct { 6 } 7 8 func NewNilValueEncoder[T []byte]() *NilValueEncoder[T] { 9 return &NilValueEncoder[T]{} 10 } 11 12 func (this *NilValueEncoder[T]) Encode(value T) ([]byte, error) { 13 return nil, nil 14 } 15 16 func (this *NilValueEncoder[T]) EncodeField(value T, fieldName string) ([]byte, error) { 17 return nil, nil 18 } 19 20 func (this *NilValueEncoder[T]) Decode(valueData []byte) (value T, err error) { 21 return 22 }