github.com/voedger/voedger@v0.0.0-20240520144910-273e84102129/pkg/state/impl_event_storage.go (about)

     1  /*
     2   * Copyright (c) 2023-present unTill Pro, Ltd.
     3   */
     4  
     5  package state
     6  
     7  import (
     8  	"github.com/voedger/voedger/pkg/appdef"
     9  	"github.com/voedger/voedger/pkg/istructs"
    10  )
    11  
    12  type eventStorage struct {
    13  	eventFunc PLogEventFunc
    14  }
    15  
    16  func (s *eventStorage) NewKeyBuilder(_ appdef.QName, _ istructs.IStateKeyBuilder) istructs.IStateKeyBuilder {
    17  	return newKeyBuilder(Event, appdef.NullQName)
    18  }
    19  func (s *eventStorage) Get(_ istructs.IStateKeyBuilder) (istructs.IStateValue, error) {
    20  	return &pLogValue{
    21  		event: s.eventFunc(),
    22  	}, nil
    23  }