Documentation ¶
Index ¶
- Constants
- Variables
- func Compare(a, b ParsedURI) int
- func IsOnlyNumbers(s string) bool
- func ToIdentifierStringSlice(handles []ParsedURI) []string
- func ToStringSlice(handles []ParsedURI) []string
- func ToZerologArray(handles []ParsedURI) *zerolog.Array
- type ParsedURI
- func ParseIdentifier(identifier string, opts ParsingOption) (ParsedURI, error)
- func ParseIdentifierWithLocalNumbers(identifier string, opts ParsingOption, nationalNumberRegion string) (ParsedURI, error)
- func ParseURI(uri string) (ParsedURI, error)
- func ParseURIBytes(uri []byte) (ParsedURI, error)
- func Sort(handles []ParsedURI) []ParsedURI
- func (pu *ParsedURI) IsEmpty() bool
- func (uri *ParsedURI) IsShortcode() bool
- func (pu *ParsedURI) MarshalPlist() (any, error)
- func (pu *ParsedURI) MarshalText() ([]byte, error)
- func (pu *ParsedURI) Scan(i interface{}) error
- func (pu *ParsedURI) String() string
- func (pu *ParsedURI) StringPtr() *string
- func (pu *ParsedURI) UnmarshalPlist(unmarshal func(any) error) error
- func (pu *ParsedURI) UnmarshalText(text []byte) (err error)
- func (pu ParsedURI) Value() (driver.Value, error)
- type ParsingOption
- type PlainURI
- type Scheme
Constants ¶
View Source
const ( POIntlNumber ParsingOption = 1 << iota POAlphanumericSenderID POShortcodes POEmail PONationalNumber POGroupUUID POGroupParticipantHash // ParseIncomingSMSForward allows parsing user identifiers that are valid senders of incoming SMS. ParseIncomingSMSForward = POIntlNumber | POAlphanumericSenderID | POShortcodes | POEmail // ParseOutgoingSMSForward allows parsing user identifiers that can be sent SMS. Emails are intentionally excluded. ParseOutgoingSMSForward = POIntlNumber | POShortcodes // ParseiMessageDM allows parsing user identifiers that can be sent messages on iMessage. ParseiMessageDM = POIntlNumber | POEmail // ParseiMessageGroup allows parsing iMessage group identifiers. ParseiMessageGroup = POGroupUUID | POGroupParticipantHash // ParseAnyChat parses any reasonably normal identifier in a chat, // i.e. all parsing options except international without prefix ParseAnyChat = ParseiMessageDM | ParseiMessageGroup | POAlphanumericSenderID | POShortcodes )
Variables ¶
View Source
var ErrMissingColon = errors.New("invalid URI (missing `:`)")
Functions ¶
func IsOnlyNumbers ¶
func ToIdentifierStringSlice ¶
func ToStringSlice ¶
func ToZerologArray ¶
Types ¶
type ParsedURI ¶
var EmptyURI ParsedURI
func ParseIdentifier ¶
func ParseIdentifier(identifier string, opts ParsingOption) (ParsedURI, error)
func ParseIdentifierWithLocalNumbers ¶
func ParseIdentifierWithLocalNumbers(identifier string, opts ParsingOption, nationalNumberRegion string) (ParsedURI, error)
func ParseURIBytes ¶
func (*ParsedURI) IsShortcode ¶
func (*ParsedURI) MarshalPlist ¶
func (*ParsedURI) MarshalText ¶
func (*ParsedURI) UnmarshalPlist ¶
func (*ParsedURI) UnmarshalText ¶
type ParsingOption ¶
type ParsingOption uint
Click to show internal directories.
Click to hide internal directories.