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 Copy(list []string) []string
- func Empty(s string) bool
- func GenerateRandomString(length int) string
- func MarshalMsgpack(v interface{}) ([]byte, error)
- func MatchDerivedChannel(name string) (*derivedChannelMatch, error)
- func Merge(orig, v interface{}, defaults bool)
- func Shuffle(list []string) []string
- func SliceContains(s []string, str string) bool
- func Sort(list []string) []string
- func UnmarshalMsgpack(data []byte, v interface{}) error
- type HashSet
- 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 GenerateRandomString ¶ added in v1.2.16
func MarshalMsgpack ¶ added in v1.2.0
MarshalMsgpack returns msgpack encoding of v
func MatchDerivedChannel ¶ added in v1.2.12
This regex check is to retain existing channel params if any e.g [?rewind=1]foo to [filter=xyz?rewind=1]foo. This is to keep channel compatibility around use of channel params that work with derived channels.
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 SliceContains ¶ added in v1.2.16
func UnmarshalMsgpack ¶ added in v1.2.0
UnmarshalMsgpack decodes the MessagePack-encoded data and stores the result in the value pointed to by v.
Types ¶
type HashSet ¶ added in v1.2.16
type HashSet map[string]struct{} // struct {} has zero space complexity
func NewHashSet ¶ added in v1.2.16
func NewHashSet() HashSet