protobuild

package
v0.0.0-...-0f19e00 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCircularDependencyError

func NewCircularDependencyError(chain []string, dep string) error

func NewSourceResolver

func NewSourceResolver(localFiles LocalFileSource) (*sourceResolver, error)

Types

type BuiltPackage

type BuiltPackage struct {
	Name         string
	Proto        []*psrc.File
	Prose        []*source_j5pb.ProseFile
	Dependencies []*BuiltPackage
}

type CircularDependencyError

type CircularDependencyError struct {
	Chain []string
	Dep   string
}

func (*CircularDependencyError) Error

func (e *CircularDependencyError) Error() string

type LocalFileSource

type LocalFileSource interface {
	GetLocalFile(context.Context, string) ([]byte, error)
	ProseFiles(pkgName string) ([]*source_j5pb.ProseFile, error)
	ListPackages() []string
	ListSourceFiles(ctx context.Context, pkgName string) ([]string, error)
}

type LocalSourceResolver

type LocalSourceResolver interface {
	ListPackages() []string
	PackageForFile(filename string) (string, bool, error)
	IsLocalPackage(name string) bool
	PackageSourceFiles(ctx context.Context, pkgName string) ([]*SourceFile, error)
	PackageProseFiles(pkgName string) ([]*source_j5pb.ProseFile, error)
}

type Package

type Package struct {
	Name        string
	SourceFiles []*SourceFile

	Files              map[string]*psrc.File
	DirectDependencies map[string]*Package
	Exports            map[string]*j5convert.TypeRef

	Built *BuiltPackage
	// contains filtered or unexported fields
}

func (*Package) ResolveType

func (pkg *Package) ResolveType(pkgName string, name string) (*j5convert.TypeRef, error)

ResolveType implements j5convert.TypeResolver interface.

type PackageSet

type PackageSet struct {
	Packages map[string]*Package
	// contains filtered or unexported fields
}

func NewPackageSet

func NewPackageSet(deps psrc.Resolver, sourceResolver LocalSourceResolver) (*PackageSet, error)

func (*PackageSet) BuildPackages

func (ps *PackageSet) BuildPackages(ctx context.Context, pkgNames []string) ([]*BuiltPackage, error)

func (*PackageSet) CompilePackage

func (ps *PackageSet) CompilePackage(ctx context.Context, packageName string) (*BuiltPackage, error)

func (*PackageSet) FindFileByPath

func (ps *PackageSet) FindFileByPath(filename string) (*psrc.File, error)

func (*PackageSet) LintFile

func (ps *PackageSet) LintFile(ctx context.Context, filename string, parsed *sourcedef_j5pb.SourceFile) (errpos.Errors, error)

func (*PackageSet) ListLocalPackages

func (ps *PackageSet) ListLocalPackages() []string

func (*PackageSet) ListPackageFiles

func (ps *PackageSet) ListPackageFiles(pkgName string) ([]string, error)

func (*PackageSet) PackageForLocalFile

func (ps *PackageSet) PackageForLocalFile(filename string) (string, bool, error)

type SourceFile

type SourceFile struct {
	Summary *j5convert.FileSummary

	Warnings []*errpos.Err

	// Oneof:
	J5File    *sourcedef_j5pb.SourceFile
	ProtoFile *parser.Result
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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