File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ type JournalReaderConfig struct {
3737 // Show only journal entries whose fields match the supplied values. If
3838 // the array is empty, entries will not be filtered.
3939 Matches []Match
40+
41+ // If not empty, the journal instance will point to a journal residing
42+ // in this directory. The supplied path may be relative or absolute.
43+ Path string
4044}
4145
4246// JournalReader is an io.ReadCloser which provides a simple interface for iterating through the
@@ -50,9 +54,14 @@ type JournalReader struct {
5054func NewJournalReader (config JournalReaderConfig ) (* JournalReader , error ) {
5155 r := & JournalReader {}
5256
53- var err error
5457 // Open the journal
55- if r .journal , err = NewJournal (); err != nil {
58+ var err error
59+ if config .Path != "" {
60+ r .journal , err = NewJournalFromDir (config .Path )
61+ } else {
62+ r .journal , err = NewJournal ()
63+ }
64+ if err != nil {
5665 return nil , err
5766 }
5867
You can’t perform that action at this time.
0 commit comments