parse

package
v2.0.0-...-8a7f49b Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: AGPL-3.0-or-later Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidCommentID = errors.New("invalid comment ID")
	ErrInvalidComment   = errors.New("invalid comment")
)
View Source
var (
	ErrInviteeInvalid    = errors.New("invalid invitee name")
	ErrInviteCodeInvalid = errors.New("invalid invite code")
)
View Source
var (
	ErrPasswordTooShort             = fmt.Errorf("invalid password: must be at least %d characters", minPasswordLength)
	ErrPasswordTooLong              = fmt.Errorf("invalid password: must be %d characters or fewer", maxPasswordLength)
	ErrPasswordHasInvalidCharacters = errors.New("invalid password: must only contain letters A-Z, a-z, 0-9, or special characters")
)
View Source
var (
	ErrInvalidReviewID             = errors.New("invalid review ID")
	ErrInvalidMediaTitle           = errors.New("invalid media title")
	ErrInvalidRating               = fmt.Errorf("rating must be between %d and %d", minRating, maxRating)
	ErrWatchDateUnrecognizedFormat = fmt.Errorf("unrecognized format for watch date, must be in %s format", watchDateFormat)
	ErrWatchDateTooLate            = fmt.Errorf("watch time must be no later than %s", time.Now().Format("2006-01-02"))
	ErrInvalidBlurb                = errors.New("invalid blurb")

	MediaTitleMinLength = 2
	MediaTitleMaxLength = 160
)
View Source
var ErrInvalidMovieID = errors.New("invalid movie ID")
View Source
var (
	ErrInvalidUsername = errors.New("invalid username")
)

Functions

func Blurb

func Blurb(raw string) (screenjournal.Blurb, error)

func CommentID

func CommentID(raw string) (screenjournal.CommentID, error)

func CommentText

func CommentText(comment string) (screenjournal.CommentText, error)

func Email

func Email(email string) (screenjournal.Email, error)

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

func InviteCode

func InviteCode(raw string) (screenjournal.InviteCode, error)

func Invitee

func Invitee(raw string) (screenjournal.Invitee, error)

func MediaTitle

func MediaTitle(raw string) (screenjournal.MediaTitle, error)

func MovieIDFromString

func MovieIDFromString(raw string) (screenjournal.MovieID, error)

func Password

func Password(plaintext string) (screenjournal.Password, error)

func Rating

func Rating(raw int) (screenjournal.Rating, error)

func ReviewID

func ReviewID(id uint64) (screenjournal.ReviewID, error)

func ReviewIDFromString

func ReviewIDFromString(raw string) (screenjournal.ReviewID, error)

func Username

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

func WatchDate

func WatchDate(raw string) (screenjournal.WatchDate, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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