handlers

package
v2.0.0-...-cdd4e73 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2024 License: AGPL-3.0-or-later Imports: 31 Imported by: 0

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.

func (Server) Router

func (s Server) Router() *mux.Router

Router returns the underlying router interface for the server.

type SpaceChecker

type SpaceChecker interface {
	Check() (space.Usage, error)
}

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
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL