phone

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const PHONE_MAX_LENGTH = 12
View Source
const PHONE_MIN_LENGTH = 10
View Source
const PHONE_REGEX = `^(?:\+?(\d{1,3}))?(\d{2})(\d{4,10})$`

Variables

This section is empty.

Functions

func IsValid

func IsValid(phone string) bool

Types

type Phone

type Phone[T any] struct {
	// contains filtered or unexported fields
}

func Parse

func Parse[T any](v T) (Phone[T], error)

func (Phone[T]) ToSlice

func (p Phone[T]) ToSlice() []string

func (Phone[T]) ToString

func (p Phone[T]) ToString() string

func (Phone[T]) ToStringP

func (p Phone[T]) ToStringP() *string

func (Phone[T]) Value

func (p Phone[T]) Value() T

Jump to

Keyboard shortcuts

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