How to remove authoritative matches from server side?

When I creating authoritative matches using runtime.NakamaModule.MatchCreate()
I’d like to delete it when it is played, or at least when there is no joint players during some time.
I saw the MatchRegistry type in nakama sources which represents such method. So how can I use it?

The match can be terminated by returning nil in the match handler functions where appropriate.

You can see an example of terminating a match after being idle for some amount of time in our tic-tac-toe project template - the repo has examples in both Go and TS.

Hope this helps.