Documentation ¶
Index ¶
- Constants
- Variables
- func ProgressBarConfig(bar *pb.ProgressBar, prefix string)
- type Compiler
- type ModulePath
- type ModuleService
- func (m *ModuleService) Add(t *starlark.Thread, fn *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func (m *ModuleService) Download(ctx context.Context, r *module.RemoteRepo) error
- func (m *ModuleService) DownloadDeps(ctx context.Context, r *module.RemoteRepo) error
- func (m *ModuleService) GenFileDescriptorSet(registry *utils.DescriptorRegistry, r *module.RemoteRepo) error
- func (m *ModuleService) GetProtoFilesRegistry() *protoregistry.Files
- func (m *ModuleService) GetProtoRegistry() *utils.DescriptorRegistry
- func (m *ModuleService) Init(ctx context.Context, initFiles ...string) error
- func (m *ModuleService) LoadFromLockFile() error
- func (m *ModuleService) Lock() error
- func (m *ModuleService) MergeLock() error
- func (m *ModuleService) Sync(ctx context.Context) error
- func (m *ModuleService) Validate(r *module.RemoteRepo) (string, error)
- func (m *ModuleService) Walk(walkFn WalkFunction) error
- type ProgressBar
- type WalkFunction
Constants ¶
const ( ConfigRollout = "ConfigRollout" RolloutStage = "RolloutStage" )
Variables ¶
var ( ErrBadConfigExtension = errors.New("bad config extension") ErrNotADictionary = errors.New("`main' returned something that's not a dict") ErrNotStringKey = errors.New("`main' returned a dict with non-string key") ErrNoProtobufValue = errors.New("`main' returned a dict with non-protobuf value") )
var ( ErrStarlarkEval = errors.New("error evaluating starlark file") ErrLoadStarlark = errors.New("error loading starlark file") )
var ( ErrMainNotCallable = errors.New("`main` must be a function") ErrMainNotFound = errors.New("`main` function not found") )
var ( ErrLoadMutable = errors.New("error opening mutable config file") ErrReadMutable = errors.New("error reading from mutable config file") )
var (
ErrInvalidConfig = errors.New("config is not valid")
)
var ErrorRemoteRepoNoIntegrityInfo = errors.New("missing integrity data")
var ErrorRemoteRepoNotDownloaded = errors.New("remote repo not in local cache")
var ErrorRemoteRepoValidationFailed = errors.New("failed to validate integrity")
Functions ¶
func ProgressBarConfig ¶
func ProgressBarConfig(bar *pb.ProgressBar, prefix string)
Types ¶
type Compiler ¶
type Compiler struct { MaterializedDir string ModuleService *ModuleService // contains filtered or unexported fields }
func NewCompiler ¶
func (*Compiler) CompileFile ¶
func (*Compiler) CompileFileAsync ¶
func (c *Compiler) CompileFileAsync(ctx context.Context, cancel context.CancelCauseFunc, filename string) (chan *protoconf_pb.CompileResponse, chan error)
type ModulePath ¶
func ParseModulePath ¶
func ParseModulePath(moduleName string) *ModulePath
func (*ModulePath) String ¶
func (m *ModulePath) String() string
type ModuleService ¶
type ModuleService struct { Config *module.ModuleServiceConfig // contains filtered or unexported fields }
func NewModuleService ¶
func NewModuleService(protoconfRoot string) *ModuleService
func (*ModuleService) Download ¶
func (m *ModuleService) Download(ctx context.Context, r *module.RemoteRepo) error
func (*ModuleService) DownloadDeps ¶
func (m *ModuleService) DownloadDeps(ctx context.Context, r *module.RemoteRepo) error
DownloadDeps downloads the dependencies of a remote repository. It recursively downloads all the dependencies and their dependencies. If a module lock file exists for a dependency, it merges the lock file with the remote repository. If the lock file does not exist, it skips the dependency. The method returns an error if any error occurs during the download process.
func (*ModuleService) GenFileDescriptorSet ¶
func (m *ModuleService) GenFileDescriptorSet(registry *utils.DescriptorRegistry, r *module.RemoteRepo) error
func (*ModuleService) GetProtoFilesRegistry ¶
func (m *ModuleService) GetProtoFilesRegistry() *protoregistry.Files
func (*ModuleService) GetProtoRegistry ¶
func (m *ModuleService) GetProtoRegistry() *utils.DescriptorRegistry
func (*ModuleService) Init ¶
func (m *ModuleService) Init(ctx context.Context, initFiles ...string) error
func (*ModuleService) LoadFromLockFile ¶
func (m *ModuleService) LoadFromLockFile() error
func (*ModuleService) Lock ¶
func (m *ModuleService) Lock() error
func (*ModuleService) MergeLock ¶
func (m *ModuleService) MergeLock() error
func (*ModuleService) Sync ¶
func (m *ModuleService) Sync(ctx context.Context) error
Sync synchronizes the modules by downloading dependencies and generating file descriptor sets. It walks through each remote repository, downloads the repository if necessary, and updates the integrity of matching repositories. Then, it downloads the dependencies and generates file descriptor sets for each repository. Finally, it returns any error encountered during the process.
func (*ModuleService) Validate ¶
func (m *ModuleService) Validate(r *module.RemoteRepo) (string, error)
func (*ModuleService) Walk ¶
func (m *ModuleService) Walk(walkFn WalkFunction) error
type ProgressBar ¶
type ProgressBar struct {
// contains filtered or unexported fields
}
ProgressBar wraps a github.com/cheggaaa/pb.Pool in order to display download progress for one or multiple downloads.
If two different instance of ProgressBar try to display a progress only one will be displayed. It is therefore recommended to use DefaultProgressBar
func (*ProgressBar) TrackProgress ¶
func (cpb *ProgressBar) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) io.ReadCloser
TrackProgress instantiates a new progress bar that will display the progress of stream until closed. total can be 0.
type WalkFunction ¶
type WalkFunction func(r *module.RemoteRepo) error