http

package
v2.29.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 48 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultTokenExpirationTime = time.Hour * 2
)
View Source
const (
	WSWriteDeadline = 10 * time.Second
)

Variables

View Source
var (
	NonModifiableFieldsForNonAdmin = []string{"Username", "Scope", "LockPassword", "Perm", "Commands", "Rules"}
)

Functions

func NewHandler

func NewHandler(
	imgSvc ImgService,
	fileCache FileCache,
	store *storage.Storage,
	server *settings.Server,
	assetsFs fs.FS,
) (http.Handler, error)

func PreviewSizeNames added in v2.6.1

func PreviewSizeNames() []string

PreviewSizeNames returns a list of possible string values of PreviewSize.

Types

type DiskUsageResponse added in v2.22.0

type DiskUsageResponse struct {
	Total uint64 `json:"total"`
	Used  uint64 `json:"used"`
}

type FileCache added in v2.6.0

type FileCache interface {
	Store(ctx context.Context, key string, value []byte) error
	Load(ctx context.Context, key string) ([]byte, bool, error)
	Delete(ctx context.Context, key string) error
}

type ImgService added in v2.6.0

type ImgService interface {
	FormatFromExtension(ext string) (img.Format, error)
	Resize(ctx context.Context, in io.Reader, width, height int, out io.Writer, options ...img.Option) error
}

type PreviewSize added in v2.6.1

type PreviewSize int

ENUM( thumb big )

const (
	// PreviewSizeThumb is a PreviewSize of type Thumb
	PreviewSizeThumb PreviewSize = iota
	// PreviewSizeBig is a PreviewSize of type Big
	PreviewSizeBig
)

func ParsePreviewSize added in v2.6.1

func ParsePreviewSize(name string) (PreviewSize, error)

ParsePreviewSize attempts to convert a string to a PreviewSize

func (PreviewSize) MarshalText added in v2.6.1

func (x PreviewSize) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (*PreviewSize) Scan added in v2.6.1

func (x *PreviewSize) Scan(value interface{}) error

Scan implements the Scanner interface.

func (PreviewSize) String added in v2.6.1

func (x PreviewSize) String() string

String implements the Stringer interface.

func (*PreviewSize) UnmarshalText added in v2.6.1

func (x *PreviewSize) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

func (PreviewSize) Value added in v2.6.1

func (x PreviewSize) Value() (driver.Value, error)

Value implements the driver Valuer interface.

Jump to

Keyboard shortcuts

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