-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
33 lines (28 loc) · 736 Bytes
/
main.go
File metadata and controls
33 lines (28 loc) · 736 Bytes
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
package main
import (
"github.com/JINWOO-J/vault-plugin-icon/backend"
"github.com/hashicorp/vault/api"
"github.com/hashicorp/vault/sdk/plugin"
"log"
"os"
)
var (
buildDate = ""
buildVersion = ""
)
func main() {
log.Println("buildDate:", buildDate, ", buildVersion:", buildVersion)
apiClientMeta := &api.PluginAPIClientMeta{}
flags := apiClientMeta.FlagSet()
flags.Parse(os.Args[1:]) // Ignore command, strictly parse flags
tlsConfig := apiClientMeta.GetTLSConfig()
tlsProviderFunc := api.VaultPluginTLSProvider(tlsConfig)
err := plugin.Serve(&plugin.ServeOpts{
BackendFactoryFunc: backend.Factory,
TLSProviderFunc: tlsProviderFunc,
})
if err != nil {
log.Println("=== ERROR ===", err)
os.Exit(1)
}
}