-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define app store interface in client packages (#536)
It makes more sense for the consuming packages to define the interface to the application data store. The SQLite implementation should just export what it exports, and the clients define interfaces over what they need.
- Loading branch information
Showing
20 changed files
with
105 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package handlers | ||
|
||
import ( | ||
"io" | ||
|
||
"github.com/mtlynch/picoshare/v2/picoshare" | ||
) | ||
|
||
type Store interface { | ||
GetEntriesMetadata() ([]picoshare.UploadMetadata, error) | ||
GetEntry(id picoshare.EntryID) (picoshare.UploadEntry, error) | ||
GetEntryMetadata(id picoshare.EntryID) (picoshare.UploadMetadata, error) | ||
InsertEntry(reader io.Reader, metadata picoshare.UploadMetadata) error | ||
UpdateEntryMetadata(id picoshare.EntryID, metadata picoshare.UploadMetadata) error | ||
DeleteEntry(id picoshare.EntryID) error | ||
GetGuestLink(picoshare.GuestLinkID) (picoshare.GuestLink, error) | ||
GetGuestLinks() ([]picoshare.GuestLink, error) | ||
InsertGuestLink(picoshare.GuestLink) error | ||
DeleteGuestLink(picoshare.GuestLinkID) error | ||
InsertEntryDownload(picoshare.EntryID, picoshare.DownloadRecord) error | ||
GetEntryDownloads(id picoshare.EntryID) ([]picoshare.DownloadRecord, error) | ||
ReadSettings() (picoshare.Settings, error) | ||
UpdateSettings(picoshare.Settings) error | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.