Documentation
¶
Index ¶
- Constants
- Variables
- func CloseLogError(iter sdk.Iterator, logger log.Logger)
- func HexDecode(input string) ([]byte, error)
- func HexEncode(input []byte) string
- func IndexOf(strs []string, str string) int
- func NormalizeString(str string) string
- func RemoveDuplicatesFromUint64Slice(sliceList []uint64) []uint64
- func RunCached[T any](c sdk.Context, l Logger, f func(sdk.Context) (T, error)) T
- func StrNotSet(value string) bool
- func ToNumeric(i *big.Int) decimal.Decimal
- func ValidateString(str string, forbidden ...string) error
- func ValidateStringAllowEmpty(str string, forbidden string) error
- type Bitmap
- func (m *Bitmap) Add(bit bool) *Bitmap
- func (m Bitmap) CountFalse(bitCount int) uint64
- func (m Bitmap) CountTrue(bitCount int) uint64
- func (*Bitmap) Descriptor() ([]byte, []int)
- func (m *Bitmap) Marshal() (dAtA []byte, err error)
- func (m *Bitmap) MarshalTo(dAtA []byte) (int, error)
- func (m *Bitmap) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Bitmap) ProtoMessage()
- func (m *Bitmap) Reset()
- func (m *Bitmap) Size() (n int)
- func (m *Bitmap) String() string
- func (m *Bitmap) Unmarshal(dAtA []byte) error
- func (m *Bitmap) XXX_DiscardUnknown()
- func (m *Bitmap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Bitmap) XXX_Merge(src proto.Message)
- func (m *Bitmap) XXX_Size() int
- func (m *Bitmap) XXX_Unmarshal(b []byte) error
- type BlockHeightKVQueue
- type CircularBuffer
- func (m *CircularBuffer) Add(value uint32)
- func (m CircularBuffer) Count(windowRange int) uint64
- func (*CircularBuffer) Descriptor() ([]byte, []int)
- func (m *CircularBuffer) Marshal() (dAtA []byte, err error)
- func (m *CircularBuffer) MarshalTo(dAtA []byte) (int, error)
- func (m *CircularBuffer) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*CircularBuffer) ProtoMessage()
- func (m *CircularBuffer) Reset()
- func (m *CircularBuffer) SetMaxSize(size int)
- func (m *CircularBuffer) Size() (n int)
- func (m *CircularBuffer) String() string
- func (m *CircularBuffer) Unmarshal(dAtA []byte) error
- func (m *CircularBuffer) XXX_DiscardUnknown()
- func (m *CircularBuffer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CircularBuffer) XXX_Merge(src proto.Message)
- func (m *CircularBuffer) XXX_Size() int
- func (m *CircularBuffer) XXX_Unmarshal(b []byte) error
- type Counter
- type GeneralKVQueue
- func (q GeneralKVQueue) Dequeue(value codec.ProtoMarshaler) bool
- func (q GeneralKVQueue) DequeueIf(value codec.ProtoMarshaler, filter func(value codec.ProtoMarshaler) bool) bool
- func (q GeneralKVQueue) DequeueUntil(value codec.ProtoMarshaler, filter func(value codec.ProtoMarshaler) bool) bool
- func (q GeneralKVQueue) Enqueue(key Key, value codec.ProtoMarshaler)
- func (q GeneralKVQueue) ExportState() (state QueueState)
- func (q GeneralKVQueue) ImportState(state QueueState)
- func (q GeneralKVQueue) IsEmpty() bool
- func (q GeneralKVQueue) Keys() []Key
- type Iterator
- type KVQueue
- type KVStore
- func (store KVStore) Delete(key Key)
- func (store KVStore) DeleteNew(k key.Key)
- func (store KVStore) DeleteRaw(key []byte)
- func (store KVStore) Get(key Key, value codec.ProtoMarshaler) bool
- func (store KVStore) GetNew(key key.Key, value codec.ProtoMarshaler) bool
- func (store KVStore) GetRaw(key Key) []byte
- func (store KVStore) GetRawNew(key key.Key) []byte
- func (store KVStore) Has(key Key) bool
- func (store KVStore) HasNew(k key.Key) bool
- func (store KVStore) Iterator(prefix Key) Iterator
- func (store KVStore) IteratorNew(prefix key.Key) Iterator
- func (store KVStore) ReverseIterator(prefix Key) Iterator
- func (store KVStore) Set(key Key, value codec.ProtoMarshaler)
- func (store KVStore) SetNewValidated(k key.Key, value ValidatedProtoMarshaler) error
- func (store KVStore) SetRaw(key Key, value []byte)
- func (store KVStore) SetRawNew(k key.Key, value []byte)
- type Key
- type Logger
- type Nonce
- type QueueState
- func (*QueueState) Descriptor() ([]byte, []int)
- func (m *QueueState) Marshal() (dAtA []byte, err error)
- func (m *QueueState) MarshalTo(dAtA []byte) (int, error)
- func (m *QueueState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueueState) ProtoMessage()
- func (m *QueueState) Reset()
- func (m *QueueState) Size() (n int)
- func (m *QueueState) String() string
- func (m *QueueState) Unmarshal(dAtA []byte) error
- func (m QueueState) ValidateBasic(queueName ...string) error
- func (m *QueueState) XXX_DiscardUnknown()
- func (m *QueueState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueueState) XXX_Merge(src proto.Message)
- func (m *QueueState) XXX_Size() int
- func (m *QueueState) XXX_Unmarshal(b []byte) error
- type QueueState_Item
- func (*QueueState_Item) Descriptor() ([]byte, []int)
- func (m *QueueState_Item) Marshal() (dAtA []byte, err error)
- func (m *QueueState_Item) MarshalTo(dAtA []byte) (int, error)
- func (m *QueueState_Item) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueueState_Item) ProtoMessage()
- func (m *QueueState_Item) Reset()
- func (m *QueueState_Item) Size() (n int)
- func (m *QueueState_Item) String() string
- func (m *QueueState_Item) Unmarshal(dAtA []byte) error
- func (m *QueueState_Item) XXX_DiscardUnknown()
- func (m *QueueState_Item) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueueState_Item) XXX_Merge(src proto.Message)
- func (m *QueueState_Item) XXX_Size() int
- func (m *QueueState_Item) XXX_Unmarshal(b []byte) error
- type SequenceKVQueue
- type StringKey
- type Threshold
- func (*Threshold) Descriptor() ([]byte, []int)
- func (m Threshold) GT(t Threshold) bool
- func (m Threshold) GTE(t Threshold) bool
- func (m Threshold) IsMet(share sdk.Int, total sdk.Int) bool
- func (m Threshold) LT(t Threshold) bool
- func (m Threshold) LTE(t Threshold) bool
- func (m *Threshold) Marshal() (dAtA []byte, err error)
- func (m *Threshold) MarshalTo(dAtA []byte) (int, error)
- func (m *Threshold) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Threshold) ProtoMessage()
- func (m *Threshold) Reset()
- func (m *Threshold) Size() (n int)
- func (m Threshold) String() string
- func (m *Threshold) Unmarshal(dAtA []byte) error
- func (m Threshold) Validate() error
- func (m *Threshold) XXX_DiscardUnknown()
- func (m *Threshold) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Threshold) XXX_Merge(src proto.Message)
- func (m *Threshold) XXX_Size() int
- func (m *Threshold) XXX_Unmarshal(b []byte) error
- type ValidatedProtoMarshaler
Constants ¶
const DefaultDelimiter = "_"
DefaultDelimiter represents the default delimiter used for the KV store keys
Variables ¶
var ( ErrInvalidLengthBitmap = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowBitmap = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupBitmap = fmt.Errorf("proto: unexpected end of group") )
var ( // MaxInt specifies the max sdk.Int value MaxInt = sdk.NewIntFromBigInt(math.MaxBig256) // MaxUint specifies the max sdk.Uint value MaxUint = sdk.NewUintFromBigInt(math.MaxBig256) )
Functions ¶
func CloseLogError ¶
CloseLogError closes the given iterator and logs if an error is returned
func NormalizeString ¶
NormalizeString normalizes a string as NFKC
func RunCached ¶
RunCached wraps the given function, handles error/panic and rolls back the state if necessary
func ValidateString ¶
ValidateString checks if the given string is:
1. non-empty 2. entirely composed of utf8 runes 3. normalized as NFKC 4. does not contain any forbidden Unicode code points
func ValidateStringAllowEmpty ¶
ValidateStringAllowEmpty checks if the given string is:
1. entirely composed of utf8 runes 2. normalized as NFKC 3. does not contain any forbidden Unicode code points
Types ¶
type Bitmap ¶
type Bitmap struct {
TrueCountCache *CircularBuffer `protobuf:"bytes,2,opt,name=true_count_cache,json=trueCountCache,proto3" json:"true_count_cache,omitempty"`
}
func (Bitmap) CountFalse ¶
CountFalse returns the number of 0's in the given range
func (*Bitmap) Descriptor ¶
func (*Bitmap) MarshalToSizedBuffer ¶
func (*Bitmap) ProtoMessage ¶
func (*Bitmap) ProtoMessage()
func (*Bitmap) XXX_DiscardUnknown ¶
func (m *Bitmap) XXX_DiscardUnknown()
func (*Bitmap) XXX_Marshal ¶
func (*Bitmap) XXX_Unmarshal ¶
type BlockHeightKVQueue ¶
type BlockHeightKVQueue struct {
GeneralKVQueue
}
BlockHeightKVQueue is a queue that orders items with the block height at which the items are enqueued; the order of items that are enqueued at the same block height is deterministically based on their actual key in the KVStore
func NewBlockHeightKVQueue ¶
func NewBlockHeightKVQueue(name string, store KVStore, blockHeight int64, logger log.Logger) BlockHeightKVQueue
NewBlockHeightKVQueue is the constructor of BlockHeightKVQueue
type CircularBuffer ¶
type CircularBuffer struct {
CumulativeValue []uint64 `protobuf:"varint,1,rep,packed,name=cumulative_value,json=cumulativeValue,proto3" json:"cumulative_value,omitempty"`
Index int32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"`
MaxSize int32 `protobuf:"varint,3,opt,name=max_size,json=maxSize,proto3" json:"max_size,omitempty"`
}
func NewCircularBuffer ¶
func NewCircularBuffer(maxSize int) *CircularBuffer
NewCircularBuffer is the constructor of CircularBuffer
func (*CircularBuffer) Add ¶
func (m *CircularBuffer) Add(value uint32)
Add appends a new value into the CircularBuffer
func (CircularBuffer) Count ¶
func (m CircularBuffer) Count(windowRange int) uint64
Count returns the cumulative value for the most recent given window
func (*CircularBuffer) Descriptor ¶
func (*CircularBuffer) Descriptor() ([]byte, []int)
func (*CircularBuffer) Marshal ¶
func (m *CircularBuffer) Marshal() (dAtA []byte, err error)
func (*CircularBuffer) MarshalToSizedBuffer ¶
func (m *CircularBuffer) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*CircularBuffer) ProtoMessage ¶
func (*CircularBuffer) ProtoMessage()
func (*CircularBuffer) Reset ¶
func (m *CircularBuffer) Reset()
func (*CircularBuffer) SetMaxSize ¶
func (m *CircularBuffer) SetMaxSize(size int)
SetMaxSize sets the max size of the buffer to the given value. The buffer size gets updated accordingly the next time a value is added.
func (*CircularBuffer) Size ¶
func (m *CircularBuffer) Size() (n int)
func (*CircularBuffer) String ¶
func (m *CircularBuffer) String() string
func (*CircularBuffer) Unmarshal ¶
func (m *CircularBuffer) Unmarshal(dAtA []byte) error
func (*CircularBuffer) XXX_DiscardUnknown ¶
func (m *CircularBuffer) XXX_DiscardUnknown()
func (*CircularBuffer) XXX_Marshal ¶
func (m *CircularBuffer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CircularBuffer) XXX_Merge ¶
func (m *CircularBuffer) XXX_Merge(src proto.Message)
func (*CircularBuffer) XXX_Size ¶
func (m *CircularBuffer) XXX_Size() int
func (*CircularBuffer) XXX_Unmarshal ¶
func (m *CircularBuffer) XXX_Unmarshal(b []byte) error
type Counter ¶
type Counter[T constraints.Unsigned] struct { // contains filtered or unexported fields }
Counter is a stateful counter that works with the kv store and starts from zero
func NewCounter ¶
NewCounter is the constructor for counter
type GeneralKVQueue ¶
type GeneralKVQueue struct {
// contains filtered or unexported fields
}
GeneralKVQueue is a queue that orders items based on the given prioritizer function
func NewGeneralKVQueue ¶
func NewGeneralKVQueue(name string, store KVStore, logger log.Logger, prioritizer func(value codec.ProtoMarshaler) Key) GeneralKVQueue
NewGeneralKVQueue is the contructor for GeneralKVQueue
func (GeneralKVQueue) Dequeue ¶
func (q GeneralKVQueue) Dequeue(value codec.ProtoMarshaler) bool
Dequeue pops the first item in queue and stores it in the given value
func (GeneralKVQueue) DequeueIf ¶
func (q GeneralKVQueue) DequeueIf(value codec.ProtoMarshaler, filter func(value codec.ProtoMarshaler) bool) bool
DequeueIf pops the first item in queue iff it matches the given filter and stores it in the given value
func (GeneralKVQueue) DequeueUntil ¶
func (q GeneralKVQueue) DequeueUntil(value codec.ProtoMarshaler, filter func(value codec.ProtoMarshaler) bool) bool
DequeueUntil pops the first item in queue that matches the given filter and stores it in the given value
func (GeneralKVQueue) Enqueue ¶
func (q GeneralKVQueue) Enqueue(key Key, value codec.ProtoMarshaler)
Enqueue pushes the given value onto the top of the queue and stores the value at given key
func (GeneralKVQueue) ExportState ¶
func (q GeneralKVQueue) ExportState() (state QueueState)
ExportState exports the given queue's state from the kv store
func (GeneralKVQueue) ImportState ¶
func (q GeneralKVQueue) ImportState(state QueueState)
ImportState imports the given queue state into the kv store
func (GeneralKVQueue) IsEmpty ¶
func (q GeneralKVQueue) IsEmpty() bool
IsEmpty returns true if the queue is empty; otherwise, false
func (GeneralKVQueue) Keys ¶
func (q GeneralKVQueue) Keys() []Key
Keys returns a list with the keys for the values still enqueued
type Iterator ¶
type Iterator interface {
sdk.Iterator
UnmarshalValue(marshaler codec.ProtoMarshaler)
GetKey() Key
}
Iterator is an easier and safer to use sdk.Iterator extension
type KVQueue ¶
type KVQueue interface {
// Enqueue pushes the given value into the queue with the given key
Enqueue(key Key, value codec.ProtoMarshaler)
// Dequeue pops the first item in queue and stores it in the given value
Dequeue(value codec.ProtoMarshaler) bool
// DequeueIf pops the first item in queue iff it matches the given filter and stores it in the given value
DequeueIf(value codec.ProtoMarshaler, filter func(value codec.ProtoMarshaler) bool) bool
// DequeueUntil pops the first item in queue that matches the given filter and stores it in the given value
DequeueUntil(value codec.ProtoMarshaler, filter func(value codec.ProtoMarshaler) bool) bool
// IsEmpty returns true if the queue is empty; false otherwise
IsEmpty() bool
//TODO: convert to iterator
Keys() []Key
}
KVQueue represents a queue built with the KVStore
type KVStore ¶
KVStore is a wrapper around the cosmos-sdk KVStore to provide more safety regarding key management and better ease-of-use
func NewNormalizedStore ¶
func NewNormalizedStore(store sdk.KVStore, cdc codec.BinaryCodec) KVStore
NewNormalizedStore returns a new KVStore
func (KVStore) Delete ¶
Delete deletes the value stored under the given key, if it exists Deprecated: use DeleteNew instead
func (KVStore) Get ¶
func (store KVStore) Get(key Key, value codec.ProtoMarshaler) bool
Get unmarshals the raw bytes stored under the given key into the value object. Returns true if the key exists. Deprecated: use GetNew instead
func (KVStore) GetNew ¶
GetNew unmarshals the raw bytes stored under the given key into the value object. Returns true if the key exists.
func (KVStore) GetRaw ¶
GetRaw returns the raw bytes stored under the given key. Returns nil with key does not exist. Deprecated: use GetRawNew instead
func (KVStore) GetRawNew ¶
GetRawNew returns the raw bytes stored under the given key. Returns nil with key does not exist.
func (KVStore) IteratorNew ¶
IteratorNew returns an Iterator that can handle a structured Key
func (KVStore) ReverseIterator ¶
ReverseIterator returns an Iterator that can handle a structured Key and interate reversely
func (KVStore) Set ¶
func (store KVStore) Set(key Key, value codec.ProtoMarshaler)
Set marshals the value and stores it under the given key Deprecated: use SetNewValidated instead
func (KVStore) SetNewValidated ¶
func (store KVStore) SetNewValidated(k key.Key, value ValidatedProtoMarshaler) error
SetNewValidated marshals the value and stores it under the given key if it is valid
type Key ¶
type Key interface {
// AsKey returns the byte representation of the key. If given, uses a delimiter string to separate prefixes
AsKey(delimiter ...string) []byte
Prepend(prefix Key) Key
Append(key Key) Key
}
Key represents a store key to interact with the KVStore Deprecated: use key.Key instead
type QueueState ¶
type QueueState struct {
Items map[string]QueueState_Item `` /* 141-byte string literal not displayed */
}
func (*QueueState) Descriptor ¶
func (*QueueState) Descriptor() ([]byte, []int)
func (*QueueState) Marshal ¶
func (m *QueueState) Marshal() (dAtA []byte, err error)
func (*QueueState) MarshalToSizedBuffer ¶
func (m *QueueState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueueState) ProtoMessage ¶
func (*QueueState) ProtoMessage()
func (*QueueState) Reset ¶
func (m *QueueState) Reset()
func (*QueueState) Size ¶
func (m *QueueState) Size() (n int)
func (*QueueState) String ¶
func (m *QueueState) String() string
func (*QueueState) Unmarshal ¶
func (m *QueueState) Unmarshal(dAtA []byte) error
func (QueueState) ValidateBasic ¶
func (m QueueState) ValidateBasic(queueName ...string) error
ValidateBasic returns an error if the given queue state is invalid
func (*QueueState) XXX_DiscardUnknown ¶
func (m *QueueState) XXX_DiscardUnknown()
func (*QueueState) XXX_Marshal ¶
func (m *QueueState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueueState) XXX_Merge ¶
func (m *QueueState) XXX_Merge(src proto.Message)
func (*QueueState) XXX_Size ¶
func (m *QueueState) XXX_Size() int
func (*QueueState) XXX_Unmarshal ¶
func (m *QueueState) XXX_Unmarshal(b []byte) error
type QueueState_Item ¶
type QueueState_Item struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}
func (*QueueState_Item) Descriptor ¶
func (*QueueState_Item) Descriptor() ([]byte, []int)
func (*QueueState_Item) Marshal ¶
func (m *QueueState_Item) Marshal() (dAtA []byte, err error)
func (*QueueState_Item) MarshalToSizedBuffer ¶
func (m *QueueState_Item) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueueState_Item) ProtoMessage ¶
func (*QueueState_Item) ProtoMessage()
func (*QueueState_Item) Reset ¶
func (m *QueueState_Item) Reset()
func (*QueueState_Item) Size ¶
func (m *QueueState_Item) Size() (n int)
func (*QueueState_Item) String ¶
func (m *QueueState_Item) String() string
func (*QueueState_Item) Unmarshal ¶
func (m *QueueState_Item) Unmarshal(dAtA []byte) error
func (*QueueState_Item) XXX_DiscardUnknown ¶
func (m *QueueState_Item) XXX_DiscardUnknown()
func (*QueueState_Item) XXX_Marshal ¶
func (m *QueueState_Item) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueueState_Item) XXX_Merge ¶
func (m *QueueState_Item) XXX_Merge(src proto.Message)
func (*QueueState_Item) XXX_Size ¶
func (m *QueueState_Item) XXX_Size() int
func (*QueueState_Item) XXX_Unmarshal ¶
func (m *QueueState_Item) XXX_Unmarshal(b []byte) error
type SequenceKVQueue ¶
type SequenceKVQueue struct {
// contains filtered or unexported fields
}
SequenceKVQueue is a queue that orders items with the sequence number at which the items are enqueued;
func NewSequenceKVQueue ¶
func NewSequenceKVQueue(prefixStore KVStore, maxSize uint64, logger log.Logger) SequenceKVQueue
NewSequenceKVQueue is the constructor of SequenceKVQueue. The prefixStore should isolate the namespace of the queue
func (*SequenceKVQueue) Dequeue ¶
func (q *SequenceKVQueue) Dequeue(n uint64, value codec.ProtoMarshaler) bool
Dequeue pops the nth value off and unmarshals it into the given object, returns false if n is out of range n is 0-based
func (*SequenceKVQueue) Enqueue ¶
func (q *SequenceKVQueue) Enqueue(value codec.ProtoMarshaler) error
Enqueue pushes the given value onto the top of the queue and stores the value at given key. Returns queue position and status
func (SequenceKVQueue) Peek ¶
func (q SequenceKVQueue) Peek(n uint64, value codec.ProtoMarshaler) bool
Peek unmarshals the value into the given object at the given index and returns its sequence number, returns false if n is out of range n is 0-based
func (SequenceKVQueue) Size ¶
func (q SequenceKVQueue) Size() uint64
Size returns the given current size of the queue
type StringKey ¶
type StringKey interface {
Key
AppendStr(key string, stringTransformations ...func(string) string) StringKey
PrependStr(key string, stringTransformations ...func(string) string) StringKey
}
StringKey extends the Key interface for simplified appending and prepending Deprecated: use key.Key instead
func KeyFromInt ¶
func KeyFromInt[T constraints.Integer](k T) StringKey
KeyFromInt returns a structured key
func KeyFromStr ¶
KeyFromStr applies the optional string transformations to the given key in sequence and returns a structured key
func LowerCaseKey ¶
LowerCaseKey returns a key with the input converted to lower case
type Threshold ¶
type Threshold struct {
// split threshold into Numerator and denominator to avoid floating point
// errors down the line
Numerator int64 `protobuf:"varint,1,opt,name=numerator,proto3" json:"numerator,omitempty"`
Denominator int64 `protobuf:"varint,2,opt,name=denominator,proto3" json:"denominator,omitempty"`
}
var OneThreshold Threshold = NewThreshold(1, 1)
OneThreshold is a threshold that equals to 1
var ZeroThreshold Threshold = NewThreshold(0, 1)
ZeroThreshold is a threshold that equals to 0
func NewThreshold ¶
NewThreshold is the constructor for Threshold
func (*Threshold) Descriptor ¶
func (Threshold) GTE ¶
GTE returns true if and only if threshold is greater than or equal to the given one
func (Threshold) LTE ¶
LTE returns true if and only if threshold is less than or equal to the given one
func (*Threshold) MarshalToSizedBuffer ¶
func (*Threshold) ProtoMessage ¶
func (*Threshold) ProtoMessage()
func (*Threshold) XXX_DiscardUnknown ¶
func (m *Threshold) XXX_DiscardUnknown()
func (*Threshold) XXX_Marshal ¶
func (*Threshold) XXX_Unmarshal ¶
type ValidatedProtoMarshaler ¶
type ValidatedProtoMarshaler interface {
codec.ProtoMarshaler
ValidateBasic() error
}
ValidatedProtoMarshaler is a ProtoMarshaler that can also be validated
func NoValidation ¶
func NoValidation(value codec.ProtoMarshaler) ValidatedProtoMarshaler
NoValidation wraps a ProtoMarshaler so it can be used by the store without actually adding any validation
func WithValidation ¶
func WithValidation(value codec.ProtoMarshaler, validate func() error) ValidatedProtoMarshaler
WithValidation adds a ValidateBasic function to an existing ProtoMarshaler