s3staticsite/main.go

26 lines
544 B
Go
Raw Normal View History

2024-02-18 22:30:11 +00:00
package main
import (
"os"
minio "github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
"golang.org/x/exp/slog"
)
func main() {
minioClient, err := minio.New(config.S3Endpoint, &minio.Options{
Creds: credentials.NewStaticV4(config.AccessKeyID, config.SecretAccessKey, ""),
Secure: true,
})
if err != nil {
slog.Error("error connecting to s3 server", "error", err)
os.Exit(1)
}
if err := ListenAndServe(minioClient); err != nil {
slog.Error("error starting server", "error", err)
os.Exit(1)
}
}