Documentation
¶
Index ¶
Constants ¶
View Source
const ( S3Prefix = common.S3Prefix GCSPrefix = common.GCSPrefix AzurePrefix = common.AzurePrefix DRSPrefix = common.DRSPrefix DefaultS3Region = "us-east-1" DefaultSigningExpirySeconds = 900 // 15 minutes // --- Route Constants --- RouteHealthz = "/healthz" // LFS RouteLFSBatch = "/info/lfs/objects/batch" RouteLFSMetadata = "/info/lfs/objects/metadata" RouteLFSObject = "/info/lfs/objects/{oid}" RouteLFSVerify = "/info/lfs/verify" // Metrics RouteMetricsFiles = "/index/v1/metrics/files" RouteMetricsFileDetail = "/index/v1/metrics/files/{object_id}" RouteMetricsSummary = "/index/v1/metrics/summary" // Docs RouteSwaggerUI = "/index/swagger" RouteSwaggerUIAlt = "/index/swagger/" RouteOpenAPISpec = "/index/openapi.yaml" RouteLFSSpec = "/index/openapi-lfs.yaml" RouteBucketSpec = "/index/openapi-bucket.yaml" RouteInternalSpec = "/index/openapi-internal.yaml" // Internal DRS Data RouteInternalDownload = "/data/download/{file_id}" RouteInternalDownloadPart = "/data/download/{file_id}/part" RouteInternalUpload = "/data/upload" RouteInternalUploadURL = "/data/upload/{file_id}" RouteInternalUploadBulk = "/data/upload/bulk" RouteInternalMultipartInit = "/data/multipart/init" RouteInternalMultipartUpload = "/data/multipart/upload" RouteInternalMultipartComplete = "/data/multipart/complete" RouteInternalBuckets = "/data/buckets" RouteInternalBucketDetail = "/data/buckets/{bucket}" RouteInternalBucketScopes = "/data/buckets/{bucket}/scopes" // Internal DRS Index RouteInternalIndex = "/index" RouteInternalIndexDetail = "/index/{id}" RouteInternalBulkHashes = "/index/bulk/hashes" RouteInternalBulkDeleteHashes = "/index/bulk/delete" RouteInternalBulkSHA256 = "/index/bulk/sha256/validity" RouteInternalBulkCreate = "/index/bulk" RouteInternalBulkDocs = "/index/bulk/documents" // Core API RouteCoreSHA256 = "/index/v1/sha256/validity" )
View Source
const ( AuthModeLocal = "local" AuthModeGen3 = "gen3" )
View Source
const ( DefaultLFSMaxBatchObjects = 1000 DefaultLFSMaxBatchBodyBytes int64 = 10 * 1024 * 1024 // 10 MiB DefaultLFSRequestLimitPerMinute = 1200 // 20 req/sec average per client DefaultLFSBandwidthLimitBytesPerMinute int64 = 0 // disabled by default )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthCacheConfig ¶ added in v0.2.4
type AuthCacheConfig struct {
Enabled bool `json:"enabled" yaml:"enabled"`
TTLSeconds int `json:"ttl_seconds" yaml:"ttl_seconds"`
NegativeTTL int `json:"negative_ttl_seconds" yaml:"negative_ttl_seconds"`
MaxEntries int `json:"max_entries" yaml:"max_entries"`
CleanupEvery int `json:"cleanup_seconds" yaml:"cleanup_seconds"`
}
type AuthConfig ¶
type AuthConfig struct {
Mode string `json:"mode" yaml:"mode"`
Basic BasicAuthConfig `json:"basic" yaml:"basic"`
Mock MockAuthConfig `json:"mock" yaml:"mock"`
Cache AuthCacheConfig `json:"cache" yaml:"cache"`
PluginPaths PluginPaths `json:"plugin_paths" yaml:"plugin_paths"`
FenceURL string `json:"fence_url" yaml:"fence_url"`
}
type BasicAuthConfig ¶
type BasicAuthConfig struct {
Username string `json:"username" yaml:"username"`
Password string `json:"password" yaml:"password"`
}
func (BasicAuthConfig) MarshalJSON ¶ added in v0.2.4
func (b BasicAuthConfig) MarshalJSON() ([]byte, error)
SECURITY FIX MED-1: Redact password when marshaling to JSON
type Config ¶
type Config struct {
Port int `json:"port" yaml:"port"`
Database DatabaseConfig `json:"database" yaml:"database"`
S3Credentials []S3Config `json:"s3_credentials" yaml:"s3_credentials"`
Auth AuthConfig `json:"auth" yaml:"auth"`
LFS LFSConfig `json:"lfs" yaml:"lfs"`
Signing SigningConfig `json:"signing" yaml:"signing"`
Routes RoutesConfig `json:"routes" yaml:"routes"`
}
func LoadConfig ¶
type DatabaseConfig ¶
type DatabaseConfig struct {
Sqlite *SqliteConfig `json:"sqlite,omitempty" yaml:"sqlite,omitempty"`
Postgres *PostgresConfig `json:"postgres,omitempty" yaml:"postgres,omitempty"`
}
type LFSConfig ¶
type LFSConfig struct {
MaxBatchObjects int `json:"max_batch_objects" yaml:"max_batch_objects"`
MaxBatchBodyBytes int64 `json:"max_batch_body_bytes" yaml:"max_batch_body_bytes"`
RequestLimitPerMinute int `json:"request_limit_per_minute" yaml:"request_limit_per_minute"`
BandwidthLimitBytesPerMinute int64 `json:"bandwidth_limit_bytes_per_minute" yaml:"bandwidth_limit_bytes_per_minute"`
}
type MockAuthConfig ¶ added in v0.2.4
type PluginPaths ¶ added in v0.2.4
type PostgresConfig ¶
type PostgresConfig struct {
Host string `json:"host" yaml:"host"`
Port int `json:"port" yaml:"port"`
User string `json:"user" yaml:"user"`
Password string `json:"password" yaml:"password"`
Database string `json:"database" yaml:"database"`
SSLMode string `json:"sslmode" yaml:"sslmode"`
}
func (PostgresConfig) MarshalJSON ¶ added in v0.2.4
func (p PostgresConfig) MarshalJSON() ([]byte, error)
SECURITY FIX MED-1: Redact password when marshaling to JSON
type RoutesConfig ¶
type S3Config ¶
type S3Config struct {
Bucket string `json:"bucket" yaml:"bucket"`
Provider string `json:"provider,omitempty" yaml:"provider,omitempty"`
Region string `json:"region" yaml:"region"`
AccessKey string `json:"access_key" yaml:"access_key"`
SecretKey string `json:"secret_key" yaml:"secret_key"`
Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"`
}
func (S3Config) MarshalJSON ¶ added in v0.2.4
SECURITY FIX MED-1: Redact secret key when marshaling to JSON
type SigningConfig ¶
type SigningConfig struct {
DefaultExpirySeconds int `json:"default_expiry_seconds" yaml:"default_expiry_seconds"`
}
type SqliteConfig ¶
type SqliteConfig struct {
File string `json:"file" yaml:"file"`
}
Click to show internal directories.
Click to hide internal directories.