Documentation
¶
Index ¶
- func After(ctx context.Context, d time.Duration) <-chan time.Time
- func BaseID() (string, error)
- func ContextWithTimeout(ctx context.Context, after TimerFunc, timeout time.Duration) (context.Context, context.CancelFunc)
- func MarshalMsgpack(v interface{}) ([]byte, error)
- func Merge(orig, v interface{}, defaults bool)
- func UnmarshalMsgpack(data []byte, v interface{}) error
- type TimerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func After ¶ added in v1.2.0
After returns a channel that is sent the current time once the given duration has passed. If the context is cancelled before that, the channel is immediately closed.
func BaseID ¶ added in v1.1.0
BaseID returns a base64 encoded 9 random bytes to be used in idempotent rest publishing as part of message id.
Spec RSL1k1
func ContextWithTimeout ¶ added in v1.2.0
func ContextWithTimeout(ctx context.Context, after TimerFunc, timeout time.Duration) (context.Context, context.CancelFunc)
ContextWithTimeout is like context.WithTimeout, but using the provided TimerFunc for setting the timer.
func MarshalMsgpack ¶ added in v1.2.0
MarshalMsgpack returns msgpack encoding of v
func Merge ¶
func Merge(orig, v interface{}, defaults bool)
merge iterates over fields of struct pointed by v and when it's non-zero, copies its value to corresponding filed in orig.
merge assumes both orig and v are pointers to a struct value of the same type.
When defaults is true, merge uses v as the source of default values for each field; the default is copied when orig's field is a zero-value.
func UnmarshalMsgpack ¶ added in v1.2.0
UnmarshalMsgpack decodes the MessagePack-encoded data and stores the result in the value pointed to by v.