Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FmtModVer ¶
FmtModVer is a helper function that can take pkg/a/b and v2.3.1 and returns pkg/a/b@v2.3.1
func PackageVersionedName ¶
PackageVersionedName return package full name used in storage. E.g athens/@v/v1.0/go.mod
Types ¶
type AzureConfig ¶ added in v0.2.0
type AzureConfig struct {
TimeoutConf
AccountName string `validate:"required" envconfig:"ATHENS_AZURE_ACCOUNT_NAME"`
AccountKey string `validate:"required" envconfig:"ATHENS_AZURE_ACCOUNT_KEY"`
ContainerName string `validate:"required" envconfig:"ATHENS_AZURE_CONTAINER_NAME"`
}
AzureConfig specifies the properties required to use Azure as the storage backend
type Config ¶ added in v0.2.0
type Config struct {
TimeoutConf
GoEnv string `validate:"required" envconfig:"GO_ENV"`
GoBinary string `validate:"required" envconfig:"GO_BINARY_PATH"`
GoGetWorkers int `validate:"required" envconfig:"ATHENS_GOGET_WORKERS"`
ProtocolWorkers int `validate:"required" envconfig:"ATHENS_PROTOCOL_WORKERS"`
LogLevel string `validate:"required" envconfig:"ATHENS_LOG_LEVEL"`
BuffaloLogLevel string `validate:"required" envconfig:"BUFFALO_LOG_LEVEL"`
CloudRuntime string `validate:"required" envconfig:"ATHENS_CLOUD_RUNTIME"`
FilterFile string `envconfig:"ATHENS_FILTER_FILE"`
TraceExporterURL string `envconfig:"ATHENS_TRACE_EXPORTER_URL"`
TraceExporter string `envconfig:"ATHENS_TRACE_EXPORTER"`
StorageType string `validate:"required" envconfig:"ATHENS_STORAGE_TYPE"`
GlobalEndpoint string `envconfig:"ATHENS_GLOBAL_ENDPOINT"` // This feature is not yet implemented
Port string `envconfig:"ATHENS_PORT" default:":3000"`
BasicAuthUser string `envconfig:"BASIC_AUTH_USER"`
BasicAuthPass string `envconfig:"BASIC_AUTH_PASS"`
ForceSSL bool `envconfig:"PROXY_FORCE_SSL"`
ValidatorHook string `envconfig:"ATHENS_PROXY_VALIDATOR"`
PathPrefix string `envconfig:"ATHENS_PATH_PREFIX"`
NETRCPath string `envconfig:"ATHENS_NETRC_PATH"`
GithubToken string `envconfig:"ATHENS_GITHUB_TOKEN"`
HGRCPath string `envconfig:"ATHENS_HGRC_PATH"`
Storage *StorageConfig
}
Config provides configuration values for all components
func GetConf ¶ added in v0.2.0
GetConf accepts the path to a file, constructs an absolute path to the file, and attempts to parse it into a Config struct.
func ParseConfigFile ¶ added in v0.2.0
ParseConfigFile parses the given file into an athens config struct
type DiskConfig ¶ added in v0.2.0
type DiskConfig struct {
RootPath string `validate:"required" envconfig:"ATHENS_DISK_STORAGE_ROOT"`
}
DiskConfig specifies the properties required to use Disk as the storage backend
type GCPConfig ¶ added in v0.2.0
type GCPConfig struct {
TimeoutConf
ProjectID string `envconfig:"GOOGLE_CLOUD_PROJECT"`
Bucket string `validate:"required" envconfig:"ATHENS_STORAGE_GCP_BUCKET"`
}
GCPConfig specifies the properties required to use GCP as the storage backend
type MinioConfig ¶ added in v0.2.0
type MinioConfig struct {
TimeoutConf
Endpoint string `validate:"required" envconfig:"ATHENS_MINIO_ENDPOINT"`
Key string `validate:"required" envconfig:"ATHENS_MINIO_ACCESS_KEY_ID"`
Secret string `validate:"required" envconfig:"ATHENS_MINIO_SECRET_ACCESS_KEY"`
Bucket string `validate:"required" envconfig:"ATHENS_MINIO_BUCKET_NAME"`
Region string `envconfig:"ATHENS_MINIO_REGION"`
EnableSSL bool `envconfig:"ATHENS_MINIO_USE_SSL"`
}
MinioConfig specifies the properties required to use Minio or DigitalOcean Spaces as the storage backend
type MongoConfig ¶ added in v0.2.0
type MongoConfig struct {
TimeoutConf
URL string `validate:"required" envconfig:"ATHENS_MONGO_STORAGE_URL"`
CertPath string `envconfig:"ATHENS_MONGO_CERT_PATH"`
InsecureConn bool `envconfig:"ATHENS_MONGO_INSECURE"`
}
MongoConfig specifies the properties required to use MongoDB as the storage backend
type S3Config ¶ added in v0.2.0
type S3Config struct {
TimeoutConf
Region string `validate:"required" envconfig:"AWS_REGION"`
Key string `validate:"required" envconfig:"AWS_ACCESS_KEY_ID"`
Secret string `validate:"required" envconfig:"AWS_SECRET_ACCESS_KEY"`
Token string `envconfig:"AWS_SESSION_TOKEN"`
Bucket string `validate:"required" envconfig:"ATHENS_S3_BUCKET_NAME"`
}
S3Config specifies the properties required to use S3 as the storage backend
type StorageConfig ¶ added in v0.2.0
type StorageConfig struct {
Disk *DiskConfig
GCP *GCPConfig
Minio *MinioConfig
Mongo *MongoConfig
S3 *S3Config
Azure *AzureConfig
}
StorageConfig provides configs for various storage backends
type TimeoutConf ¶ added in v0.2.0
type TimeoutConf struct {
Timeout int `validate:"required"`
}
TimeoutConf is a common struct for anything with a timeout
func (*TimeoutConf) TimeoutDuration ¶ added in v0.2.0
func (t *TimeoutConf) TimeoutDuration() time.Duration
TimeoutDuration returns the timeout as time.duration