file

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLocalFileService

func NewLocalFileService(conf LocalFileServiceConfig) (*fileserver.FileServer, error)

NewLocalFileService creates a new CDN adapter configured for local file storage. It sets up the local storage client and wraps it with caching and S3-compatible interface.

Types

type LocalFileServiceConfig added in v0.0.3

type LocalFileServiceConfig struct {
	RootDir    string `json:"root_dir" yaml:"root_dir"`
	PublicBase string `json:"public_base" yaml:"public_base"`
}

type Web

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

Web provides a file upload and download web service with S3-compatible storage.

func NewWebServer

func NewWebServer(engine httpx.Engine, storage *fileserver.FileServer) *Web

NewWebServer creates a new file web server with the given configuration and storage adapter.

func (*Web) Identifier

func (w *Web) Identifier() string

Identifier returns the service identifier for the file web server.

func (*Web) Start

func (w *Web) Start(ctx context.Context) error

Start begins serving the file web server with upload and download endpoints. It configures CORS, registers file upload/download handlers, and starts the HTTP server.

func (*Web) Stop

func (w *Web) Stop(ctx context.Context) error

Stop gracefully shuts down the file web server.

Jump to

Keyboard shortcuts

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