forked from RedisLabs/terraform-provider-rediscloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
34 lines (25 loc) · 739 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package main
import (
"flag"
"log"
"github.com/RedisLabs/terraform-provider-rediscloud/provider"
"github.com/hashicorp/terraform-plugin-sdk/v2/plugin"
)
var (
// Provided by goreleaser configuration for each binary
// Allows goreleaser to pass version details
version = "dev"
)
func main() {
var debugMode bool
flag.BoolVar(&debugMode, "debug", false, "set to true to run the provider with support for debuggers like delve")
flag.Parse()
opts := &plugin.ServeOpts{ProviderFunc: provider.New(version)}
// Prevent logger from prepending date/time to logs, which breaks log-level parsing/filtering
log.SetFlags(0)
if debugMode {
opts.Debug = true
opts.ProviderAddr = "RedisLabs/rediscloud"
}
plugin.Serve(opts)
}