protomanager

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: Apache-2.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
	ProtoDir         string
	Synchronization  *synchronization.Config
}

Config defines the config structure

func NewConfig

func NewConfig() *Config

NewConfig is used to init config with default values

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

Validate is used to validate config and returns error on failure

type Manager

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

Manager is the implement of Provider

func New

func New(cfg *Config, logger logger.Logger, registerer prometheus.Registerer) (*Manager, error)

New is used to init service

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 added in v0.2.0

func (s *Manager) Start(ctx context.Context, cancelFunc context.CancelFunc) error

type Provider

type Provider interface {
	Start(ctx context.Context, cancelFunc context.CancelFunc) error
	// GetMethod is used to get descriptor of specified grpc path
	GetMethod(name string) (*desc.MethodDescriptor, bool)
}

Provider is used to read, parse and manage Proto files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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