protomanager

package
v0.0.0-...-e9f0680 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2022 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPathByFullyQualifiedName

func GetPathByFullyQualifiedName(name string) string

GetPathByFullyQualifiedName is used to get the grpc path of specified fully qualified name

Types

type Config

type Config struct {
	ProtoImportPaths []string
	SyncGitManger    *synchronization.Config `yaml:"sync"`
}

Config defines the config structure

func NewConfig

func NewConfig() *Config

func (*Config) RegisterFlagsWithPrefix

func (c *Config) RegisterFlagsWithPrefix(prefix string, f *pflag.FlagSet)

RegisterFlagsWithPrefix is used to register flags

func (*Config) Validate

func (c *Config) Validate() error

type Manager

type Manager struct {
	logger.Logger
	// contains filtered or unexported fields
}

Manager is the implement of Provider

func (*Manager) GetImportPaths

func (m *Manager) GetImportPaths() []string

GetImportPaths implements Provider

func (*Manager) GetMethod

func (s *Manager) GetMethod(name string) (*desc.MethodDescriptor, bool)

GetMethod is used to get descriptor of specified grpc path

func (*Manager) Start

func (s *Manager) Start(ctx *mbcontext.Context) error

type Provider

type Provider interface {
	Start(ctx *mbcontext.Context) error
	// GetMethod is used to get descriptor of specified grpc path
	GetMethod(name string) (*desc.MethodDescriptor, bool)
	// get proto importPaths
	GetImportPaths() []string
}

Provider is used to read, parse and manage Proto files

func New

func New(log logger.Logger, cfg *Config) (Provider, error)

New is used to init service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL