Versions in this module Expand all Collapse all v1 v1.0.0 Mar 30, 2019 Changes in this version + const BASE + const GDriveDirectoryMimeType + const GDriveRootConfigFile + const GDriveTokenJsonFile + const SERVER_INFO + const SYMBOLS + func Decode(input string) int64 + func Encode(number int64) string + func LoveHandler(h http.Handler) http.HandlerFunc + func RenderFloat(format string, n float64) string + func RenderInteger(format string, n int) string + type GDrive struct + func NewGDriveStorage(clientJsonFilepath string, localConfigPath string, basedir string, ...) (*GDrive, error) + func (s *GDrive) Delete(token string, filename string) (err error) + func (s *GDrive) Get(token string, filename string) (reader io.ReadCloser, contentType string, contentLength uint64, err error) + func (s *GDrive) Head(token string, filename string) (contentType string, contentLength uint64, err error) + func (s *GDrive) IsNotExist(err error) bool + func (s *GDrive) Put(token string, filename string, reader io.Reader, contentType string, ...) error + func (s *GDrive) Type() string + type LocalStorage struct + func NewLocalStorage(basedir string, logger *log.Logger) (*LocalStorage, error) + func (s *LocalStorage) Delete(token string, filename string) (err error) + func (s *LocalStorage) Get(token string, filename string) (reader io.ReadCloser, contentType string, contentLength uint64, err error) + func (s *LocalStorage) Head(token string, filename string) (contentType string, contentLength uint64, err error) + func (s *LocalStorage) IsNotExist(err error) bool + func (s *LocalStorage) Put(token string, filename string, reader io.Reader, contentType string, ...) error + func (s *LocalStorage) Type() string + type Metadata struct + ContentType string + DeletionToken string + Downloads int + MaxDate time.Time + MaxDownloads int + func MetadataForRequest(contentType string, r *http.Request) Metadata + type OptionFn func(*Server) + func ClamavHost(s string) OptionFn + func EnableProfiler() OptionFn + func ForceHTTPs() OptionFn + func GoogleAnalytics(gaKey string) OptionFn + func HttpAuthCredentials(user string, pass string) OptionFn + func Listener(s string) OptionFn + func LogFile(logger *log.Logger, s string) OptionFn + func Logger(logger *log.Logger) OptionFn + func ProfileListener(s string) OptionFn + func RateLimit(requests int) OptionFn + func TLSConfig(cert, pk string) OptionFn + func TLSListener(s string, t bool) OptionFn + func TempPath(s string) OptionFn + func UseLetsEncrypt(hosts []string) OptionFn + func UseStorage(s Storage) OptionFn + func UserVoice(userVoiceKey string) OptionFn + func VirustotalKey(s string) OptionFn + func WebPath(s string) OptionFn + type S3Storage struct + func NewS3Storage(accessKey, secretKey, bucketName, endpoint string, logger *log.Logger, ...) (*S3Storage, error) + func (s *S3Storage) Delete(token string, filename string) (err error) + func (s *S3Storage) Get(token string, filename string) (reader io.ReadCloser, contentType string, contentLength uint64, err error) + func (s *S3Storage) Head(token string, filename string) (contentType string, contentLength uint64, err error) + func (s *S3Storage) IsNotExist(err error) bool + func (s *S3Storage) Put(token string, filename string, reader io.Reader, contentType string, ...) (err error) + func (s *S3Storage) Type() string + type Server struct + AuthPass string + AuthUser string + Certificate string + ClamAVDaemonHost string + LetsEncryptCache string + ListenerString string + ProfileListenerString string + TLSListenerOnly bool + TLSListenerString string + VirusTotalKey string + func New(options ...OptionFn) (*Server, error) + func (s *Server) BasicAuthHandler(h http.Handler) http.HandlerFunc + func (s *Server) CheckDeletionToken(deletionToken, token, filename string) error + func (s *Server) CheckMetadata(token, filename string) error + func (s *Server) Lock(token, filename string) error + func (s *Server) RedirectHandler(h http.Handler) http.HandlerFunc + func (s *Server) Run() + func (s *Server) Unlock(token, filename string) error + type Storage interface + Delete func(token string, filename string) error + Get func(token string, filename string) (reader io.ReadCloser, contentType string, contentLength uint64, err error) + Head func(token string, filename string) (contentType string, contentLength uint64, err error) + IsNotExist func(err error) bool + Put func(token string, filename string, reader io.Reader, contentType string, ...) error + Type func() string