transparency-dev / trillian-tessera

Go library for building tile-based transparency logs (tlogs)
Apache License 2.0
11 stars 11 forks source link

POSIX: inline log initialization #202

Closed mhutchinson closed 2 months ago

mhutchinson commented 2 months ago

Both personalities had duplicate code for creating directories and writing out an empty checkpoint. This logic is going to be the same for any POSIX log usage, so it should be part of the log implementation.

For now, this is behind an extra parameter that is passed to New. There may be better ways to set this up, but I tried a few and this was the best. This is a pragmatic step forward and better than what we had, so let's get this in and refactor further from here if needed.

Also cleaned up the New method by moving an inline function that was assigned to a field is instead defined as a method.