work

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Empty

type Empty struct{}

Empty holds nothing; it is used for set values.

type Item

type Item struct {
	URL       *url.URL
	StartTime time.Time
	Referrer  *url.URL
	Depth     int
	FilePath  string // returned when the item is processed
}

Item is comparable

func (Item) ChangePath added in v1.4.0

func (it Item) ChangePath(newPath string) Item

func (Item) String

func (it Item) String() string

type Refs

type Refs []*url.URL

func (Refs) String

func (refs Refs) String() string

type Result

type Result struct {
	Item
	StatusCode    int
	References    Refs
	Excluded      Refs
	Location      string // only used for 301-308 redirection
	ContentLength int64
	FileSize      int64
	Gzip          bool
}

func (Result) IsRedirect added in v1.4.0

func (r Result) IsRedirect() bool

type Set

type Set[T comparable] struct {
	// contains filtered or unexported fields
}

Set contains distinct values of comparable type T. It can be accessed and altered concurrently.

Note that literals need empty values, so will be of the form

Set[int]{2: {}, 4: {}}

func NewSet

func NewSet[T comparable](slice ...T) *Set[T]

NewSet creates a new set based on some optional initial values.

func (*Set[T]) Add

func (s *Set[T]) Add(val ...T)

func (*Set[T]) AddIfAbsent

func (s *Set[T]) AddIfAbsent(val T) bool

AddIfAbsent adds val to the set if absent, returning true. Otherwise, it returns false.

func (*Set[T]) Contains

func (s *Set[T]) Contains(val T) bool

func (*Set[T]) Size

func (s *Set[T]) Size() int

func (*Set[T]) Slice

func (s *Set[T]) Slice() []T

Jump to

Keyboard shortcuts

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