tkValueObject

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 16 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AccountIdSystem = AccountId(0)
View Source
var AvailableCountryCodes = []CountryCode{}/* 181 elements not displayed */
View Source
var HumanlyUsedCharsRegex = regexp.MustCompile(`^[\p{L}\p{N}\p{Pd}\p{Pi}\p{Pf}\p{Pc}\p{Po}\p{Z}\p{Sc}\(\)\[\]\+\=]+$`)
View Source
var IpAddressLocal = IpAddress("127.0.0.1")
View Source
var ValidCompressionFormats = []string{
	"tar", "tar.gz", "gzip", "zip", "xz", "br",
}

Functions

This section is empty.

Types

type AccessTokenType added in v0.0.8

type AccessTokenType string
var (
	AccessTokenTypeSessionToken AccessTokenType = "sessionToken"
	AccessTokenTypeSecretKey    AccessTokenType = "secretKey"
)

func NewAccessTokenType added in v0.0.8

func NewAccessTokenType(value any) (tokenType AccessTokenType, err error)

func (AccessTokenType) String added in v0.0.8

func (vo AccessTokenType) String() string

type AccessTokenValue added in v0.0.8

type AccessTokenValue string

func NewAccessTokenValue added in v0.0.8

func NewAccessTokenValue(value any) (tokenValue AccessTokenValue, err error)

func (AccessTokenValue) String added in v0.0.8

func (vo AccessTokenValue) String() string

type AccountId added in v0.1.2

type AccountId uint64

func NewAccountId added in v0.1.2

func NewAccountId(value any) (accountId AccountId, err error)

func (AccountId) String added in v0.1.2

func (vo AccountId) String() string

func (AccountId) Uint64 added in v0.1.2

func (vo AccountId) Uint64() uint64

type ActivityRecordCode added in v0.1.2

type ActivityRecordCode string

func NewActivityRecordCode added in v0.1.2

func NewActivityRecordCode(value any) (recordCode ActivityRecordCode, err error)

func (ActivityRecordCode) String added in v0.1.2

func (vo ActivityRecordCode) String() string

type ActivityRecordId added in v0.1.2

type ActivityRecordId uint64

func NewActivityRecordId added in v0.1.2

func NewActivityRecordId(value any) (recordId ActivityRecordId, err error)

func (ActivityRecordId) String added in v0.1.2

func (vo ActivityRecordId) String() string

func (ActivityRecordId) Uint64 added in v0.1.2

func (vo ActivityRecordId) Uint64() uint64

type ActivityRecordLevel added in v0.1.2

type ActivityRecordLevel string
var (
	ActivityRecordLevelDebug    ActivityRecordLevel = "DEBUG"
	ActivityRecordLevelInfo     ActivityRecordLevel = "INFO"
	ActivityRecordLevelWarning  ActivityRecordLevel = "WARNING"
	ActivityRecordLevelError    ActivityRecordLevel = "ERROR"
	ActivityRecordLevelSecurity ActivityRecordLevel = "SECURITY"
)

func NewActivityRecordLevel added in v0.1.2

func NewActivityRecordLevel(value any) (recordLevel ActivityRecordLevel, err error)

func (ActivityRecordLevel) String added in v0.1.2

func (vo ActivityRecordLevel) String() string

type ActivityRecordMessage added in v0.1.2

type ActivityRecordMessage string

ActivityRecordMessage is a string that represents the message of an activity record. Since it's supposed to be used by the system itself, it's not validated as much as other value objects on purpose. There is only a length limit of 2048 characters.

func NewActivityRecordMessage added in v0.1.2

func NewActivityRecordMessage(value any) (recordMessage ActivityRecordMessage, err error)

func (ActivityRecordMessage) String added in v0.1.2

func (vo ActivityRecordMessage) String() string

type Byte added in v0.0.8

type Byte uint64

func NewByte added in v0.0.8

func NewByte(value any) (byteVo Byte, err error)

func NewGibibyte added in v0.0.8

func NewGibibyte(value any) (byteVo Byte, err error)

func NewKibibyte added in v0.0.8

func NewKibibyte(value any) (byteVo Byte, err error)

func NewMebibyte added in v0.0.8

func NewMebibyte(value any) (byteVo Byte, err error)

func NewTebibyte added in v0.0.8

func NewTebibyte(value any) (byteVo Byte, err error)

func (Byte) Float64 added in v0.0.8

func (vo Byte) Float64() float64

func (Byte) Int64 added in v0.0.8

func (vo Byte) Int64() int64

func (Byte) String added in v0.0.8

func (vo Byte) String() string

func (Byte) StringWithSuffix added in v0.0.8

func (vo Byte) StringWithSuffix() string

func (Byte) ToGiB added in v0.0.8

func (vo Byte) ToGiB() uint64

func (Byte) ToKiB added in v0.0.8

func (vo Byte) ToKiB() uint64

func (Byte) ToMiB added in v0.0.8

func (vo Byte) ToMiB() uint64

func (Byte) ToTiB added in v0.0.8

func (vo Byte) ToTiB() uint64

func (Byte) Uint64 added in v0.0.8

func (vo Byte) Uint64() uint64

type CidrBlock

type CidrBlock string

func NewCidrBlock

func NewCidrBlock(value any) (cidrBlock CidrBlock, err error)

func (CidrBlock) IsIpv4

func (vo CidrBlock) IsIpv4() bool

func (CidrBlock) IsIpv6

func (vo CidrBlock) IsIpv6() bool

func (CidrBlock) IsPrivate

func (vo CidrBlock) IsPrivate() bool

func (CidrBlock) IsPublic

func (vo CidrBlock) IsPublic() bool

func (CidrBlock) String

func (vo CidrBlock) String() string

type CityName added in v0.0.8

type CityName string

func NewCityName added in v0.0.8

func NewCityName(value any) (cityName CityName, err error)

func (CityName) String added in v0.0.8

func (vo CityName) String() string

type CompressionFormat added in v0.0.7

type CompressionFormat string
var (
	CompressionFormatTarball        CompressionFormat = "tar"
	CompressionFormatGzippedTarball CompressionFormat = "tar.gz"
	CompressionFormatGzip           CompressionFormat = "gzip"
	CompressionFormatZip            CompressionFormat = "zip"
	CompressionFormatXz             CompressionFormat = "xz"
	CompressionFormatBrotli         CompressionFormat = "br"
)

func NewCompressionFormat added in v0.0.7

func NewCompressionFormat(value any) (CompressionFormat, error)

func (CompressionFormat) String added in v0.0.7

func (vo CompressionFormat) String() string

type CountryCode added in v0.0.8

type CountryCode string

func NewCountryCode added in v0.0.8

func NewCountryCode(value any) (countryCode CountryCode, err error)

func (CountryCode) ReadCountryName added in v0.0.8

func (vo CountryCode) ReadCountryName() (string, error)

func (CountryCode) String added in v0.0.8

func (vo CountryCode) String() string

type CurrencyCode added in v0.0.8

type CurrencyCode string
var (
	CurrencyCodeAED     CurrencyCode = "AED"
	CurrencyCodeAUD     CurrencyCode = "AUD"
	CurrencyCodeBRL     CurrencyCode = "BRL"
	CurrencyCodeCAD     CurrencyCode = "CAD"
	CurrencyCodeCHF     CurrencyCode = "CHF"
	CurrencyCodeCLP     CurrencyCode = "CLP"
	CurrencyCodeCNY     CurrencyCode = "CNY"
	CurrencyCodeCOP     CurrencyCode = "COP"
	CurrencyCodeCZK     CurrencyCode = "CZK"
	CurrencyCodeDKK     CurrencyCode = "DKK"
	CurrencyCodeEUR     CurrencyCode = "EUR"
	CurrencyCodeGBP     CurrencyCode = "GBP"
	CurrencyCodeHKD     CurrencyCode = "HKD"
	CurrencyCodeHUF     CurrencyCode = "HUF"
	CurrencyCodeIDR     CurrencyCode = "IDR"
	CurrencyCodeILS     CurrencyCode = "ILS"
	CurrencyCodeINR     CurrencyCode = "INR"
	CurrencyCodeJPY     CurrencyCode = "JPY"
	CurrencyCodeKRW     CurrencyCode = "KRW"
	CurrencyCodeMXN     CurrencyCode = "MXN"
	CurrencyCodeMYR     CurrencyCode = "MYR"
	CurrencyCodeNOK     CurrencyCode = "NOK"
	CurrencyCodeNZD     CurrencyCode = "NZD"
	CurrencyCodePEN     CurrencyCode = "PEN"
	CurrencyCodePHP     CurrencyCode = "PHP"
	CurrencyCodePLN     CurrencyCode = "PLN"
	CurrencyCodeRON     CurrencyCode = "RON"
	CurrencyCodeRUB     CurrencyCode = "RUB"
	CurrencyCodeSAR     CurrencyCode = "SAR"
	CurrencyCodeSEK     CurrencyCode = "SEK"
	CurrencyCodeSGD     CurrencyCode = "SGD"
	CurrencyCodeTHB     CurrencyCode = "THB"
	CurrencyCodeTRY     CurrencyCode = "TRY"
	CurrencyCodeTWD     CurrencyCode = "TWD"
	CurrencyCodeUSD     CurrencyCode = "USD"
	CurrencyCodeXCD     CurrencyCode = "XCD"
	CurrencyCodeZAR     CurrencyCode = "ZAR"
	CurrencyCodeDefault CurrencyCode = CurrencyCodeUSD
)

func NewCurrencyCode added in v0.0.8

func NewCurrencyCode(value any) (currencyCode CurrencyCode, err error)

func (CurrencyCode) ReadCurrencyName added in v0.0.8

func (vo CurrencyCode) ReadCurrencyName() (string, error)

func (CurrencyCode) String added in v0.0.8

func (vo CurrencyCode) String() string

type DnsRecordType added in v0.1.8

type DnsRecordType string
var (
	DnsRecordTypeA       DnsRecordType = "A"
	DnsRecordTypeAAAA    DnsRecordType = "AAAA"
	DnsRecordTypeMX      DnsRecordType = "MX"
	DnsRecordTypeTXT     DnsRecordType = "TXT"
	DnsRecordTypeNS      DnsRecordType = "NS"
	DnsRecordTypeCNAME   DnsRecordType = "CNAME"
	DnsRecordTypePTR     DnsRecordType = "PTR"
	DnsRecordTypeDefault               = DnsRecordTypeA
)

func NewDnsRecordType added in v0.1.8

func NewDnsRecordType(value any) (dnsRecordType DnsRecordType, err error)

func (DnsRecordType) String added in v0.1.8

func (vo DnsRecordType) String() string

type Fqdn added in v0.0.8

type Fqdn string

func NewFqdn added in v0.0.8

func NewFqdn(value any) (fqdn Fqdn, err error)

func (Fqdn) String added in v0.0.8

func (vo Fqdn) String() string

type GenericNotes added in v0.0.8

type GenericNotes string

func NewGenericNotes added in v0.0.8

func NewGenericNotes(value any) (genericNotes GenericNotes, err error)

func (GenericNotes) String added in v0.0.8

func (vo GenericNotes) String() string

type Hash added in v0.0.8

type Hash string

func NewHash added in v0.0.8

func NewHash(value any) (hash Hash, err error)

func (Hash) String added in v0.0.8

func (vo Hash) String() string

type HttpMethod added in v0.0.8

type HttpMethod string
var (
	HttpMethodGet     HttpMethod = "GET"
	HttpMethodHead    HttpMethod = "HEAD"
	HttpMethodPost    HttpMethod = "POST"
	HttpMethodPut     HttpMethod = "PUT"
	HttpMethodDelete  HttpMethod = "DELETE"
	HttpMethodConnect HttpMethod = "CONNECT"
	HttpMethodOptions HttpMethod = "OPTIONS"
	HttpMethodTrace   HttpMethod = "TRACE"
	HttpMethodPatch   HttpMethod = "PATCH"
)

func NewHttpMethod added in v0.0.8

func NewHttpMethod(value any) (vo HttpMethod, err error)

func (HttpMethod) HasBodySupport added in v0.0.8

func (vo HttpMethod) HasBodySupport() bool

func (HttpMethod) String added in v0.0.8

func (vo HttpMethod) String() string

type HttpStatusCode added in v0.0.8

type HttpStatusCode uint16
var (
	HttpStatusCodeContinue                      HttpStatusCode = 100
	HttpStatusCodeSwitchingProtocols            HttpStatusCode = 101
	HttpStatusCodeProcessing                    HttpStatusCode = 102
	HttpStatusCodeEarlyHints                    HttpStatusCode = 103
	HttpStatusCodeOk                            HttpStatusCode = 200
	HttpStatusCodeCreated                       HttpStatusCode = 201
	HttpStatusCodeAccepted                      HttpStatusCode = 202
	HttpStatusCodeNonAuthoritativeInfo          HttpStatusCode = 203
	HttpStatusCodeNoContent                     HttpStatusCode = 204
	HttpStatusCodeResetContent                  HttpStatusCode = 205
	HttpStatusCodePartialContent                HttpStatusCode = 206
	HttpStatusCodeMultiStatus                   HttpStatusCode = 207
	HttpStatusCodeAlreadyReported               HttpStatusCode = 208
	HttpStatusCodeImUsed                        HttpStatusCode = 226
	HttpStatusCodeMultipleChoices               HttpStatusCode = 300
	HttpStatusCodeMovedPermanently              HttpStatusCode = 301
	HttpStatusCodeFound                         HttpStatusCode = 302
	HttpStatusCodeSeeOther                      HttpStatusCode = 303
	HttpStatusCodeNotModified                   HttpStatusCode = 304
	HttpStatusCodeTemporaryRedirect             HttpStatusCode = 307
	HttpStatusCodePermanentRedirect             HttpStatusCode = 308
	HttpStatusCodeBadRequest                    HttpStatusCode = 400
	HttpStatusCodeUnauthorized                  HttpStatusCode = 401
	HttpStatusCodePaymentRequired               HttpStatusCode = 402
	HttpStatusCodeForbidden                     HttpStatusCode = 403
	HttpStatusCodeNotFound                      HttpStatusCode = 404
	HttpStatusCodeMethodNotAllowed              HttpStatusCode = 405
	HttpStatusCodeNotAcceptable                 HttpStatusCode = 406
	HttpStatusCodeProxyAuthenticationRequired   HttpStatusCode = 407
	HttpStatusCodeRequestTimeout                HttpStatusCode = 408
	HttpStatusCodeConflict                      HttpStatusCode = 409
	HttpStatusCodeGone                          HttpStatusCode = 410
	HttpStatusCodeLengthRequired                HttpStatusCode = 411
	HttpStatusCodePreconditionFailed            HttpStatusCode = 412
	HttpStatusCodePayloadTooLarge               HttpStatusCode = 413
	HttpStatusCodeUriTooLong                    HttpStatusCode = 414
	HttpStatusCodeUnsupportedMediaType          HttpStatusCode = 415
	HttpStatusCodeRangeNotSatisfiable           HttpStatusCode = 416
	HttpStatusCodeExpectationFailed             HttpStatusCode = 417
	HttpStatusCodeImATeapot                     HttpStatusCode = 418
	HttpStatusCodeMisdirectedRequest            HttpStatusCode = 421
	HttpStatusCodeUnprocessableEntity           HttpStatusCode = 422
	HttpStatusCodeLocked                        HttpStatusCode = 423
	HttpStatusCodeFailedDependency              HttpStatusCode = 424
	HttpStatusCodeTooEarly                      HttpStatusCode = 425
	HttpStatusCodeUpgradeRequired               HttpStatusCode = 426
	HttpStatusCodePreconditionRequired          HttpStatusCode = 428
	HttpStatusCodeTooManyRequests               HttpStatusCode = 429
	HttpStatusCodeRequestHeaderFieldsTooLarge   HttpStatusCode = 431
	HttpStatusCodeUnavailableForLegalReasons    HttpStatusCode = 451
	HttpStatusCodeInternalServerError           HttpStatusCode = 500
	HttpStatusCodeNotImplemented                HttpStatusCode = 501
	HttpStatusCodeBadGateway                    HttpStatusCode = 502
	HttpStatusCodeServiceUnavailable            HttpStatusCode = 503
	HttpStatusCodeGatewayTimeout                HttpStatusCode = 504
	HttpStatusCodeHttpVersionNotSupported       HttpStatusCode = 505
	HttpStatusCodeVariantAlsoNegotiates         HttpStatusCode = 506
	HttpStatusCodeInsufficientStorage           HttpStatusCode = 507
	HttpStatusCodeLoopDetected                  HttpStatusCode = 508
	HttpStatusCodeNotExtended                   HttpStatusCode = 510
	HttpStatusCodeNetworkAuthenticationRequired HttpStatusCode = 511
)

func NewHttpStatusCode added in v0.0.8

func NewHttpStatusCode(value any) (statusCode HttpStatusCode, err error)

func (HttpStatusCode) String added in v0.0.8

func (vo HttpStatusCode) String() string

func (HttpStatusCode) Uint16 added in v0.0.8

func (vo HttpStatusCode) Uint16() uint16

type IpAddress

type IpAddress string

func NewIpAddress

func NewIpAddress(value any) (ipAddress IpAddress, err error)

func (IpAddress) IsIpv4

func (vo IpAddress) IsIpv4() bool

func (IpAddress) IsIpv6

func (vo IpAddress) IsIpv6() bool

func (IpAddress) IsLocal

func (vo IpAddress) IsLocal() bool

func (IpAddress) IsPrivate

func (vo IpAddress) IsPrivate() bool

func (IpAddress) IsPublic

func (vo IpAddress) IsPublic() bool

func (IpAddress) String

func (vo IpAddress) String() string

func (IpAddress) ToCidrBlock

func (vo IpAddress) ToCidrBlock() CidrBlock

type MailAddress

type MailAddress string

func NewMailAddress

func NewMailAddress(value any) (mailAddress MailAddress, err error)

func (MailAddress) String

func (vo MailAddress) String() string

type MimeType added in v0.0.8

type MimeType string
var (
	MimeTypeDirectory MimeType = "directory"
	MimeTypeGeneric   MimeType = "generic"
)

func NewMimeType added in v0.0.8

func NewMimeType(value any) (mimeType MimeType, err error)

func (MimeType) IsDir added in v0.0.8

func (vo MimeType) IsDir() bool

func (MimeType) String added in v0.0.8

func (vo MimeType) String() string

type NetworkPort added in v0.0.8

type NetworkPort uint16

func NewNetworkPort added in v0.0.8

func NewNetworkPort(value interface{}) (networkPort NetworkPort, err error)

func (NetworkPort) String added in v0.0.8

func (vo NetworkPort) String() string

func (NetworkPort) Uint16 added in v0.0.8

func (vo NetworkPort) Uint16() uint16

type NetworkProtocol added in v0.0.8

type NetworkProtocol string
var (
	NetworkProtocolHttp    NetworkProtocol = "http"
	NetworkProtocolHttps   NetworkProtocol = "https"
	NetworkProtocolWs      NetworkProtocol = "ws"
	NetworkProtocolWss     NetworkProtocol = "wss"
	NetworkProtocolGrpc    NetworkProtocol = "grpc"
	NetworkProtocolGrpcs   NetworkProtocol = "grpcs"
	NetworkProtocolTcp     NetworkProtocol = "tcp"
	NetworkProtocolUdp     NetworkProtocol = "udp"
	NetworkProtocolDefault NetworkProtocol = "http"
)

func NewNetworkProtocol added in v0.0.8

func NewNetworkProtocol(value any) (networkProtocol NetworkProtocol, err error)

func (NetworkProtocol) String added in v0.0.8

func (vo NetworkProtocol) String() string

type PaginationLastSeenId added in v0.0.8

type PaginationLastSeenId string

func NewPaginationLastSeenId added in v0.0.8

func NewPaginationLastSeenId(value any) (lastSeenId PaginationLastSeenId, err error)

func (PaginationLastSeenId) String added in v0.0.8

func (vo PaginationLastSeenId) String() string

type PaginationSortBy added in v0.0.8

type PaginationSortBy string

func NewPaginationSortBy added in v0.0.8

func NewPaginationSortBy(value any) (sortBy PaginationSortBy, err error)

func (PaginationSortBy) String added in v0.0.8

func (vo PaginationSortBy) String() string

type PaginationSortDirection added in v0.0.8

type PaginationSortDirection string
var (
	PaginationSortDirectionAsc  PaginationSortDirection = "asc"
	PaginationSortDirectionDesc PaginationSortDirection = "desc"
)

func NewPaginationSortDirection added in v0.0.8

func NewPaginationSortDirection(value any) (
	sortDirection PaginationSortDirection, err error,
)

func (PaginationSortDirection) String added in v0.0.8

func (vo PaginationSortDirection) String() string

type Password added in v0.0.8

type Password string

Password must be at least 5 characters long and at most 128 characters long. It must contain at least one letter, one number, and one special character. If you cannot control the password being validated (e.g. a password from an external service), use WeakPassword instead.

func NewPassword added in v0.0.8

func NewPassword(value any) (password Password, err error)

func (Password) String added in v0.0.8

func (vo Password) String() string

type PhoneNumber added in v0.0.8

type PhoneNumber string

func NewPhoneNumber added in v0.0.8

func NewPhoneNumber(value any) (phoneNumber PhoneNumber, err error)

func (PhoneNumber) String added in v0.0.8

func (vo PhoneNumber) String() string

type RelativeTime added in v0.0.8

type RelativeTime string

func NewRelativeTime added in v0.0.8

func NewRelativeTime(value any) (relativeTime RelativeTime, err error)

func (RelativeTime) String added in v0.0.8

func (vo RelativeTime) String() string

type StreetAddress added in v0.0.8

type StreetAddress string

func NewStreetAddress added in v0.0.8

func NewStreetAddress(value any) (streetAddress StreetAddress, err error)

func (StreetAddress) String added in v0.0.8

func (vo StreetAddress) String() string

type SystemResourceId added in v0.1.6

type SystemResourceId string

func NewSystemResourceId added in v0.1.6

func NewSystemResourceId(value any) (resourceId SystemResourceId, err error)

func (SystemResourceId) String added in v0.1.6

func (vo SystemResourceId) String() string

type SystemResourceIdentifier added in v0.1.2

type SystemResourceIdentifier string

SystemResourceIdentifier is a string that represents the complete identifier of a system resource.

It has the following format: sri://<accountId>:<resourceType>/<resourceId>

- accountId: the account id of the resource, 0 if it's a system resource. It must be a positive integer.

- resourceType: the type of the resource. It must start with a letter and can only contain letters, numbers, underscores, and hyphens. It has a maximum length of 256 characters.

- resourceId: the id of the resource. It must start with a letter or number and can only contain letters, numbers, underscores, hyphens, and periods OR be a single asterisk ("*") to represent all resources of the type. It has a maximum length of 512 characters.

func NewSriAccount added in v0.1.5

func NewSriAccount(accountId AccountId) SystemResourceIdentifier

func NewSystemResourceIdentifier added in v0.1.2

func NewSystemResourceIdentifier(value any) (sri SystemResourceIdentifier, err error)

func NewSystemResourceIdentifierMustCreate added in v0.1.2

func NewSystemResourceIdentifierMustCreate(value any) SystemResourceIdentifier

Note: This function is solely used for developer auditing to warn about the misuse of the SystemResourceIdentifier Value Object. It is not intended for user input validation and should not be used as a model for other Value Objects. It is not a standard and should not be followed for the development of other Value Objects.

func (SystemResourceIdentifier) ReadAccountId added in v0.1.5

func (vo SystemResourceIdentifier) ReadAccountId() (accountId AccountId, err error)

func (SystemResourceIdentifier) ReadResourceId added in v0.1.5

func (vo SystemResourceIdentifier) ReadResourceId() (resourceId SystemResourceId, err error)

func (SystemResourceIdentifier) ReadResourceType added in v0.1.5

func (vo SystemResourceIdentifier) ReadResourceType() (resourceType SystemResourceType, err error)

func (SystemResourceIdentifier) String added in v0.1.2

func (vo SystemResourceIdentifier) String() string

type SystemResourceType added in v0.1.6

type SystemResourceType string
var (
	SystemResourceTypeAccount SystemResourceType = "account"
)

func NewSystemResourceType added in v0.1.6

func NewSystemResourceType(value any) (resourceType SystemResourceType, err error)

func (SystemResourceType) String added in v0.1.6

func (vo SystemResourceType) String() string

type UnixAbsoluteFilePath added in v0.0.9

type UnixAbsoluteFilePath string

func NewUnixAbsoluteFilePath added in v0.0.9

func NewUnixAbsoluteFilePath(value any, allowUnsafeChars bool) (
	filePath UnixAbsoluteFilePath, err error,
)

func (UnixAbsoluteFilePath) ReadCompoundFileExtension added in v0.0.9

func (vo UnixAbsoluteFilePath) ReadCompoundFileExtension() (UnixFileExtension, error)

func (UnixAbsoluteFilePath) ReadFileDir added in v0.0.9

func (vo UnixAbsoluteFilePath) ReadFileDir() UnixAbsoluteFilePath

func (UnixAbsoluteFilePath) ReadFileExtension added in v0.0.9

func (vo UnixAbsoluteFilePath) ReadFileExtension() (UnixFileExtension, error)

func (UnixAbsoluteFilePath) ReadFileName added in v0.0.9

func (vo UnixAbsoluteFilePath) ReadFileName(allowUnsafeChars bool) UnixFileName

func (UnixAbsoluteFilePath) ReadFileNameWithoutExtension added in v0.0.9

func (vo UnixAbsoluteFilePath) ReadFileNameWithoutExtension(allowUnsafeChars bool) UnixFileName

func (UnixAbsoluteFilePath) ReadWithoutExtension added in v0.0.9

func (vo UnixAbsoluteFilePath) ReadWithoutExtension(allowUnsafeChars bool) UnixAbsoluteFilePath

func (UnixAbsoluteFilePath) String added in v0.0.9

func (vo UnixAbsoluteFilePath) String() string

type UnixCommand added in v0.0.8

type UnixCommand string

func NewUnixCommand added in v0.0.8

func NewUnixCommand(value any) (unixCommand UnixCommand, err error)

func (UnixCommand) String added in v0.0.8

func (vo UnixCommand) String() string

type UnixFileExtension added in v0.0.8

type UnixFileExtension string

func NewUnixFileExtension added in v0.0.8

func NewUnixFileExtension(value any) (
	unixFileExtension UnixFileExtension, err error,
)

func (UnixFileExtension) ReadMimeType added in v0.0.8

func (vo UnixFileExtension) ReadMimeType() MimeType

func (UnixFileExtension) String added in v0.0.8

func (vo UnixFileExtension) String() string

type UnixFileName added in v0.0.8

type UnixFileName string

func NewUnixFileName added in v0.0.8

func NewUnixFileName(value any, allowUnsafeChars bool) (fileName UnixFileName, err error)

func (UnixFileName) String added in v0.0.8

func (vo UnixFileName) String() string

type UnixFileOwnership added in v0.0.8

type UnixFileOwnership string
var (
	UnixFileOwnershipNobodyNogroup UnixFileOwnership = "nobody:nogroup"
	UnixFileOwnershipRootRoot      UnixFileOwnership = "root:root"
)

func NewUnixFileOwnership added in v0.0.8

func NewUnixFileOwnership(value any) (fileOwnership UnixFileOwnership, err error)

func (UnixFileOwnership) ReadGroupName added in v0.0.8

func (vo UnixFileOwnership) ReadGroupName() (UnixGroupName, error)

func (UnixFileOwnership) ReadUsername added in v0.0.8

func (vo UnixFileOwnership) ReadUsername() (UnixUsername, error)

func (UnixFileOwnership) String added in v0.0.8

func (vo UnixFileOwnership) String() string

type UnixGroupId added in v0.0.8

type UnixGroupId uint64

func NewUnixGroupId added in v0.0.8

func NewUnixGroupId(value any) (UnixGroupId, error)

func (UnixGroupId) String added in v0.0.8

func (vo UnixGroupId) String() string

func (UnixGroupId) Uint64 added in v0.0.8

func (vo UnixGroupId) Uint64() uint64

type UnixGroupName added in v0.0.8

type UnixGroupName string

func NewUnixGroupName added in v0.0.8

func NewUnixGroupName(value any) (unixGroupName UnixGroupName, err error)

func (UnixGroupName) String added in v0.0.8

func (vo UnixGroupName) String() string

type UnixHostname added in v0.0.8

type UnixHostname string

func NewUnixHostname added in v0.0.8

func NewUnixHostname(value any) (hostname UnixHostname, err error)

func (UnixHostname) String added in v0.0.8

func (vo UnixHostname) String() string

type UnixRelativeFilePath added in v0.0.9

type UnixRelativeFilePath string

func NewUnixRelativeFilePath added in v0.0.9

func NewUnixRelativeFilePath(value any) (filePath UnixRelativeFilePath, err error)

Besides validating the input, NewUnixRelativeFilePath will also normalize the path. If the path is not relative, it will be converted to a relative path. For example, "/my/file.go" will be converted to "./my/file.go". Be careful with relative paths. Consider using UnixAbsoluteFilePath VO whenever possible.

func (UnixRelativeFilePath) ReadCompoundFileExtension added in v0.0.9

func (vo UnixRelativeFilePath) ReadCompoundFileExtension() (UnixFileExtension, error)

func (UnixRelativeFilePath) ReadFileDir added in v0.0.9

func (vo UnixRelativeFilePath) ReadFileDir() UnixRelativeFilePath

func (UnixRelativeFilePath) ReadFileExtension added in v0.0.9

func (vo UnixRelativeFilePath) ReadFileExtension() (UnixFileExtension, error)

func (UnixRelativeFilePath) ReadFileName added in v0.0.9

func (vo UnixRelativeFilePath) ReadFileName() UnixFileName

func (UnixRelativeFilePath) ReadFileNameWithoutExtension added in v0.0.9

func (vo UnixRelativeFilePath) ReadFileNameWithoutExtension() UnixFileName

func (UnixRelativeFilePath) ReadWithoutExtension added in v0.0.9

func (vo UnixRelativeFilePath) ReadWithoutExtension() UnixRelativeFilePath

func (UnixRelativeFilePath) String added in v0.0.9

func (vo UnixRelativeFilePath) String() string

type UnixTime added in v0.0.4

type UnixTime int64

func NewUnixTime added in v0.0.4

func NewUnixTime(value any) (unixTime UnixTime, err error)

func NewUnixTimeAfterNow added in v0.0.4

func NewUnixTimeAfterNow(duration time.Duration) UnixTime

func NewUnixTimeBeforeNow added in v0.0.4

func NewUnixTimeBeforeNow(duration time.Duration) UnixTime

func NewUnixTimeNow added in v0.0.4

func NewUnixTimeNow() UnixTime

func NewUnixTimeWithGoTime added in v0.0.4

func NewUnixTimeWithGoTime(goTime time.Time) UnixTime

func (UnixTime) Int64 added in v0.0.4

func (vo UnixTime) Int64() int64

func (UnixTime) IsBetween added in v0.0.6

func (vo UnixTime) IsBetween(startDate, endDate UnixTime) bool

func (UnixTime) IsFuture added in v0.0.4

func (vo UnixTime) IsFuture() bool

func (UnixTime) IsPast added in v0.0.4

func (vo UnixTime) IsPast() bool

func (UnixTime) ReadAsGoTime added in v0.0.4

func (vo UnixTime) ReadAsGoTime() time.Time

func (UnixTime) ReadDateOnly added in v0.0.4

func (vo UnixTime) ReadDateOnly() string

func (UnixTime) ReadDateTime added in v0.0.4

func (ut UnixTime) ReadDateTime() string

func (UnixTime) ReadEndOfDay added in v0.0.4

func (ut UnixTime) ReadEndOfDay() time.Time

func (UnixTime) ReadRfcDate added in v0.0.4

func (vo UnixTime) ReadRfcDate() string

func (UnixTime) ReadStartOfDay added in v0.0.4

func (ut UnixTime) ReadStartOfDay() time.Time

func (UnixTime) ReadTimeOnly added in v0.0.4

func (vo UnixTime) ReadTimeOnly() string

func (UnixTime) String added in v0.0.4

func (vo UnixTime) String() string

type UnixUserId added in v0.0.8

type UnixUserId uint64

func NewUnixUserId added in v0.0.8

func NewUnixUserId(value any) (unixUserId UnixUserId, err error)

func (UnixUserId) String added in v0.0.8

func (vo UnixUserId) String() string

func (UnixUserId) Uint64 added in v0.0.8

func (vo UnixUserId) Uint64() uint64

type UnixUsername added in v0.0.8

type UnixUsername string

func NewUnixUsername added in v0.0.8

func NewUnixUsername(value any) (unixUsername UnixUsername, err error)

func (UnixUsername) String added in v0.0.8

func (vo UnixUsername) String() string

type Url added in v0.0.8

type Url string

func NewUrl added in v0.0.8

func NewUrl(value any) (url Url, err error)

func (Url) String added in v0.0.8

func (vo Url) String() string

type UrlPath added in v0.0.8

type UrlPath string

func NewUrlPath added in v0.0.8

func NewUrlPath(value any) (urlPath UrlPath, err error)

func (UrlPath) ReadQuery added in v0.0.8

func (vo UrlPath) ReadQuery() string

func (UrlPath) ReadWithoutQuery added in v0.0.8

func (vo UrlPath) ReadWithoutQuery() string

func (UrlPath) ReadWithoutTrailingSlash added in v0.0.8

func (vo UrlPath) ReadWithoutTrailingSlash() string

func (UrlPath) String added in v0.0.8

func (vo UrlPath) String() string

type UserAgent added in v0.1.8

type UserAgent string

func NewUserAgent added in v0.1.8

func NewUserAgent(value any) (userAgent UserAgent, err error)

func (UserAgent) String added in v0.1.8

func (vo UserAgent) String() string

type WeakPassword added in v0.1.2

type WeakPassword string

WeakPassword is only for backward compatibility with old code or when the password being validated is outside the control of your application (e.g. a password from an external service). If possible, never use this type and instead use Password which provides stronger validation policies.

func NewWeakPassword added in v0.1.2

func NewWeakPassword(value any) (weakPassword WeakPassword, err error)

func (WeakPassword) String added in v0.1.2

func (vo WeakPassword) String() string

type ZipCode added in v0.0.8

type ZipCode string

func NewZipCode added in v0.0.8

func NewZipCode(value any) (ZipCode, error)

func (ZipCode) String added in v0.0.8

func (vo ZipCode) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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