Skip to content

Commit

Permalink
Add method to retrieve DataStore from ProtoStore (#58)
Browse files Browse the repository at this point in the history
Added `GetDataStore` method to `ProtoStore`
  • Loading branch information
jeyhun authored Aug 21, 2023
1 parent 5d1b86a commit 6bf6d1e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/protostore/protostore.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ type ProtoStore interface {
MsgToFilter(ctx context.Context, id string, msg proto.Message) (pMsg *ProtoStoreMsg, err error)
MsgToPersist(ctx context.Context, id string, msg proto.Message, md Metadata) (pMsg *ProtoStoreMsg, err error)

GetDataStore() datastore.DataStore
GetAuthorizer() authorizer.Authorizer
DropTables(msgs ...proto.Message) error
}
Expand Down Expand Up @@ -145,6 +146,10 @@ func GetProtoStore(logger *logrus.Entry, ds datastore.DataStore) ProtoStore {
return p
}

func (p ProtobufDataStore) GetDataStore() datastore.DataStore {
return p.ds
}

func (p ProtobufDataStore) GetAuthorizer() authorizer.Authorizer {
return p.ds.GetAuthorizer()
}
Expand Down

0 comments on commit 6bf6d1e

Please sign in to comment.