mirror of
https://github.com/go-gst/go-gst.git
synced 2025-10-05 07:56:51 +08:00
minio/s3 sink plugin
This commit is contained in:
36
examples/plugins/minio/common.go
Normal file
36
examples/plugins/minio/common.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
const (
|
||||
accessKeyIDEnvVar = "MINIO_ACCESS_KEY_ID"
|
||||
secretAccessKeyEnvVar = "MINIO_SECRET_ACCESS_KEY"
|
||||
)
|
||||
|
||||
var (
|
||||
defaultEndpoint = "play.min.io"
|
||||
defaultUseTLS = true
|
||||
defaultRegion = "us-east-1"
|
||||
)
|
||||
|
||||
type settings struct {
|
||||
endpoint string
|
||||
useTLS bool
|
||||
region string
|
||||
bucket string
|
||||
key string
|
||||
accessKeyID string
|
||||
secretAccessKey string
|
||||
}
|
||||
|
||||
func defaultSettings() *settings {
|
||||
return &settings{
|
||||
endpoint: defaultEndpoint,
|
||||
useTLS: defaultUseTLS,
|
||||
region: defaultRegion,
|
||||
accessKeyID: os.Getenv(accessKeyIDEnvVar),
|
||||
secretAccessKey: os.Getenv(secretAccessKeyEnvVar),
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user