config

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultAddr              = ":3000"
	DefaultActionsResultsURL = "https://results-receiver.actions.githubusercontent.com"
	DefaultTokenIssuer       = "https://token.actions.githubusercontent.com"
	DefaultDBPostgresSSLMode = "prefer"
	DefaultDBMySQLTLS        = "preferred"

	MinS3UploadPartSizeBytes         = 5 * 1024 * 1024
	DefaultS3KeyPrefix               = "gh-actions-cache"
	DefaultS3UploadPartSizeBytes     = MinS3UploadPartSizeBytes
	DefaultS3UploadConcurrency       = 1
	DefaultS3MultipartAbortTimeout   = 30 * time.Second
	DefaultFilesystemMaxUsagePercent = 90
	DefaultMergeConcurrency          = 16
	DefaultOrphanedStorageGraceHours = 24
	DefaultCacheOlderThanDays        = 90
	MaximumCacheOlderThanDays        = 36500
	DefaultDownloadIdleTimeoutMS     = 300000
	MaximumDownloadIdleTimeoutMS     = math.MaxInt32

	DefaultDirectDownloadURLTTLSeconds = 600
	MaximumDirectDownloadURLTTLSeconds = 3600
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	TokenIssuer         string
	TokenJWKSURL        string
	TokenAudience       []string
	SkipTokenValidation bool
}

type CacheConfig

type CacheConfig struct {
	EnableDirectDownloads     bool
	DirectDownloadURLTTL      time.Duration
	DownloadURLSigningSecret  string
	MergeConcurrency          int
	MaxSizeBytes              int64
	MaxSizeBytesConfigured    bool
	FilesystemMaxUsagePercent float64
}

type CleanupConfig

type CleanupConfig struct {
	Disabled                   bool
	CacheOlderThanDays         int
	OrphanedStorageGracePeriod time.Duration
}

type Config

type Config struct {
	Server     ServerConfig
	Auth       AuthConfig
	DB         DBConfig
	Storage    StorageConfig
	Cache      CacheConfig
	Management ManagementConfig
	Cleanup    CleanupConfig
	Debug      bool
}

func Load

func Load() (Config, error)

type DBConfig

type DBConfig struct {
	Driver string

	SQLitePath string

	PostgresURL      string
	PostgresDatabase string
	PostgresHost     string
	PostgresPort     string
	PostgresUser     string
	PostgresPassword string
	PostgresSSLMode  string

	MySQLDatabase string
	MySQLHost     string
	MySQLPort     string
	MySQLUser     string
	MySQLPassword string
	MySQLTLS      string
}

type ManagementConfig

type ManagementConfig struct {
	APIKey string
}

type ServerConfig

type ServerConfig struct {
	Addr                     string
	APIBaseURL               string
	DefaultActionsResultsURL string
	DownloadIdleTimeout      time.Duration
}

type StorageConfig

type StorageConfig struct {
	Driver string

	FilesystemPath  string
	FilesystemFsync bool

	S3Bucket         string
	S3Region         string
	S3EndpointURL    string
	S3ForcePathStyle bool
	S3KeyPrefix      string

	S3UploadPartSizeBytes           int64
	S3UploadPartSizeBytesConfigured bool
	S3UploadConcurrency             int
	S3MultipartAbortTimeout         time.Duration
}

Jump to

Keyboard shortcuts

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