momus

package module
v0.0.0-...-3264a23 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2017 License: MIT Imports: 6 Imported by: 0

README

momus

GoDoc

momus is a web scraper written in Go made to health check all the internal links inside a given site.

Quick Start

package main

import (
	"fmt"
	"github.com/fagnercarvalho/momus"
)

func main() {
	healthChecker := momus.New(&momus.Config{OnlyDeadLinks: false})
	links := healthChecker.GetLinks("http://fagner.co")

	for _, linkResult := range links {
		fmt.Printf("%d | %s \n", linkResult.StatusCode, linkResult.Link)
	}
}

Example

http://www.github.com/fagnercarvalho/momus-example

Documentation

Overview

Package momus is a web scraper made to health check all the internal links inside a given site.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	OnlyDeadLinks bool
}

type HealthChecker

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

Link health checker

func New

func New(config *Config) *HealthChecker

New creates a new health checker.

func (checker *HealthChecker) GetLinks(link string) []LinkResult

Perform a deep search for all internal links inside the link and return a slice containing the result

type LinkResult

type LinkResult struct {
	Link       string
	StatusCode int
	// contains filtered or unexported fields
}

Link health check result

Jump to

Keyboard shortcuts

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