tool

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Vendor    []*VendorConfig    `yaml:"vendor"`
	Transform []*TransformConfig `yaml:"transform"`
}

Config represents the tool config

type ProgressTracker

type ProgressTracker struct {
	// contains filtered or unexported fields
}

ProgressTracker wraps a github.com/cheggaaa/pb.Pool in order to display download progress for one or multiple downloads.

func NewProgressTracker

func NewProgressTracker() *ProgressTracker

NewProgressTracker creates new tracker

func (*ProgressTracker) Add

func (t *ProgressTracker) Add(delta int)

Add adds delta

func (*ProgressTracker) TrackProgress

func (t *ProgressTracker) TrackProgress(name string, current, total 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.

func (*ProgressTracker) Wait

func (t *ProgressTracker) Wait()

Wait waits all bars

type RuleConfig

type RuleConfig struct {
	Regexp string `yaml:"regexp"`
	Value  string `yaml:"value"`
}

RuleConfig represents an experesion

type Transform

type Transform struct {
	// contains filtered or unexported fields
}

Transform represents the tool transform command

func NewTransform

func NewTransform(cfg *Config) *Transform

NewTransform creates a new transform

func (*Transform) Run

func (p *Transform) Run(_ *cli.Context) error

Run runs the vendor command

type TransformConfig

type TransformConfig struct {
	Name  string        `yaml:"name"`
	Rules []*RuleConfig `yaml:"rules"`
}

TransformConfig represents the update config

type Vendor

type Vendor struct {
	// contains filtered or unexported fields
}

Vendor represents the tool vendor command

func NewVendor

func NewVendor(cfg *Config) *Vendor

NewVendor creates a new vendor

func (*Vendor) Run

func (p *Vendor) Run(_ *cli.Context) error

Run runs the vendor command

type VendorConfig

type VendorConfig struct {
	Name   string   `yaml:"name"`
	Source []string `yaml:"source"`
}

VendorConfig represents the vendor config

Jump to

Keyboard shortcuts

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