packages

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Architecture added in v0.3.0

type Architecture string

type MPSCQueue added in v0.3.0

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

MPSCQueue provides an option set to manage a sync group of multiple producer workers and single consumer, leveraging Go sync.WaitGroup and channels to notify errors, results and completion of consuming the results from the single consumer worker.

func NewMPSCQueue added in v0.3.0

func NewMPSCQueue(parallelism int) *MPSCQueue

func (*MPSCQueue) Consume added in v0.3.0

func (q *MPSCQueue) Consume(msgHandler func(msg ...Package), errHandler func(err error))

Consume listens for both messages and errors on queues and do something with them, as specified by msgHandler and errHandler functions.

func (*MPSCQueue) ConsumerDoneCh added in v0.3.0

func (q *MPSCQueue) ConsumerDoneCh() chan bool

func (*MPSCQueue) ErrorCh added in v0.3.0

func (q *MPSCQueue) ErrorCh() chan error

func (*MPSCQueue) MessageCh added in v0.3.0

func (q *MPSCQueue) MessageCh() chan []Package

func (*MPSCQueue) ProducersWG added in v0.3.0

func (q *MPSCQueue) ProducersWG() *sync.WaitGroup

func (*MPSCQueue) SendError added in v0.3.0

func (q *MPSCQueue) SendError(err error)

SendError sends an error message of type error to the errors queue.

func (*MPSCQueue) SendMessage added in v0.3.0

func (q *MPSCQueue) SendMessage(msg ...Package)

SendMessage sends a message as variadic parameter msg of type packages.Package to the messages queue.

func (*MPSCQueue) SendMessageAndComplete added in v0.3.0

func (q *MPSCQueue) SendMessageAndComplete(msg ...Package)

SendMessageAndComplete sends a message as variadic parameter msg of type archive.Package to the messages queue, and eventually signals the completion of the current producer.

func (*MPSCQueue) SigConsumerCompletion added in v0.3.0

func (q *MPSCQueue) SigConsumerCompletion()

SigConsumerCompletion signals that the consumer completed its work.

func (*MPSCQueue) SigProducerCompletion added in v0.3.0

func (q *MPSCQueue) SigProducerCompletion()

SigProducerCompletion signals that a producer completed its work.

func (*MPSCQueue) WaitAndClose added in v0.3.0

func (q *MPSCQueue) WaitAndClose()

type Mirror

type Mirror struct {
	Name string
	// The base URL of the package mirror
	// (e.g. https://mirrors.kernel.org/<distribution>)
	URL string
}

type Package

type Package interface {
	GetName() string
	GetVersion() string
	GetRelease() string
	GetArch() string
	GetLocation() string
	URL() string
	FileReaders() []io.Reader
}

type Repository

type Repository struct {
	Name string
	URI  URITemplate
}

type SearchOptions added in v0.3.0

type SearchOptions struct {
	*output.ProgressOptions

	*MPSCQueue
	// contains filtered or unexported fields
}

func NewSearchOptions added in v0.3.0

func NewSearchOptions(packageName string, architectures []Architecture, seedURLs []string, verbosity output.Verbosity, progressMessage string, packageFileNames ...string) *SearchOptions

func (*SearchOptions) Architectures added in v0.3.0

func (o *SearchOptions) Architectures() []Architecture

func (*SearchOptions) Log added in v0.3.0

func (o *SearchOptions) Log() *output.Logger

func (*SearchOptions) PackageFileNames added in v0.3.0

func (o *SearchOptions) PackageFileNames() []string

func (*SearchOptions) PackageName added in v0.3.0

func (o *SearchOptions) PackageName() string

func (*SearchOptions) ProgressMessage added in v0.3.0

func (o *SearchOptions) ProgressMessage() string

func (*SearchOptions) SeedURLs added in v0.3.0

func (o *SearchOptions) SeedURLs() []string

func (*SearchOptions) Verbosity added in v0.3.0

func (o *SearchOptions) Verbosity() output.Verbosity

type URITemplate

type URITemplate string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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