Documentation
¶
Index ¶
- type Datastore
- func (ds *Datastore) ConvertRedirectFormatToForwardLookupOnly(ctx context.Context, key string) error
- func (ds *Datastore) ConvertRedirectFormatToReverseLookup(ctx context.Context, key string) error
- func (ds *Datastore) DeleteRedirect(ctx context.Context, redirectID string) error
- func (ds *Datastore) DeleteValue(ctx context.Context, redirectID string) errordeprecated
- func (ds *Datastore) GetKeys(ctx context.Context, matchPattern string, count int64, cursor uint64) (keys []string, newCursor uint64, err error)
- func (ds *Datastore) GetRedirect(ctx context.Context, redirectID string) (string, error)
- func (ds *Datastore) GetRedirects(ctx context.Context, to string, count int64, cursor uint64) (keyValuePairs map[string]string, newCursor uint64, err error)
- func (ds *Datastore) GetSetMemberValues(ctx context.Context, setKey, matchPattern, valuePrefix string, count int64, ...) (keyValuePairs map[string]string, newCursor uint64, err error)
- func (ds *Datastore) GetTotalCount(ctx context.Context, to string) (totalCount int, err error)
- func (ds *Datastore) GetValue(ctx context.Context, redirectID string) (string, error)
- func (ds *Datastore) UpsertRedirect(ctx context.Context, from, to string) error
- func (ds *Datastore) UpsertValue(ctx context.Context, key string, value interface{}, expiration time.Duration) errordeprecated
- type ForwardLookupOnlyReconciler
- type Reconciler
- type Redis
- type ReverseLookupReconciler
- type Storer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Datastore ¶
type Datastore struct {
Backend Storer
// contains filtered or unexported fields
}
Datastore represents a generic data store that abstracts the underlying storage backend.
func NewDatastore ¶ added in v1.4.0
NewDatastore creates a new instance of Datastore with the provided backend and configuration.
func (*Datastore) ConvertRedirectFormatToForwardLookupOnly ¶ added in v1.4.0
func (ds *Datastore) ConvertRedirectFormatToForwardLookupOnly(ctx context.Context, key string) error
ConvertRedirectFormatToForwardLookupOnly converts a dual index redirect format to a forward lookup only format in the datastore.
func (*Datastore) ConvertRedirectFormatToReverseLookup ¶ added in v1.4.0
ConvertRedirectFormatToReverseLookup converts a forward lookup redirect format to a dual index format allowing reverse lookup in the datastore.
func (*Datastore) DeleteRedirect ¶ added in v1.4.0
DeleteRedirect removes a redirect and its reverse lookup entry from the datastore based on the provided redirectID.
func (*Datastore) GetKeys ¶ added in v1.4.0
func (ds *Datastore) GetKeys(ctx context.Context, matchPattern string, count int64, cursor uint64) (keys []string, newCursor uint64, err error)
GetKeys retrieves a set of keys from the datastore based on the specified match pattern, count, and cursor for pagination.
func (*Datastore) GetRedirect ¶
GetRedirect retrieves a redirect value from the datastore based on the provided redirectID. When reverse lookup is enabled the redirect is stored under the forward lookup prefix, so the key is prefixed before reading. The error is returned unwrapped so that callers can compare it against disRedis.ErrKeyNotFound.
func (*Datastore) GetRedirects ¶ added in v0.3.5
func (ds *Datastore) GetRedirects(ctx context.Context, to string, count int64, cursor uint64) (keyValuePairs map[string]string, newCursor uint64, err error)
GetRedirects retrieves a list of redirects from the datastore. If the 'to' parameter is provided, it retrieves redirects pointing to the specified destination. Otherwise, it retrieves all redirects with pagination support.
func (*Datastore) GetSetMemberValues ¶ added in v1.4.0
func (ds *Datastore) GetSetMemberValues(ctx context.Context, setKey, matchPattern, valuePrefix string, count int64, cursor uint64) (keyValuePairs map[string]string, newCursor uint64, err error)
GetSetMemberValues retrieves the values of members in a set from the datastore based on the provided set key and optional match pattern and value prefix.
func (*Datastore) GetTotalCount ¶ added in v0.3.5
GetTotalCount retrieves the total count of redirects from the datastore. If the 'to' parameter is provided, it retrieves the count of redirects pointing to the specified destination. Otherwise, it retrieves the total count of all redirects.
func (*Datastore) GetValue ¶ added in v0.3.2
GetValue retrieves a value from the datastore based on the provided redirectID. This is the raw key accessor and deliberately applies no prefix, regardless of the reverse lookup flag: its callers either pass an already prefixed key or intend to read the unprefixed one. Use GetRedirect for prefix aware redirect lookups.
func (*Datastore) UpsertRedirect ¶ added in v1.4.0
UpsertRedirect inserts or updates a redirect in the datastore with the specified 'from' and 'to' values.
func (*Datastore) UpsertValue
deprecated
added in
v0.3.2
type ForwardLookupOnlyReconciler ¶ added in v1.4.0
type ForwardLookupOnlyReconciler struct {
// contains filtered or unexported fields
}
ForwardLookupOnlyReconciler is a reconciler that ensures only forward lookup keys are maintained for stored redirects.
func NewForwardLookupOnlyReconciler ¶ added in v1.4.0
func NewForwardLookupOnlyReconciler(ds *Datastore) *ForwardLookupOnlyReconciler
NewForwardLookupOnlyReconciler creates a new instance of ForwardLookupOnlyReconciler.
type Reconciler ¶ added in v1.4.0
Reconciler defines the interface for a component that can reconcile stored records.
type Redis ¶
type Redis interface {
Checker(context.Context, *healthcheck.CheckState) error
// contains filtered or unexported methods
}
Redis represents all the required methods from Redis
type ReverseLookupReconciler ¶ added in v1.4.0
type ReverseLookupReconciler struct {
// contains filtered or unexported fields
}
ReverseLookupReconciler is a reconciler that ensures reverse lookup keys are correctly maintained for stored redirects.
func NewReverseLookupReconciler ¶ added in v1.4.0
func NewReverseLookupReconciler(ds *Datastore) *ReverseLookupReconciler
NewReverseLookupReconciler creates a new instance of ReverseLookupReconciler.