parse

package
v0.0.0-...-523796e Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const UserBioMaxLength = 300

UserBioMaxLength is the maximum allowable length of a user bio (in characters).

Variables

View Source
var (
	InvalidTwitterHandleError = errors.New("invalid twitter handle")
)

Functions

func EmailAddress

func EmailAddress(email string) (types.EmailAddress, error)

EmailAddress parses a raw email string into an EmailAddress object, validating that it's well-formed.

func EntryDate

func EntryDate(date string) (types.EntryDate, error)

EntryDate parses a raw date string into a EntryDate object, ensuring that the given date is valid for a journal entry.

To be valid, the date must be:

  • In YYYY-MM-DD format
  • A Friday
  • After 2019-01-01
  • Be no later than the nearest following Friday

func MastodonAddress

func MastodonAddress(address string) (types.MastodonAddress, error)

MastodonAddress parses a raw Mastodon address string into a MastodonAddress object validating that it's well-formed.

func ProfileUpdateRequest

func ProfileUpdateRequest(pur requests.ProfileUpdate) (types.UserProfile, error)

ProfileUpdateRequest parses a raw profile update request into a UserProfile, validating that the request is well-formed and all fields are legal.

func TwitterHandle

func TwitterHandle(handle string) (types.TwitterHandle, error)

TwitterHandle parses a raw string into a TwitterHandle, validating that it's a legal Twitter handle.

func UserBio

func UserBio(bio string) (types.UserBio, error)

UserBio parses a raw user bio string into a UserBio, validating that it contains no prohibited Markdown for a bio.

func Username

func Username(username string) (types.Username, error)

Username parses a What Got Done username from a raw string. Valid What Got Done usernames are whatever UserKit allows, which is currently:

  • 1-60 characters
  • Only English letters, numbers, and underscores

Types

This section is empty.

Jump to

Keyboard shortcuts

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