parser

package
v5.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package parser provides functionality to parse protobuf files and extract gRPC service definitions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Method

type Method struct {
	// Name is a method name.
	Name string

	// StreamsRequest defines if the method accepts stream input.
	StreamsRequest bool

	// RequestType defines the message name (from the same package) of method input.
	RequestType string

	// StreamsReturns defines if method streams result.
	StreamsReturns bool

	// ReturnsType defines the message name (from the same package) of the method return value.
	ReturnsType string
}

Method describes a singular RPC method.

type Service

type Service struct {
	// Package defines service namespace.
	Package string

	// Name defines service name.
	Name string

	// Methods list.
	Methods []Method
}

Service contains information about singular GRPC service.

func Bytes

func Bytes(data []byte) ([]Service, error)

Bytes parses string into proto definition.

func File

func File(file string, importPath string) ([]Service, error)

File parses given proto file or returns error.

Jump to

Keyboard shortcuts

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