Documentation ¶
Index ¶
- func AssignString(values ...string) string
- func ComputeDelta(last, current, defaultValue uint64) uint64
- func GetStdBucket(key string) *stats.StandardDeviation
- func JoinString(strs ...string) string
- func MinInt(a, b int) int
- func PreserveHeaderForRedirect(req *http.Request, via []*http.Request) error
- func RandStringBytes(n int) []byte
- func ReadFile(filename string) (osrelease map[string]string, err error)
- func ReceiverHeader(h *http.Header) (token, topicFN, pulsarURL string, err bool)
- func ReportError(err error) error
- func ResponseErrorJSON(e error, w http.ResponseWriter, statusCode int)
- func SingleSlashJoin(a, b string) string
- func StrContains(strs []string, str string) bool
- func StrToInt(str string, defaultNum int) int
- func TimeDuration(configV, defaultV int, timeUnit time.Duration) time.Duration
- func TokenSupplierWithOverride(token string, supplier func() (string, error)) func() (string, error)
- func TokenizeTopicFullName(topicFn string) (isPersistent bool, tenant, namespace, topic string, err error)
- func TopicFnToURL(topicFn string) (string, error)
- func Trim(str string) string
- func VerifyMessageByPulsarConsumer(client pulsar.Client, topicName, expectedMessage string, ...) error
- type ConsumerResult
- type ResponseErr
- type SyncMap
- func (sm *SyncMap) Get(key interface{}) interface{}
- func (sm *SyncMap) GetOrDefault(key interface{}, defaultValue interface{}) interface{}
- func (sm *SyncMap) IsEmpty() bool
- func (sm *SyncMap) Put(key interface{}, value interface{}) interface{}
- func (sm *SyncMap) Remove(key interface{})
- func (sm *SyncMap) Replace(key interface{}, value interface{}) interface{}
- func (sm *SyncMap) Size() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssignString ¶
AssignString returns the first non-empty string It is equivalent the following in Javascript var value = val0 || val1 || val2 || default
func ComputeDelta ¶
ComputeDelta computes positive delta between last and current integer value, returns a default if the delta is negative
func GetStdBucket ¶
func GetStdBucket(key string) *stats.StandardDeviation
GetStdBucket gets the standard deviation bucket
func PreserveHeaderForRedirect ¶
PreserveHeaderForRedirect preserves HTTP headers during HTTP redirect
func RandStringBytes ¶
RandStringBytes generates n length byte array with each byte is randomly picked from lower or upper case letters
func ReadFile ¶
ReadFile reads /etc/lsd_release Similar to Read(), but takes the name of a file to load instead
func ReceiverHeader ¶
ReceiverHeader parses headers for Pulsar required configuration
func ResponseErrorJSON ¶
func ResponseErrorJSON(e error, w http.ResponseWriter, statusCode int)
ResponseErrorJSON builds a Http response.
func SingleSlashJoin ¶
SingleSlashJoin joins two parts of url path with no double slash
func StrContains ¶
StrContains check if a string is contained in an array of string
func StrToInt ¶
StrToInt converts string to an integer format with a default if inproper value retrieved
func TimeDuration ¶
TimeDuration evaluate the run interval with the guard default value
func TokenizeTopicFullName ¶
func TokenizeTopicFullName(topicFn string) (isPersistent bool, tenant, namespace, topic string, err error)
TokenizeTopicFullName tokenizes a topic full name into persistent, tenant, namespace, and topic name.
func TopicFnToURL ¶
TopicFnToURL converts fully qualified topic name to url route
func VerifyMessageByPulsarConsumer ¶
func VerifyMessageByPulsarConsumer(client pulsar.Client, topicName, expectedMessage string, receiveTimeout time.Duration, wg *sync.WaitGroup, completeChan chan *ConsumerResult) error
VerifyMessageByPulsarConsumer instantiates a Pulsar consumer and verifies an expected message
Types ¶
type ConsumerResult ¶
type ConsumerResult struct { Err error InOrderDelivery bool Latency time.Duration Timestamp time.Time }
ConsumerResult is Pulsar Consumer result for channel communication
type ResponseErr ¶
type ResponseErr struct {
Error string `json:"error"`
}
ResponseErr - Error struct for Http response
type SyncMap ¶
SyncMap is a generic map data structure protected with syc.RWMutex
func (*SyncMap) Get ¶
func (sm *SyncMap) Get(key interface{}) interface{}
Get returns the value to which the specified key is mapped, or nil if this map contains no mapping for the key.
func (*SyncMap) GetOrDefault ¶
func (sm *SyncMap) GetOrDefault(key interface{}, defaultValue interface{}) interface{}
GetOrDefault returns the value to which the specified key is mapped, or nil if this map contains no mapping for the key.
func (*SyncMap) Put ¶
func (sm *SyncMap) Put(key interface{}, value interface{}) interface{}
Put associates the specified value with the specified key in this map
func (*SyncMap) Remove ¶
func (sm *SyncMap) Remove(key interface{})
Remove removes the specified key and associsated value