// +build ignore package docs_demo // package registry import ( "github.com/solo-io/gloo/projects/gloo/pkg/bootstrap" "github.com/solo-io/gloo/projects/gloo/pkg/plugins" "github.com/solo-io/gloo/projects/gloo/pkg/plugins/aws" "github.com/solo-io/gloo/projects/gloo/pkg/plugins/azure" "github.com/solo-io/gloo/projects/gloo/pkg/plugins/basicroute" "github.com/solo-io/gloo/projects/gloo/pkg/plugins/consul" "github.com/solo-io/gloo/projects/gloo/pkg/plugins/cors" "github.com/solo-io/gloo/projects/gloo/pkg/plugins/faultinjection" // add our plugin's import here: "github.com/solo-io/gloo/projects/gloo/pkg/plugins/gce" "github.com/solo-io/gloo/projects/gloo/pkg/plugins/grpc" "github.com/solo-io/gloo/projects/gloo/pkg/plugins/hcm" "github.com/solo-io/gloo/projects/gloo/pkg/plugins/kubernetes" "github.com/solo-io/gloo/projects/gloo/pkg/plugins/linkerd" "github.com/solo-io/gloo/projects/gloo/pkg/plugins/loadbalancer" "github.com/solo-io/gloo/projects/gloo/pkg/plugins/rest" "github.com/solo-io/gloo/projects/gloo/pkg/plugins/static" "github.com/solo-io/gloo/projects/gloo/pkg/plugins/stats" "github.com/solo-io/gloo/projects/gloo/pkg/plugins/transformation" "github.com/solo-io/gloo/projects/gloo/pkg/plugins/upstreamconn" "github.com/solo-io/gloo/projects/gloo/pkg/plugins/upstreamssl" ) type registry struct { plugins []plugins.Plugin } var globalRegistry = func(opts bootstrap.Opts) *registry { transformationPlugin := transformation.NewPlugin() reg := ®istry{} // plugins should be added here reg.plugins = append(reg.plugins, loadbalancer.NewPlugin(), upstreamconn.NewPlugin(), upstreamssl.NewPlugin(), azure.NewPlugin(&transformationPlugin.RequireTransformationFilter), aws.NewPlugin(&transformationPlugin.RequireTransformationFilter, &transformationPlugin.RequireEarlyTransformation), rest.NewPlugin(&transformationPlugin.RequireTransformationFilter), hcm.NewPlugin(), static.NewPlugin(), transformationPlugin, consul.NewPlugin(), grpc.NewPlugin(&transformationPlugin.RequireTransformationFilter), faultinjection.NewPlugin(), basicroute.NewPlugin(), cors.NewPlugin(), linkerd.NewPlugin(), stats.NewPlugin(), // and our plugin goes here gce.NewPlugin(), ) if opts.KubeClient != nil { reg.plugins = append(reg.plugins, kubernetes.NewPlugin(opts.KubeClient)) } for _, pluginExtension := range pluginExtensions { reg.plugins = append(reg.plugins, pluginExtension()) } return reg } func Plugins(opts bootstrap.Opts, pluginExtensions ...plugins.Plugin) []plugins.Plugin { return globalRegistry(opts, pluginExtensions...).plugins }