Documentation
¶
Index ¶
- Constants
- Variables
- func EmailAddress(email string) (types.EmailAddress, error)
- func EntryDate(date string) (types.EntryDate, error)
- func MastodonAddress(address string) (types.MastodonAddress, error)
- func ProfileUpdateRequest(pur requests.ProfileUpdate) (types.UserProfile, error)
- func TwitterHandle(handle string) (types.TwitterHandle, error)
- func UserBio(bio string) (types.UserBio, error)
- func Username(username string) (types.Username, error)
Constants ¶
const UserBioMaxLength = 300
UserBioMaxLength is the maximum allowable length of a user bio (in characters).
Variables ¶
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 ¶
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.
Types ¶
This section is empty.