Documentation ¶
Index ¶
Constants ¶
View Source
const ( GuestLinkIDLength = 16 GuestLinkByteLimitMinimum = 1024 * 1024 )
View Source
const EntryIDLength = 10
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EntryPostResponse ¶
type EntryPostResponse struct {
ID string `json:"id"`
}
type GuestLinkPostResponse ¶
type GuestLinkPostResponse struct {
ID string `json:"id"`
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func New ¶
func New(authenticator auth.Authenticator, store Store, spaceChecker SpaceChecker, collector *garbagecollect.Collector) Server
New creates a new server with all the state it needs to satisfy HTTP requests.
type SpaceChecker ¶
type Store ¶
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 }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.