plugin
v1.0.8
github.com/pangum/grpc/internal/plugin
Documentation
pkg.go.dev ↗Types
Config
type Config struct {
// 服务器端配置
Server *config.Server `json:"server" yaml:"server" xml:"server" toml:"server"`
// 网关配置
Gateway *config.Gateway `json:"gateway" yaml:"gateway" xml:"gateway" toml:"gateway"`
// 客户端配置
Clients []config.Client `json:"clients" yaml:"clients" toml:"clients" xml:"clients"`
// gRPC配置
Options config.Options `json:"options" yaml:"options" xml:"options" toml:"options"`
}
Constructor
type Constructor struct {
}
Constructor.New
func (c *Constructor) New(config *pangu.Config, logger log.Logger) (server *core.Server, mux *http.ServeMux, err error)
Constructor.NewClient
func (c *Constructor) NewClient(config *pangu.Config) (client *core.Client, err error)
Constructor.NewGateway
func (c *Constructor) NewGateway(logger log.Logger) *core.Gateway
Wrapper
type Wrapper struct {
// gRPC配置
Grpc *Config `json:"grpc" yaml:"grpc" xml:"grpc" toml:"grpc" validate:"required"`
}