caet

package module
v0.0.0-...-5543972 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

README

Cat Fetcher

Installing

go install github.com/MarkMandriota/caet

Usage

Get help:

caet -h

Common example:

caet

By default, will be installed 9 cats to ./cats.

Flags:

  -N int
        number of workers (default 4)
  -d string
        cats destination directory (default "cats")
  -n int
        number of cats to fetch (default 9)

Example:

echo "https://api.thecatapi.com/v1/images/search" | caet -d cat_pics -n 96 -N 8

TODO

  • Add header key value pairs support

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CatFile

type CatFile struct {
	Body []byte
	Kind []byte
}

func NewCatFile

func NewCatFile(body []byte, kind []byte) *CatFile

type Fetcher

type Fetcher struct {
	SR SingularReferer
	// contains filtered or unexported fields
}

func NewFetcher

func NewFetcher() *Fetcher

func (*Fetcher) FetchNewer

func (f *Fetcher) FetchNewer() (body []byte, kind []byte)

func (*Fetcher) Run

func (f *Fetcher) Run(ctx context.Context, cats chan<- *CatFile)

type SingularReferer

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

func (*SingularReferer) Load

func (r *SingularReferer) Load(cfg io.Reader) error

func (*SingularReferer) Next

func (r *SingularReferer) Next() (ref string)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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