main.go (1452B)
1 // Copyright (c) HashiCorp, Inc. 2 // SPDX-License-Identifier: MPL-2.0 3 4 package main 5 6 import ( 7 "context" 8 "flag" 9 "log" 10 11 "github.com/MTRNord/terraform-provider-matrix/internal/provider" 12 "github.com/hashicorp/terraform-plugin-framework/providerserver" 13 ) 14 15 // Run "go generate" to format example terraform files and generate the docs for the registry/website 16 17 // If you do not have terraform installed, you can remove the formatting command, but its suggested to 18 // ensure the documentation is formatted properly. 19 //go:generate terraform fmt -recursive ./examples/ 20 21 // Run the docs generation tool, check its repository for more information on how it works and how docs 22 // can be customized. 23 //go:generate go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs 24 25 var ( 26 // these will be set by the goreleaser configuration 27 // to appropriate values for the compiled binary. 28 version string = "dev" 29 30 // goreleaser can pass other information to the main package, such as the specific commit 31 // https://goreleaser.com/cookbooks/using-main.version/ 32 ) 33 34 func main() { 35 var debug bool 36 37 flag.BoolVar(&debug, "debug", false, "set to true to run the provider with support for debuggers like delve") 38 flag.Parse() 39 40 opts := providerserver.ServeOpts{ 41 Address: "registry.terraform.io/MTRNord/matrix", 42 Debug: debug, 43 } 44 45 err := providerserver.Serve(context.Background(), provider.New(version), opts) 46 47 if err != nil { 48 log.Fatal(err.Error()) 49 } 50 }