Documentation
¶
Overview ¶
Package ociretry implements OCI opc-retry-token replay bookkeeping.
Index ¶
- Constants
- func Join(id, workRequest string) string
- func Split(v string) (string, string)
- type Entry
- type Store
- func (s *Store) Entries() map[string]Entry
- func (s *Store) Load(m map[string]Entry)
- func (s *Store) Lookup(scope, token string, now time.Time) (string, bool)
- func (s *Store) Once(scope, token string, now time.Time, replay func(value string) error, ...) error
- func (s *Store) Remember(scope, token, value string, now time.Time)
- func (s *Store) Reset()
Constants ¶
const TTL = 24 * time.Hour
TTL is how long a token is remembered; the OCI SDK documents that retry tokens expire after 24 hours.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store maps scope|token to the first result. It has no lock: callers hold their backend lock.
func (*Store) Once ¶
func (s *Store) Once( scope, token string, now time.Time, replay func(value string) error, create func() (string, error), ) error
Once answers a replayed token through replay, or runs create and remembers its value. The caller holds its backend write lock across the whole call so concurrent identical requests create once.