Documentation
¶
Index ¶
- func Duration(s string, fallback time.Duration) time.Duration
- type AutocertTLS
- type CORSConfig
- type Config
- type ContentSecurityConf
- type CryptionConf
- type ErrorResponse
- type LocalStorage
- type ManualTLS
- type RouteConfig
- type S3Config
- type S3Storage
- type SecurityConfig
- type Server
- type StorageBackend
- type TLSConfig
- type TelemetryConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AutocertTLS ¶ added in v0.1.0
type CORSConfig ¶
type Config ¶
type Config struct {
Port int
Host string
Prefork bool
BodyLimit int
Timeout time.Duration
MaxConns int
MaxBytes int
MetricsPath string
HealthPath string
ShutdownTimeout time.Duration
RecoverStack bool
APIPrefix string
Routes []RouteConfig
// Security
SecurityHeaders *middleware.SecurityHeadersConfig
CSRF *middleware.CSRFConfig
RateLimit *middleware.RateLimitConfig
TLS *TLSConfig
SSRF *middleware.SSRFConfig
}
func DefaultConfig ¶
func DefaultConfig() Config
type ContentSecurityConf ¶
type CryptionConf ¶
type ErrorResponse ¶
type LocalStorage ¶
type LocalStorage struct {
// contains filtered or unexported fields
}
func NewLocalStorage ¶
func NewLocalStorage(root string) (*LocalStorage, error)
func (*LocalStorage) Download ¶
func (l *LocalStorage) Download(ctx context.Context, key string) (io.ReadCloser, error)
type RouteConfig ¶
type S3Storage ¶
type S3Storage struct {
// contains filtered or unexported fields
}
func NewS3Storage ¶
type SecurityConfig ¶
type SecurityConfig struct {
ContentSecurity *ContentSecurityConf
Cryption *CryptionConf
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func New ¶
func New(cfg Config, telemetry TelemetryConfig, security SecurityConfig, corsCfg *CORSConfig) *Server
type StorageBackend ¶
type StorageBackend interface {
Upload(ctx context.Context, key string, reader io.Reader, size int64, contentType string) error
Download(ctx context.Context, key string) (io.ReadCloser, error)
Delete(ctx context.Context, key string) error
}
StorageBackend abstracts file storage operations.
type TLSConfig ¶ added in v0.1.0
type TLSConfig struct {
Enabled bool `json:"enabled"`
Manual *ManualTLS `json:"manual" config:",optional"`
Autocert *AutocertTLS `json:"autocert" config:",optional"`
MinVersion string `json:"min_version" config:",optional"`
MaxVersion string `json:"max_version" config:",optional"`
CurvePrefs []string `json:"curve_preferences" config:",optional"`
CipherSuites []string `json:"cipher_suites" config:",optional"`
RedirectHTTP bool `json:"redirect_http" config:",optional"`
RedirectPort int `json:"redirect_port" config:",optional"`
}
Click to show internal directories.
Click to hide internal directories.