func (store *Store) AddStreamRule(rule *graylog.StreamRule) error {
	if rule == nil {
		return fmt.Errorf("rule is nil")
	}
	store.imutex.Lock()
	defer store.imutex.Unlock()
	rules, ok := store.streamRules[rule.StreamID]
	if !ok {
		rules = map[string]graylog.StreamRule{}
	}
	if rule.ID == "" {
		rule.ID = st.NewObjectID()
	}
	rules[rule.ID] = *rule
	store.streamRules[rule.StreamID] = rules
	return nil
}
// AddStreamRule adds a stream rule.
AddStreamRule adds a stream rule.
// AddStreamRule adds a stream rule .
func (store *Store) AddStreamRule(rule *graylog.StreamRule) error {
	if rule == nil {
		return fmt.Errorf("rule is nil")
	}
	store.imutex.Lock()
	defer store.imutex.Unlock()
	rules, ok := store.streamRules[rule.StreamID]
	if !ok {
		rules = map[string]graylog.StreamRule{}
	}
	if rule.ID == "" {
		rule.ID = st.NewObjectID()
	}
	rules[rule.ID] = *rule
	store.streamRules[rule.StreamID] = rules
	return nil
}
func ( store * Store ) AddStreamRule ( rule * graylog . StreamRule ) error { if rule == nil { return fmt . Errorf ( " " ) } store . imutex . Lock ( ) defer store . imutex . Unlock ( ) rules , ok := store . streamRules [ rule . StreamID ] if ! ok { rules = map [ string ] graylog . StreamRule { } } if rule . ID == " " { rule . ID = st . NewObjectID ( ) } rules [ rule . ID ] = * rule store . streamRules [ rule . StreamID ] = rules return nil }
AddStreamRule adds a stream rule.
AddStreamRule adds a stream rule .