trpc.group/trpc-go/trpc-cmdline@v1.0.9/plugin/plugins.go (about)

     1  // Tencent is pleased to support the open source community by making tRPC available.
     2  //
     3  // Copyright (C) 2023 THL A29 Limited, a Tencent company.
     4  // All rights reserved.
     5  //
     6  // If you have downloaded a copy of the tRPC source code from Tencent,
     7  // please note that tRPC source code is licensed under the  Apache 2.0 License,
     8  // A copy of the Apache 2.0 License is included in this file.
     9  
    10  //go:build !experimental
    11  // +build !experimental
    12  
    13  package plugin
    14  
    15  import "trpc.group/trpc-go/trpc-cmdline/plugin/sync"
    16  
    17  // Plugins is the chain of public plugins.
    18  var Plugins = []Plugin{
    19  	&Swagger{},  // swagger apidoc
    20  	&OpenAPI{},  // openapi apidoc
    21  	&Validate{}, // protoc-gen-secv
    22  	sync.NewGit(sync.DefaultFileManager, sync.DefaultGitManager,
    23  		sync.AuthSupplier), // sync stub to git repository
    24  }
    25  
    26  // PluginsExt is the language-specific plugin chain.
    27  var PluginsExt = map[string][]Plugin{
    28  	"go": {
    29  		&GoImports{}, // goimports,  runs before mockgen, to eliminate `package import but unused` errors
    30  		&Formatter{}, // gofmt
    31  		&GoMock{},    // gomock
    32  		&GoTag{},     // custom go tag by proto field options
    33  	},
    34  	"cpp": {
    35  		&CppMove{}, // Move the PB files to proto directory.
    36  	},
    37  }