bufcore

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package bufcore contains core types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfo

type FileInfo interface {
	// Path is the path of the file relative to the root it is contained within.
	// This will be normalized, validated and never empty,
	// This will be unique within a given Image.
	Path() string

	//   Path: one/one.proto
	//   RootDirPath: proto
	//   ExternalPath: /foo/bar/proto/one/one.proto
	ExternalPath() string
	// IsImport returns true if this file is an import.
	IsImport() bool

	// WithIsImport returns this FileInfo with the given IsImport value.
	WithIsImport(isImport bool) FileInfo
	// contains filtered or unexported methods
}

FileInfo contains protobuf file info.

func NewFileInfo

func NewFileInfo(path string, externalPath string, isImport bool) (FileInfo, error)

NewFileInfo returns a new FileInfo.

If externalPath is empty, path is used.

func NewFileInfoForObjectInfo

func NewFileInfoForObjectInfo(objectInfo storage.ObjectInfo, isImport bool) FileInfo

NewFileInfoForObjectInfo returns a new FileInfo for the storage.ObjectInfo.

The same rules apply to ObjectInfos for paths as FileInfos so we do not need to validate.

Jump to

Keyboard shortcuts

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