s3ju

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: AGPL-3.0 Imports: 10 Imported by: 0

README

s3ju: soju upload plugin for s3-compatible storage

s3ju is a tiny program that bridges the soju HTTP file upload API with an arbitrary s3-compatible storage platform.

Configuration

A configuration file is required, with the following data:

listen-on localhost:9999
s3-endpoint s3-host.example
s3-access-key your-access-key
s3-secret-key your-secret-key
s3-bucket your-bucket
s3-public-url https://s3-host.example/your-bucket

AGPL-3.0-only, see COPYING. (c) Taavi Väänänen, 2025.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfigPath = "s3ju.cfg"

Functions

func RandStringRunes

func RandStringRunes(n int) string

Types

type Config

type Config struct {
	ListenOn    string `scfg:"listen-on"`
	S3Endpoint  string `scfg:"s3-endpoint"`
	S3AccessKey string `scfg:"s3-access-key"`
	S3SecretKey string `scfg:"s3-secret-key"`
	S3Bucket    string `scfg:"s3-bucket"`
	S3PublicUrl string `scfg:"s3-public-url"`
}

func LoadConfig

func LoadConfig(file string) (*Config, error)

func (*Config) CreateS3Client

func (c *Config) CreateS3Client() (*minio.Client, error)

type Server

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

func NewServer

func NewServer(cfg *Config) *Server

func (*Server) HandleUpload

func (s *Server) HandleUpload(w http.ResponseWriter, r *http.Request)

func (*Server) Listen

func (s *Server) Listen()

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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