本文整理匯總了Golang中github.com/hashicorp/terraform/plugin.Serve函數的典型用法代碼示例。如果您正苦於以下問題:Golang Serve函數的具體用法?Golang Serve怎麽用?Golang Serve使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Serve函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: main
func main() {
plugin.Serve(&plugin.ServeOpts{
ProvisionerFunc: func() terraform.ResourceProvisioner {
return new(chef.ResourceProvisioner)
},
})
}
示例2: main
func main() {
serveOpts := &plugin.ServeOpts{
ProvisionerFunc: ResourceProvisionerBuilder,
}
plugin.Serve(serveOpts)
}
示例3: main
func main() {
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: func() terraform.ResourceProvider {
return Provider()
},
})
}
示例4: main
func main() {
// return details on provider plugin
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: func() terraform.ResourceProvider {
return &schema.Provider{
// rage4 api only needs email login & api key
Schema: map[string]*schema.Schema{
"email": &schema.Schema{
Type: schema.TypeString,
Required: true,
DefaultFunc: envDefaultFunc("RAGE4_EMAIL"),
Description: "email address associated with Rage4 account",
},
"api_key": &schema.Schema{
Type: schema.TypeString,
Required: true,
DefaultFunc: envDefaultFunc("RAGE4_API_AKEY"),
Description: "Rage4 API Key",
},
},
ResourcesMap: map[string]*schema.Resource{
"rage4_record": resourceRage4Record(),
},
ConfigureFunc: providerConfigure,
}
},
})
}
示例5: Run
func (c *InternalPluginCommand) Run(args []string) int {
if len(args) != 2 {
log.Printf("Wrong number of args; expected: terraform internal-plugin pluginType pluginName")
return 1
}
pluginType := args[0]
pluginName := args[1]
log.SetPrefix(fmt.Sprintf("%s-%s (internal) ", pluginName, pluginType))
switch pluginType {
case "provider":
pluginFunc, found := InternalProviders[pluginName]
if !found {
log.Printf("[ERROR] Could not load provider: %s", pluginName)
return 1
}
log.Printf("[INFO] Starting provider plugin %s", pluginName)
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: pluginFunc,
})
case "provisioner":
pluginFunc, found := InternalProvisioners[pluginName]
if !found {
log.Printf("[ERROR] Could not load provisioner: %s", pluginName)
return 1
}
log.Printf("[INFO] Starting provisioner plugin %s", pluginName)
plugin.Serve(&plugin.ServeOpts{
ProvisionerFunc: pluginFunc,
})
default:
log.Printf("[ERROR] Invalid plugin type %s", pluginType)
return 1
}
return 0
}
示例6: main
func main() {
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: nsot.Provider,
})
}
示例7: main
func main() {
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: chronos.Provider,
})
}
示例8: main
func main() {
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: mesoskafka.Provider,
})
}
示例9: main
func main() {
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: librato.Provider,
})
}
示例10: main
func main() {
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: cloudflare.Provider,
})
}
示例11: main
func main() {
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: bigip.Provider,
})
}
示例12: main
func main() {
plugin.Serve(new(file.ResourceProvisioner))
}
示例13: main
func main() {
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: pagerduty.Provider,
})
}
示例14: main
func main() {
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: pingdom.Provider,
})
}
示例15: main
func main() {
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: beanstalk.Provider,
})
}