deepclone

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

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

Go to latest
Published: Sep 6, 2020 License: MIT Imports: 17 Imported by: 0

README

Deepclone

test build release

DevNote here

Run

  • Download from Releases or build yourself
./deepclone --depth 2 https://www.apple.com/jp/

Build

go get github.com/sarisia/deepclone/cmd/deepclone

Options

Option Required Default Usage
depth 1 Set fetch depth
conn 16 Set max concurrent connections
dir "content" Set directory to save contents
debug false Enable pprof debug endpoint

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Perform

func Perform(ctx context.Context, rawurl string, depth int, done chan<- struct{})

Perform is a entrypoint of application

func SetDirectory

func SetDirectory(d string)

func SetLoggerFlags

func SetLoggerFlags()

func SetMaxConnsPerHost

func SetMaxConnsPerHost(limit int)

Types

type Kind

type Kind int
const (
	// https://golang.org/ref/spec#Iota
	// iota always starts from zero
	// means zero value of int (Kind) is Unknown
	Unknown Kind = iota
	HTML
	CSS
	Any
)

type Resource

type Resource struct {
	Parent string
	URL    *url.URL
	Kind   Kind
	Body   *bytes.Buffer
}

type Site

type Site struct {
	*Resource
	// contains filtered or unexported fields
}

func NewSite

func NewSite(r *Resource) *Site

type Stylesheet

type Stylesheet struct {
	*Resource
	// contains filtered or unexported fields
}

func NewStylesheet

func NewStylesheet(r *Resource) *Stylesheet

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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