Documentation
¶
Overview ¶
Package segment holds the model of the named segments that the targeting rules of a flag test an attribute against (targetingKey in segment("beta-users")): the definitions, the seam that answers the membership questions of a request, the failure policies and an in-memory provider.
The membership data never lives in the flags. A Provider answers, for the attribute values of one evaluation, whether each is a member of its segment, is not, or whether that could not be determined. The engine turns those three-valued answers into the result of a rule (see flagdef) and applies the failure policy of the segment.
Index ¶
- Constants
- Variables
- func HasAtomicExistence(provider Provider) bool
- func IsStoreAnswered(err error) bool
- func RequireMode(segmentName string, mode Mode, kind string, store any) error
- func RequireVersioner(segmentName, kind string, store any) error
- func SupportsMode(store any, mode Mode) bool
- func ValidName(name string) bool
- type AtomicExistencer
- type Catalog
- func (c *Catalog) Answer(name, id string) (State, Status, bool)
- func (c *Catalog) Has(name string) bool
- func (c *Catalog) Lookup(name string) (Definition, bool)
- func (c *Catalog) Member(name, id string) (State, bool)
- func (c *Catalog) Names() []string
- func (c *Catalog) ResolveFor(name string, state State) State
- type Change
- type ChangeNotifier
- type Definition
- type EndedContextProvider
- type Existencer
- type Health
- type HealthReporter
- type Initializer
- type Layout
- type Limits
- type Live
- type Lookup
- type MemberSet
- type MemberSetBuilder
- type MemoryProvider
- type MemorySource
- func (m *MemorySource) Calls(op Op) int
- func (m *MemorySource) Changes(ctx context.Context) (iter.Seq2[Change, error], error)
- func (m *MemorySource) Contains(ctx context.Context, lookups []Lookup) error
- func (m *MemorySource) Delete(name string)
- func (m *MemorySource) Exists(_ context.Context, names []string) ([]State, error)
- func (m *MemorySource) Fail(call Op, err error)
- func (m *MemorySource) FailMembersAfter(n int, err error)
- func (m *MemorySource) Members(ctx context.Context, name string) iter.Seq2[string, error]
- func (m *MemorySource) PinVersion(name, token string)
- func (m *MemorySource) Set(name string, ids []string)
- func (m *MemorySource) SetMembersHook(hook func(segment string, yielded int))
- func (m *MemorySource) SetMissing(missing MissingKey)
- func (m *MemorySource) Version(ctx context.Context, name string) (string, error)
- type MissingKey
- type Mode
- type OnError
- type Op
- type Provider
- type Shutdowner
- type SnapshotSource
- type StaleReporter
- type State
- type Status
- type Term
- type Type
- type VersionSpec
- type Versioner
Constants ¶
const ( // DefaultMaxMembers is the default Limits.MaxMembers. DefaultMaxMembers = 10_000_000 // DefaultMaxBytes is the default Limits.MaxBytes. DefaultMaxBytes = 512 << 20 )
const ( // MaxVersionLen is the longest Version.Value or Version.Key. MaxVersionLen = 512 // MinVersionInterval is the shortest Version.Interval. MinVersionInterval = 100 * time.Millisecond // MaxVersionInterval is the longest Version.Interval. MaxVersionInterval = 24 * time.Hour )
const AbsentVersion = "absent"
AbsentVersion is the version token that MemorySource gives a segment it does not hold.
const (
// MaxNameLen is the longest name of a segment.
MaxNameLen = 64
)
Variables ¶
var ( // ErrMemberTooLong is returned by ReadMemberSet for a line that is too long to be an identifier. ErrMemberTooLong = errors.New("a member line is longer than 4096 bytes") // ErrTooManyMembers is returned by ReadMemberSet when the file has more rows than Limits.MaxMembers. ErrTooManyMembers = errors.New("the member file has too many rows") // ErrMembersTooLarge is returned by ReadMemberSet when the file is larger than Limits.MaxBytes. ErrMembersTooLarge = errors.New("the member file is too large") )
var ( // ErrInvalidDefinition is wrapped by the errors of the definitions that are not valid. ErrInvalidDefinition = errors.New("invalid segment definition") )
var ( // ErrKeysSnapshot is wrapped by the error of a definition of the keys layout in the snapshot mode. ErrKeysSnapshot = errors.New("the keys layout is lookup-only: it cannot be used with the snapshot mode") )
var ErrNoVersion = errors.New("the segment has no version")
ErrNoVersion is wrapped by the error of a Versioner that has no version for the segment (no version key is configured). A snapshot holder then cannot tell a change and pulls the members on every Refresh: that costs one full read for each poll.
var ErrSegmentMissing = errors.New("the segment does not exist in the store")
ErrSegmentMissing is yielded by SnapshotSource.Members for a segment that does not exist in the store. A segment that exists and has no member yields nothing: missing and empty are different. What a missing segment means (no member by default, or Unknown) is the policy of the consumer, see MissingKey.
var ErrUnsupportedMode = errors.New("the store does not support the segment mode")
ErrUnsupportedMode is wrapped by the error of RequireMode.
Functions ¶
func HasAtomicExistence ¶
HasAtomicExistence reports whether provider is an AtomicExistencer that reports true. A nil provider, one that is not an AtomicExistencer, and one that reports false give false: the caller falls back to the non-atomic behaviour.
func IsStoreAnswered ¶
IsStoreAnswered reports whether err, or an error that it wraps, says that the store answered with an error about one set: the store itself works. An error says so with a method StoreAnswered() bool that returns true; the failure classes of the stores that the relay serves for a key of the wrong type or a reply of the wrong shape do.
func RequireMode ¶
RequireMode returns nil when store can serve the mode, else an error that wraps ErrUnsupportedMode and names the segment, the mode and the kind of the store (for example "redis").
func RequireVersioner ¶
RequireVersioner returns nil when store can tell versions (a segment with a version key needs one), else an error that wraps ErrUnsupportedMode.
func SupportsMode ¶
SupportsMode reports whether store can serve the mode: a Provider serves lookup, a SnapshotSource serves snapshot. An empty mode is snapshot.
Types ¶
type AtomicExistencer ¶
type AtomicExistencer interface {
AtomicExistence() bool
}
AtomicExistencer is implemented by a provider that can answer "is the segment loaded" and "is the id a member" from one consistent read of its store, so a segment that is created or removed while a lookup runs is seen whole or not at all: the lookup is Unknown (not loaded), or answered from one state of the members, never a NotMember that matches no state of the segment.
AtomicExistence reports whether the provider does that now, for the lookups that it answers with a missing segment as Unknown. It is false for a provider that cannot (the store has no transaction), that was configured not to, or that has no existence check at all (a missing segment is a non-member by its settings). A provider that is not an AtomicExistencer is the same as one that reports false. The method is cheap and safe for concurrent use.
A provider that reports false keeps the non-atomic behaviour that it documents: the existence and the membership are two reads, and an answer that was given between them can be wrong.
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
Catalog is the set of the segments that a flag set defines. It is immutable and safe for concurrent use: a change of the definitions is a new Catalog.
func NewCatalog ¶
func NewCatalog(defs ...Definition) (*Catalog, error)
NewCatalog validates the definitions and returns the catalog of them. The names must be unique.
func NewCatalogWithLive ¶
func NewCatalogWithLive(sets map[string]*MemberSet, live map[string]Live, defs ...Definition) (*Catalog, error)
NewCatalogWithLive is NewCatalogWithSets with live segments: the catalog answers them from their Live source, as it answers a static segment from its members, and no provider is asked. A live name that has no definition, or that is also a static set, is an error.
func NewCatalogWithSets ¶
func NewCatalogWithSets(sets map[string]*MemberSet, defs ...Definition) (*Catalog, error)
NewCatalogWithSets is NewCatalog with the members of the static segments: the segment name of a set is answered from memory (see Catalog.Member), no provider is asked. The catalog keeps the sets, it does not copy them. A set whose name has no definition is an error.
func (*Catalog) Answer ¶
Answer is Catalog.Member for the static and the live segments, with the status of the answer. ok is false when the segment is neither: the provider decides. It does not allocate and is safe for concurrent use.
func (*Catalog) Has ¶
Has reports whether the catalog defines the segment name. It does not copy the definition: it is for the evaluation path.
func (*Catalog) Lookup ¶
func (c *Catalog) Lookup(name string) (Definition, bool)
Lookup returns the definition of the segment name.
func (*Catalog) Member ¶
Member answers a lookup from the members of a static segment: ok is false when the segment is not static, and the provider decides. It does not allocate and is safe for concurrent use.
func (*Catalog) ResolveFor ¶
ResolveFor applies the failure policy of the segment name to a lookup state, as Definition.Resolve does; a segment that the catalog does not define (or no catalog) gets the default policy, not a member. It does not copy the definition: it is for the evaluation path.
type ChangeNotifier ¶
ChangeNotifier is implemented by a store that can tell that a segment changed, instead of being polled. The subscription starts when Changes returns and ends with ctx; the sequence yields ("", err) on a failure of the subscription and then ends. A consumer that misses a change is still correct when it also polls.
type Definition ¶
type Definition struct {
// Version says how the version of the segment is learned. Nil means no version: only the time-to-live of a
// cache applies.
Version *VersionSpec
// Name is the name that the rules use: segment("name").
Name string
// Type is the kind of store of the members.
Type Type
// OnError is what a lookup that the provider could not answer becomes. Empty means OnErrorNotMember.
OnError OnError
// Mode is how a segment that lives in a store is served. Empty means ModeSnapshot.
Mode Mode
// MissingKey is what a segment that does not exist in the store means. Empty means MissingNotMember.
MissingKey MissingKey
// Layout is how a store of keys holds the members. Empty means LayoutSet; LayoutKeys is lookup-only.
Layout Layout
}
Definition is a segment: its name, where its members are and what an unanswered lookup becomes. It holds no member and no connection detail; the provider that serves the segment holds those.
func (*Definition) Resolve ¶
func (d *Definition) Resolve(state State) State
Resolve applies the failure policy of the definition to a lookup state: an Unknown state becomes what OnError says.
func (*Definition) Validate ¶
func (d *Definition) Validate() error
Validate returns an error that wraps ErrInvalidDefinition when the definition is not valid.
type EndedContextProvider ¶
type EndedContextProvider interface {
Provider
AnswersFromMemory()
}
EndedContextProvider is implemented by a provider that can answer from memory after the context of the request has ended: the evaluation calls it then too (the other providers are not called), and a lookup that it could not answer stays Unknown. The method only marks the capability.
type Existencer ¶
Existencer is implemented by a provider that can tell whether a segment is loaded. The answers are in the order of names: Member means loaded, NotMember means not, Unknown means the provider could not tell.
type Health ¶
type Health struct {
// Failure is the class of the failure of the last call, empty when it succeeded. It never holds an id or a key.
Failure string
// Ready is true once the provider answered a call.
Ready bool
// Closed is true after Shutdown.
Closed bool
}
Health is a snapshot of the health of a provider.
type HealthReporter ¶
type HealthReporter interface {
Health() Health
}
HealthReporter is implemented by a provider that reports its health.
type Initializer ¶
Initializer is implemented by a provider that has something to check or prepare before the first lookup. Init returns an error when the store cannot serve lookups.
type Layout ¶
type Layout string
Layout is how the members of a segment are stored in a key-value store.
type Limits ¶
type Limits struct {
// MaxMembers is the most non-empty rows of the file (duplicates count).
MaxMembers int
// MaxBytes is the most bytes of the file, line ends included.
MaxBytes int64
}
Limits bounds what ReadMemberSet reads. A zero field means its default.
type Live ¶
Live answers the membership of one segment from memory that something else keeps current (a snapshot of a store, refreshed off the request path). Answer must not allocate, must not block and must be safe for concurrent use. The status says how far the answer can be trusted: StatusStale for a set that is older than it should be, StatusStoreError with Unknown for a set that was never loaded.
type Lookup ¶
type Lookup struct {
// Segment is the name of the segment.
Segment string
// ID is the value of the attribute that the rule tests, as the rule reads it.
ID string
// State is the answer: Unknown until the provider sets it.
State State
}
Lookup is one membership question: is ID a member of Segment. The provider writes the answer in State.
type MemberSet ¶
type MemberSet struct {
// contains filtered or unexported fields
}
MemberSet is the members of one segment, as a hash set. It is immutable once built.
func NewMemberSet ¶
NewMemberSet returns the set of the given members (duplicates are one member). The slice is not retained.
func ReadMemberSet ¶
ReadMemberSet reads the members of a segment of type file, one value per line, straight into the set (no list of the members is built). A UTF-8 byte order mark at the start is ignored; leading and trailing blanks (including a carriage return) are removed, empty lines are ignored, duplicates are one member, and nothing else is interpreted.
type MemberSetBuilder ¶
type MemberSetBuilder struct {
// contains filtered or unexported fields
}
MemberSetBuilder builds a MemberSet one member at a time, straight into the set: no list of the members exists. The zero value is ready to use.
func (*MemberSetBuilder) Add ¶
func (b *MemberSetBuilder) Add(id string) bool
Add adds a member and reports whether it was new.
func (*MemberSetBuilder) Build ¶
func (b *MemberSetBuilder) Build() *MemberSet
Build returns the set and resets the builder: the set takes the map, nothing is copied.
func (*MemberSetBuilder) Len ¶
func (b *MemberSetBuilder) Len() int
Len is the number of distinct members added.
type MemoryProvider ¶
type MemoryProvider struct {
// contains filtered or unexported fields
}
MemoryProvider is a Provider of segments whose members are held in memory, as a hash set per segment. It serves the segments of type file and the tests. It is immutable and safe for concurrent use: a change of the members is a new MemoryProvider. A lookup of a segment it does not hold is NotMember, or Unknown with WithMissing(MissingUnknown).
func NewMemoryProvider ¶
func NewMemoryProvider(members map[string][]string) *MemoryProvider
NewMemoryProvider returns a provider of the given members, indexed by segment name. The slices are copied.
func NewMemoryProviderFromSets ¶
func NewMemoryProviderFromSets(sets map[string]*MemberSet) *MemoryProvider
NewMemoryProviderFromSets returns a provider of the given sets, indexed by segment name. The sets are shared, not copied: they are immutable.
func (*MemoryProvider) Contains ¶
func (p *MemoryProvider) Contains(ctx context.Context, lookups []Lookup) error
Contains implements Provider. It does not allocate.
func (*MemoryProvider) WithMissing ¶
func (p *MemoryProvider) WithMissing(missing MissingKey) *MemoryProvider
WithMissing returns a provider that answers a lookup of a segment it does not hold as the policy says: the default (empty) is MissingNotMember, MissingUnknown leaves the state Unknown.
type MemorySource ¶
type MemorySource struct {
// contains filtered or unexported fields
}
MemorySource is the in-memory reference implementation of every store interface of the package: a Provider (lookup), a SnapshotSource, a Versioner, an Existencer and a ChangeNotifier. Unlike MemoryProvider it is mutable, with a version for each segment, injectable failures and a hook inside the member stream, so a test can drive any state of a store. It is safe for concurrent use.
func NewMemorySource ¶
func NewMemorySource(members map[string][]string) *MemorySource
NewMemorySource returns a source holding the members, each segment at a fresh version.
func (*MemorySource) Calls ¶
func (m *MemorySource) Calls(op Op) int
Calls is the number of calls of op so far.
func (*MemorySource) Changes ¶
Changes implements ChangeNotifier. Changes of one segment between two reads are coalesced into the latest one.
func (*MemorySource) Contains ¶
func (m *MemorySource) Contains(ctx context.Context, lookups []Lookup) error
Contains implements Provider: a segment the source does not hold is NotMember, or Unknown after SetMissing(MissingUnknown).
func (*MemorySource) Delete ¶
func (m *MemorySource) Delete(name string)
Delete removes a segment; its version goes back to AbsentVersion.
func (*MemorySource) Exists ¶
Exists implements Existencer.
func (*MemorySource) Fail ¶
func (m *MemorySource) Fail(call Op, err error)
Fail makes every following call of kind call return err; nil heals it.
func (*MemorySource) FailMembersAfter ¶
func (m *MemorySource) FailMembersAfter(n int, err error)
FailMembersAfter makes the member stream yield err after n members (n zero: before the first); a negative n heals it.
func (*MemorySource) Members ¶
Members implements SnapshotSource.
func (*MemorySource) PinVersion ¶
func (m *MemorySource) PinVersion(name, token string)
PinVersion sets the version token of a segment without touching its members (the way a writer bumps a version key). The reserved AbsentVersion is remapped to another token for an existing segment. An empty token unpins: the segment gets a fresh counter version (or the absent one when it does not exist).
func (*MemorySource) Set ¶
func (m *MemorySource) Set(name string, ids []string)
Set replaces the members of a segment (creating it) and gives it a new version.
func (*MemorySource) SetMembersHook ¶
func (m *MemorySource) SetMembersHook(hook func(segment string, yielded int))
SetMembersHook sets a function that the member stream calls before it yields member number yielded (from zero) of a segment, outside the lock of the source: the hook may block (a gate) or cancel a context.
func (*MemorySource) SetMissing ¶
func (m *MemorySource) SetMissing(missing MissingKey)
SetMissing sets what a lookup of a segment that does not exist answers: the default (empty) is NotMember.
type MissingKey ¶
type MissingKey string
MissingKey is what a segment that does not exist in the store means.
const ( // MissingNotMember means a segment that does not exist has no member: every lookup answers NotMember. It is the // default, for both modes. An expired or deleted segment is then "nobody is in the segment": replace a segment // atomically (a rename of a new one over it) rather than deleting it and adding it again. MissingNotMember MissingKey = "notMember" // MissingUnknown means a segment that does not exist is Unknown: the lookups fall to the failure policy of the // segment (onError). It is an explicit opt-in. MissingUnknown MissingKey = "unknown" )
func (MissingKey) Effective ¶
func (m MissingKey) Effective() MissingKey
Effective returns the policy that applies: MissingNotMember when empty.
func (MissingKey) Valid ¶
func (m MissingKey) Valid() bool
Valid reports whether the policy is empty (the default), notMember or unknown.
type Mode ¶
type Mode string
Mode is how a segment that lives in a store is served. The mode is a property of the definition; the store kind decides which modes it can serve (see RequireMode).
const ( // ModeSnapshot pulls the whole member set from the store like a retriever, holds it in memory, polls a version // token for change and swaps the set atomically. It is the default. When the store is down the last good set // keeps answering. ModeSnapshot Mode = "snapshot" // ModeLookup asks the store for each evaluation (one batched call) and keeps a bounded LRU of the answers, each // stamped with the segment version it was fetched under. It holds the least memory and costs a network call on a // miss. ModeLookup Mode = "lookup" )
type OnError ¶
type OnError string
OnError is what a lookup of a segment that is Unknown becomes, see Definition.OnError.
const ( // OnErrorUnknown keeps the lookup Unknown (the opt-in of the three-valued logic): the rule that depends on it does // not match, unless the rule says onError: match. It is not the default: the default is OnErrorNotMember. OnErrorUnknown OnError = "unknown" // OnErrorNotMember turns an Unknown lookup into NotMember. It is the default, as in LaunchDarkly. OnErrorNotMember OnError = "notMember" // OnErrorMember turns an Unknown lookup into Member. OnErrorMember OnError = "member" )
type Provider ¶
Provider answers the membership questions of one evaluation.
Contains sets the State of every lookup it can answer, in place, and leaves the others Unknown. A lookup that cannot be answered is not an error: the engine applies the failure policy of the segment to it. A non-nil error means the call failed (a timeout, a broken connection, the end of the request context during the call): the lookups that it answered with Member or NotMember before it failed keep their answer, and the others are Unknown. Contains must honour ctx, must not retain lookups after it returns, must not change Segment or ID, and is called by concurrent evaluations: it must be safe for concurrent use. The slice is one per call and can have several lookups of the same segment, so a store can answer them in one round trip.
type Shutdowner ¶
Shutdowner is implemented by a provider that holds a resource that must be released. Shutdown is safe to call more than once: the second call returns nil.
type SnapshotSource ¶
type SnapshotSource interface {
Versioner
Members(ctx context.Context, segment string) iter.Seq2[string, error]
}
SnapshotSource is the contract of a store that serves the snapshot mode. Version is the cheap change token; Members streams the members, never as one slice: a failure while streaming is yielded as ("", err) and ends the sequence, a segment that does not exist yields ("", ErrSegmentMissing) and an existing empty one yields nothing. The caller reads the version before the members, so a write between the two is picked up by the next poll.
type StaleReporter ¶
type StaleReporter interface {
Stale() bool
}
StaleReporter is implemented by a provider that can answer from data that is older than it should be, for example a snapshot that could not be refreshed and keeps its last known good set. The evaluation reports the status StatusStale for the evaluations that it served while Stale is true; the answers are still used.
type State ¶
type State uint8
State is what a Provider knows of one lookup. The zero value is Unknown. A provider must only set one of the three constants; the engine treats any other value as Unknown.
type Status ¶
type Status uint8
Status tells how healthy the segment lookups of an evaluation were. The worst status of the lookups wins.
const ( // StatusNone means the evaluation did not look any segment up. StatusNone Status = iota // StatusHealthy means every lookup was answered. StatusHealthy // StatusStale means the answers were given from data that is older than it should be (a snapshot that could not be // refreshed): they are used, the way a last known good set is. StatusStale // StatusNotConfigured means a rule used a segment but the evaluation had no provider. StatusNotConfigured // StatusStoreError means a lookup could not be answered by the provider. StatusStoreError )
func (Status) Reported ¶
Reported reports whether the status is worth telling the caller: a segment was looked up and the lookup was not healthy. A healthy evaluation, and one that looked at no segment, report nothing.
func (Status) String ¶
String implements fmt.Stringer with the values of the evaluation metadata.
type Term ¶
type Term struct {
// Name is the segment.
Name string
// Path is the attribute, one element for each level of a nested attribute ("user.email" is {"user", "email"}).
Path []string
}
Term is a segment term of a flag: the attribute whose value is looked up, in the segment Name.
type Type ¶
type Type string
Type is the kind of store of the members of a segment.
const ( // TypeFile is a segment whose members are loaded in memory from a file (one value per line). TypeFile Type = "file" // TypeRedis is a segment looked up in Redis or Valkey for each request, through go-redis (package redissegment). TypeRedis Type = "redis" // TypeValkey is a segment looked up in Valkey for each request, through valkey-go (package valkeysegment). TypeValkey Type = "valkey" )
type VersionSpec ¶
type VersionSpec struct {
// Value is a version that the definition carries.
Value string
// Key is the name of the version key in the store.
Key string
// Interval is the poll period of Key.
Interval time.Duration
}
VersionSpec says how the version of a segment is learned. The version is an opaque token that is compared for equality: a cached answer or a pulled member set is valid for the version it was read under.
With Value, the publisher of the definition bumps the version. With Key, the version is read from a key of the store that the writer of the members bumps, and Interval is how often it is polled (zero means the process default). With neither, no version exists and only the time-to-live of the cache applies.
func (*VersionSpec) Validate ¶
func (v *VersionSpec) Validate() error
Validate returns an error when the spec is not valid. A nil or zero spec is valid.
type Versioner ¶
Versioner tells the current version of a segment. It is the baseline of change detection: a caller polls it off the request path. A token is opaque and only compared for equality; a segment that has no version yet has a fixed token of the store (not an error), so "never bumped" is stable. A store may instead report a segment that does not exist with ErrSegmentMissing: that is an answer, not a failure, and a snapshot holder treats it like a stream that reports it. A writer that deletes or replaces a segment must change its version: a holder that sees the same token does not pull again, so a deletion under an unchanged token is not seen. Version must honour ctx and be safe for concurrent use.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package redissegment is a segment.Provider that answers segment membership lookups from a Redis or Valkey store with go-redis (segment type segment.TypeRedis; the valkey-go provider, type segment.TypeValkey, is a separate package).
|
Package redissegment is a segment.Provider that answers segment membership lookups from a Redis or Valkey store with go-redis (segment type segment.TypeRedis; the valkey-go provider, type segment.TypeValkey, is a separate package). |
|
Package resolver wraps a segment.Provider with what a network store needs on the evaluation path: an in-process cache, coalescing of identical concurrent lookups and a circuit breaker for each segment.
|
Package resolver wraps a segment.Provider with what a network store needs on the evaluation path: an in-process cache, coalescing of identical concurrent lookups and a circuit breaker for each segment. |
|
Package segmentadmin is the write side of the dynamic segments: the code that loads members into a Valkey or Redis store, the counterpart of the read side in valkeysegment and redissegment.
|
Package segmentadmin is the write side of the dynamic segments: the code that loads members into a Valkey or Redis store, the counterpart of the read side in valkeysegment and redissegment. |
|
admintest
Package admintest holds an in-memory segmentadmin.Store with failure injection, for tests of the code that writes segments (the import and the commands of the CLI) that must not need a server.
|
Package admintest holds an in-memory segmentadmin.Store with failure injection, for tests of the code that writes segments (the import and the commands of the CLI) that must not need a server. |
|
Package segmenttest is the conformance suite of segment.Provider: the contract of the seam as executable cases.
|
Package segmenttest is the conformance suite of segment.Provider: the contract of the seam as executable cases. |
|
Package snapshot holds the member set of a segment of the snapshot mode: it pulls the members through a segment.SnapshotSource, keeps them in memory behind an atomic pointer and swaps them when the version changes.
|
Package snapshot holds the member set of a segment of the snapshot mode: it pulls the members through a segment.SnapshotSource, keeps them in memory behind an atomic pointer and swaps them when the version changes. |
|
Package valkeysegment is the segment.Provider of segment type segment.TypeValkey.
|
Package valkeysegment is the segment.Provider of segment type segment.TypeValkey. |