file

package
v0.0.2-beta.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLocalFileService

func NewLocalFileService(config *local.Config) (*fileserver.S3Adapter, error)

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

Types

type Config

type Config struct {
	HTTP HTTPConfig `json:"http" yaml:"http"`
}

Config contains the complete configuration for the file web service.

type HTTPConfig

type HTTPConfig struct {
	Address string   `json:"address" yaml:"address"`
	Cors    []string `json:"cors" yaml:"cors"`
}

HTTPConfig contains HTTP server configuration for the file service.

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(config *Config, storage *fileserver.S3Adapter) *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