grok

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoLinkFound is returned if no link is found.
	ErrNoLinkFound = fmt.Errorf(`grok: failed to locate a known link`)
)

Functions

func AlphaNumerics added in v1.0.5

func AlphaNumerics(s string) string

AlphaNumerics takes a string and removes non-alpha numerics from it.

func Emails

func Emails(t string) (emails []string)

Emails will parse text and return all email strings. The emails that are returned are deduped and sorted.

func Numbers added in v1.0.5

func Numbers(s string) string

Numbers takes a string, and removes non-numbers from it.

Types

type LinkMatch

type LinkMatch struct {
	ID       string   `json:"id"`
	Type     string   `json:"type"`
	URL      string   `json:"url"`
	Captures []string `json:"captures"`
}

LinkMatch is a social/professional network record.

func Link(strs ...string) (*LinkMatch, error)

Link will attempt to identify a link from a set of strings. The first link that is found will be returned.

func Links(strs ...string) (matches []LinkMatch)

Links will attempt to identify one or more known links.

Jump to

Keyboard shortcuts

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