Documentation ¶
Index ¶
- Constants
- func ContextWith(ctx context.Context, s Store) context.Context
- func ContextWithPollTimings(ctx context.Context, interval, timeout time.Duration) context.Context
- func GetOrFail(ctx context.Context, t fail, key string, value interface{})
- func GetStringOrFail(ctx context.Context, t fail, key string) string
- func PollTimingsFromContext(ctx context.Context) (time.Duration, time.Duration)
- func SetOrFail(ctx context.Context, t fail, key string, value interface{})
- type KVStore
- type Store
Constants ¶
View Source
const ( DefaultPollInterval = 3 * time.Second DefaultPollTimeout = 2 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
func ContextWith ¶
ContextWith decorates the given context with the provided Store, and returns the resulting context.
func ContextWithPollTimings ¶
ContextWithPollTimings returns a context with poll timings set
func GetStringOrFail ¶
Get the string value from the kvstore from key.
func PollTimingsFromContext ¶
PollTimingsFromContext will get the previously set poll timing from context, or return the defaults if not found. - values from context. - defaults.
Types ¶
type KVStore ¶
type KVStore struct {
// contains filtered or unexported fields
}
func (*KVStore) MarshalJSON ¶
type Store ¶
type Store interface { // Get gets the key from the Store into the provided value Get(ctx context.Context, key string, value interface{}) error // Set sets the key into the Store from the provided value Set(ctx context.Context, key string, value interface{}) error }
This is a subset of knative.dev/pkg/kvstore.Interface
func FromContext ¶
FromContext returns the Store from Context, if not found FromContext will panic. TODO: revisit if we really want to panic here... likely not.
Click to show internal directories.
Click to hide internal directories.