web

package
v0.1.29 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	Login(ctx context.Context, username blinkfile.Username, password string, requestData app.SessionRequestData) (app.Session, error)
	Logout(context.Context, app.Token) error
	IsAuthenticated(context.Context, app.Token) (blinkfile.UserID, bool, error)
	ListFiles(context.Context, blinkfile.UserID) ([]blinkfile.FileHeader, error)
	UploadFile(context.Context, app.UploadFileArgs) error
	DownloadFile(ctx context.Context, userID blinkfile.UserID, fileID blinkfile.FileID, pass string) (blinkfile.FileHeader, error)
	DeleteFiles(context.Context, blinkfile.UserID, []blinkfile.FileID) error
	SubscribeToFileChanges(blinkfile.UserID) (<-chan app.FileEvent, func())
	CreateUser(context.Context, app.CreateUserArgs) error
	ListUsers(context.Context) ([]blinkfile.User, error)
	DeleteUsers(context.Context, []blinkfile.UserID) error

	app.Log
}

type Config

type Config struct {
	Title                         string
	App                           App
	Port                          int
	MaxFileByteSize               int64
	BrowserSessionExpiration      time.Duration
	ReadTimeout                   time.Duration
	WriteTimeout                  time.Duration
	RateLimitUnauthenticated      float64
	RateLimitBurstUnauthenticated int
	TestAutomator                 TestAutomator
}

type ErrorView

type ErrorView struct {
	LayoutView
	ID       string
	Type     string
	Title    string
	Detail   string
	Instance string
	Status   int
}

func ParseAppErr

func ParseAppErr(ctx context.Context, a App, err error) ErrorView

type FileDownloadView

type FileDownloadView struct {
	LayoutView
	ID string
	MessageView
}

type FileView

type FileView struct {
	ID                string
	Name              string
	Uploaded          string
	Expires           string
	Downloads         int64
	DownloadLimit     int64
	ByteSize          int64
	Size              string
	PasswordProtected bool
}

type FilesView

type FilesView struct {
	LayoutView
	Files []FileView
	MessageView
}

type HTML

type HTML struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, cfg Config) (html *HTML, err error)

func (*HTML) Start

func (html *HTML) Start(ctx context.Context) <-chan error

type LayoutView

type LayoutView struct {
	Title string
}

type LoginView

type LoginView struct {
	LayoutView
	MessageView
}

type MessageView

type MessageView struct {
	SuccessMessage string
	ErrorView
}

type Session

type Session struct {
	*sessions.Session
}

type TestAutomator

type TestAutomator interface {
	TestAutomation(ctx context.Context, args testautomation.Args) error
}

type UserView added in v0.1.13

type UserView struct {
	ID       string
	Username string
}

type UsersView added in v0.1.13

type UsersView struct {
	LayoutView
	Users []UserView
	MessageView
}

Jump to

Keyboard shortcuts

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