// newEventCacheKey returns a new eventCacheKey
194287
func newEventCacheKey(chConfig fab.ChannelCfg, opts ...options.Opt) (*eventCacheKey, error) {
	params := defaultParams()
	options.Apply(params, opts)

	h := sha256.New()
	if _, err := h.Write([]byte(params.getOptKey())); err != nil {
		return nil, err
	}
	hash := h.Sum([]byte(chConfig.ID()))

	return &eventCacheKey{
		channelConfig: chConfig,
		key:           string(hash),
		opts:          opts,
	}, nil
}
941263
func NewEventHandler(eventHandler eh.EventHandler) *EventHandler {
	h := &EventHandler{
		EventHandler: eventHandler,
		eventsCh:     make(chan data),
		errCh:        make(chan error, 1),
	}

	go h.run()

	return h
}
101171
func NewEventMouse(x, y int, btn ButtonMask, mod ModMask) *EventMouse {
	return &EventMouse{t: time.Now(), x: x, y: y, btn: btn, mod: mod}
}
953908
func (mr *MockServerInfoSourceMockRecorder) NewEvent(t interface{}, opts ...interface{}) *gomock.Call {
	varargs := append([]interface{}{t}, opts...)
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewEvent", reflect.TypeOf((*MockServerInfoSource)(nil).NewEvent), varargs...)
}
1011698
func NewEventManager(storagePolicy StoragePolicy) *events {
	return &events{
		eventStore:    make(map[EventType]*utils.TimedStore, 0),
		watchers:      make(map[int]*watch),
		storagePolicy: storagePolicy,
	}
}
670037
func newCtxtCacheKey(ctx fab.ClientContext) (*ctxtCacheKey, error) {
	identity, err := ctx.Serialize()
	if err != nil {
		return nil, err
	}

	h := sha256.New()
	if _, err := h.Write(identity); err != nil {
		return nil, err
	}

	hash := h.Sum(nil)

	return &ctxtCacheKey{
		key:     string(hash),
		context: ctx,
	}, nil
}
672550
func NewObjectCache(listObject listObjectFunc, watchObject watchObjectFunc, newObject newObjectFunc, groupResource schema.GroupResource) Store {
	return &objectCache{
		listObject:    listObject,
		watchObject:   watchObject,
		newObject:     newObject,
		groupResource: groupResource,
		items:         make(map[objectKey]*objectCacheItem),
	}
}
259305
func NewEvent(event interface{}, sourceURL string) *Event {
	return &Event{
		SourceURL: sourceURL,
		Event:     event,
	}
}
589455
func (evc *EventCache) FireEvent(event string, data EventData) {
	// append to list (go will grow our backing array exponentially)
	evc.events = append(evc.events, eventInfo{event, data})
}
1361051
func newChannelCache(n int) *channelCache {
	return &channelCache{
		n:        n,
		channels: make(map[uint64]ChannelEdge),
	}
}
1305713
func NewNonceCache(capacity int, cacheTTL int, clock holster.Clock) *NonceCache {
	return &NonceCache{
		cache:    holster.NewTTLMapWithClock(capacity, clock),
		cacheTTL: cacheTTL,
		clock:    clock,
	}
}
333413
func NewEventHandler(projector Projector, repo eh.ReadWriteRepo) *EventHandler {
	return &EventHandler{
		projector: projector,
		repo:      repo,
	}
}
18745
func NewEvent(title, text string) *Event {
	return &Event{
		Title: title,
		Text:  text,
	}
}
1087259
func newEvent(typ string, value interface{}, prevValue interface{}) *event {
	return &event{
		typ:       typ,
		value:     value,
		prevValue: prevValue,
	}
}
448555
func NewKey() Key {
	key := new([KeySize]byte)
	randombytes.MustRead(key[:])
	return key
}
1265598
func (e *eventLogger) lastEventObservationFromCache(key string) eventLog {
	value, ok := e.cache.Get(key)
	if ok {
		observationValue, ok := value.(eventLog)
		if ok {
			return observationValue
		}
	}
	return eventLog{}
}
224415
func NewCacheKeyIterator(cache *Cache, size int, interrupt chan struct{}) KeyIterator {
	keys := cache.Keys()

	chans := make([]chan struct{}, len(keys))
	for i := 0; i < len(keys); i++ {
		chans[i] = make(chan struct{}, 1)
	}

	cki := &cacheKeyIterator{
		i:         -1,
		size:      size,
		cache:     cache,
		order:     keys,
		ready:     chans,
		blocks:    make([][]cacheBlock, len(keys)),
		interrupt: interrupt,
	}
	go cki.encode()
	return cki
}