server

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogAndExit added in v0.3.9

func LogAndExit(msg string)

LogAndExit logs an error message to stderr and exits with status code 1.

Types

type Config added in v0.3.1

type Config struct {
	Endpoint          string
	ReadTimeout       time.Duration
	WriteTimeout      time.Duration
	IdleTimeout       time.Duration
	ReadHeaderTimeout time.Duration
}

Config holds HTTP server configuration options.

type GatewayServer

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

func NewGatewayServer

func NewGatewayServer(opts *Options) (*GatewayServer, error)

NewGatewayServer constructs a server that exposes the S3 API backed by NATS. Returns an error if initialization fails (e.g., cannot connect to NATS).

func (*GatewayServer) Start added in v0.3.1

func (s *GatewayServer) Start() error

Start starts the HTTP server with the provided configuration and blocks until it exits.

type GatewayServerOptions added in v0.3.9

type GatewayServerOptions struct {
	NATSReplicas int
}

type Options added in v0.3.9

type Options struct {
	ServerListen      string
	NatsServers       string
	User              string
	Password          string
	Token             string
	NkeyFile          string
	CredsFile         string
	Replicas          int
	CredentialsFile   string
	LogFormat         string
	LogLevel          string
	ReadTimeout       time.Duration
	WriteTimeout      time.Duration
	IdleTimeout       time.Duration
	ReadHeaderTimeout time.Duration
}

Options holds all configuration options for the NATS S3 server.

func ConfigureOptions added in v0.3.9

func ConfigureOptions(fs *flag.FlagSet, args []string, printVersion, printHelp func()) (*Options, error)

ConfigureOptions parses command-line arguments and returns an Options struct. It handles -h/--help and -v/--version flags by calling the provided callbacks. Returns nil options and nil error when help or version flags are used.

Jump to

Keyboard shortcuts

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