link

package
v0.0.0-...-1c1543c Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: CC0-1.0 Imports: 4 Imported by: 0

Documentation

Overview

Package link provides the interface for a link and link related primitives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Schemify

func Schemify(u string) string

Schemify returns the possibly schemeless argument URL but with a scheme prefix added if necessary.

url.Parse requires a scheme.

Types

type L

type L interface {
	// A contextual/presentation dominating ancestor element, if any.
	Ancestor() string
	// The destination URL of the link.
	URL() string
	// The optimal visual form for this link. May include for example the text surrounding the link to provide
	// context.
	String() string
}

L is a URL and possibly some context regarding the link's situation in the HTML document it originates from.

type SELink struct {
	Relative string
	Target   string
	Text     string
	SeSite   string
	PostID   int
	PostType int
}

SELink is a link in a post on a Stack Exchange site.

type Status

type Status struct {
	SELink
	ResponseStatusCode int
	Screenshot         []byte
	Timeout            bool
}

Status is a status report on the resource pointed to by a link.

func (Status) Marshal

func (st Status) Marshal() ([]byte, error)

Marshal returns the marshalled bytes of the receiver status.

Employs the use of the marshal method generated by the Protocol Buffers format data structure defintion.

See the Protocol Buffers format data structure definition of the Status message for the expected structure of the bytes.

func (Status) String

func (st Status) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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