Documentation
¶
Overview ¶
Package datakinds contains the implementations of ldstoretypes.DataKind for flags and segments.
These have their own package because they are used in many places and therefore need to be in a package that doesn't have other things with other dependencies, to avoid cyclic references.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllDataKinds ¶
func AllDataKinds() []ldstoretypes.DataKind
AllDataKinds returns all the supported data StoreDataKinds.
func Deserialize ¶ added in v7.19.0
func Deserialize(kind ldstoretypes.DataKind, data []byte, opts DeserializeOptions) ( ldstoretypes.ItemDescriptor, error)
Deserialize uses the options if kind is a built-in data kind. Otherwise it calls kind.Deserialize, and does not use the options.
Types ¶
type DataKindInternal ¶
type DataKindInternal interface {
ldstoretypes.DataKind
DeserializeFromJSONReader(reader *jreader.Reader) (ldstoretypes.ItemDescriptor, error)
// DeserializeWithOptions is the same as Deserialize, but uses the options.
DeserializeWithOptions(data []byte, opts DeserializeOptions) (ldstoretypes.ItemDescriptor, error)
// DeserializeFromJSONReaderWithOptions is the same as DeserializeFromJSONReader, but uses the options.
DeserializeFromJSONReaderWithOptions(reader *jreader.Reader, opts DeserializeOptions) (
ldstoretypes.ItemDescriptor, error)
}
DataKindInternal is implemented along with DataKind to provide more efficient jsonstream-based deserialization for our built-in data kinds.
var Features DataKindInternal = featureFlagStoreDataKind{} //nolint:gochecknoglobals
Features is the global StoreDataKind instance for feature flags.
var Segments DataKindInternal = segmentStoreDataKind{} //nolint:gochecknoglobals
Segments is the global StoreDataKind instance for segments.
type DeserializeOptions ¶ added in v7.19.0
type DeserializeOptions struct {
// contains filtered or unexported fields
}
DeserializeOptions controls how the built-in data kinds deserialize flags and segments. The zero value is the default behavior. The fields are unexported, so that code outside the SDK cannot make a value for exported methods such as subsystems.ChangeSetBuilder.WithDeserializeOptions.
func NewDeserializeOptions ¶ added in v7.19.0
func NewDeserializeOptions(releaseClauseValues bool) DeserializeOptions
NewDeserializeOptions returns options for deserialization. If releaseClauseValues is true, deserialization releases the Values list of each "in" clause that preprocessing put into a lookup set. For details, see ldmodel.ReleaseClauseValues. This is the value of Config.ReleaseClauseValues.
func (DeserializeOptions) ReleaseClauseValues ¶ added in v7.19.0
func (o DeserializeOptions) ReleaseClauseValues() bool
ReleaseClauseValues returns true if deserialization releases redundant clause value lists.