~sircmpwn/core-go

942e19c3517b353901048ce9ee1ddb61e4990aa4 — Simon Ser 4 months ago 864816c
s3: add Enabled
1 files changed, 7 insertions(+), 0 deletions(-)

M s3/middleware.go
M s3/middleware.go => s3/middleware.go +7 -0
@@ 69,3 69,10 @@ func URL(conf ini.File, bucket string) string {

	return proto + "://" + upstream
}

func Enabled(conf ini.File) bool {
	upstream, _ := conf.Get("objects", "s3-upstream")
	accessKey, _ := conf.Get("objects", "s3-access-key")
	secretKey, _ := conf.Get("objects", "s3-secret-key")
	return upstream != "" && accessKey != "" && secretKey != ""
}