Values

Technical reference of Valores.


Symbols

SymbolClassDescription
HTMLtypeIt represents reliable HTML within the GOX transport.
EmailtypeEmail defines a public type of API.
NewEmailfuncBuild NewEmail.
Email.AddressfuncAdd Address.
Email.UsernamefuncReturns the local part of the address.
Email.DomainfuncReturns the address domain.
Email.StringfuncReturns the full textual representation.
Email.IsZerofuncIndicates the state of IsZero.
Email.CheckMXfuncCheck if the domain publishes MX records.
WritertypeWrite Writer.

HTML

HTML represents reliable HTML content transmitted by GOX.

gox
type HTML string

It is not a semantic type of handler and does not replace gox.Component. When sent to JavaScript, the client reconstructs the content as HTMLElement or DocumentFragment.

String()

gox
func (value HTML) String() string

Returns HTML content as string.

Bytes()

gox
func (value HTML) Bytes() []byte

Returns a copy of the content represented as bytes.


Email

Declaration:

gox
type Email struct {
	// contiene campos internos
}

Email defines a public type of API.


NewEmail

Declaration:

gox
func NewEmail(address string) (Email, error)

Build NewEmail.

Parameters

ParameterTypeDescription
addressstringType value string required by the operation.

Returns

ReturnTypeDescription
valueEmailType value Email produced by the operation.
errerrornil if the operation ends correctly; otherwise, the error produced.

Behavior

The operation returns an error when it cannot complete the above contract.

Errors

NewEmail returns an error when the arguments, the status of the receiver or the underlying operation make it impossible to complete the call.

Usage syntax

gox
value, err := gox.NewEmail("[email protected]")

Email.Address

Declaration:

gox
func (e Email) Address() string

Add Address.

Returns

ReturnTypeDescription
valuestringTextual value produced by the operation; its zero value is an empty string.

Usage syntax

gox
value := email.Address()

Email.Username

Declaration:

gox
func (e Email) Username() string

Returns the local part of the address.

Returns

ReturnTypeDescription
valuestringTextual value produced by the operation; its zero value is an empty string.

Usage syntax

gox
value := email.Username()

Email.Domain

Declaration:

gox
func (e Email) Domain() string

Returns the address domain.

Returns

ReturnTypeDescription
valuestringTextual value produced by the operation; its zero value is an empty string.

Usage syntax

gox
value := email.Domain()

Email.String

Declaration:

gox
func (e Email) String() string

Returns the full textual representation.

Returns

ReturnTypeDescription
valuestringTextual value produced by the operation; its zero value is an empty string.

Usage syntax

gox
value := email.String()

Email.IsZero

Declaration:

gox
func (e Email) IsZero() bool

Indicates the state of IsZero.

Returns

ReturnTypeDescription
valueboolIt indicates the result of the check.

Behavior

It does not open or consume the content.

Usage syntax

gox
value := email.IsZero()

Email.CheckMX

Declaration:

gox
func (e Email) CheckMX(ctx context.Context) (bool, error)

Check if the domain publishes MX records.

Parameters

ParameterTypeDescription
ctxcontext.ContextContext of execution.

Returns

ReturnTypeDescription
valueboolIt indicates the result of the check.
errerrornil if the operation ends correctly; otherwise, the error produced.

Behavior

The operation returns an error when it cannot complete the above contract.

Errors

CheckMX returns an error when the arguments, the status of the receiver or the underlying operation make it impossible to complete the call.

Usage syntax

gox
value, err := email.CheckMX(ctx)

Writer

Declaration:

gox
type Writer interface {
	io.Writer

	WriteTextString(value string)
	WriteRawString(value string)
	WriteTextBytes(value []byte)
	WriteRawBytes(value []byte)
	WriteBytes(value []byte)
	WriteByte(value byte)
	WriteStream(value io.Reader)
	WriteError(value error)
	WriteTextBool(value bool)
	WriteRawBool(value bool)
	WriteTextInt(value int)
	WriteRawInt(value int)
	WriteTextInt8(value int8)
	WriteRawInt8(value int8)
	WriteTextInt16(value int16)
	WriteRawInt16(value int16)
	WriteTextInt32(value int32)
	WriteRawInt32(value int32)
	WriteTextInt64(value int64)
	WriteRawInt64(value int64)
	WriteTextUint(value uint)
	WriteRawUint(value uint)
	WriteTextUint8(value uint8)
	WriteRawUint8(value uint8)
	WriteTextUint16(value uint16)
	WriteRawUint16(value uint16)
	WriteTextUint32(value uint32)
	WriteRawUint32(value uint32)
	WriteTextUint64(value uint64)
	WriteRawUint64(value uint64)
	WriteTextUintptr(value uintptr)
	WriteRawUintptr(value uintptr)
	WriteTextFloat32(value float32)
	WriteRawFloat32(value float32)
	WriteTextFloat64(value float64)
	WriteRawFloat64(value float64)
	WriteTextBigInt(value *big.Int)
	WriteRawBigInt(value *big.Int)
	WriteTextBigIntValue(value big.Int)
	WriteRawBigIntValue(value big.Int)
	WriteTextBigFloat(value *big.Float)
	WriteRawBigFloat(value *big.Float)
	WriteTextBigFloatValue(value big.Float)
	WriteRawBigFloatValue(value big.Float)
	WriteTextBigRat(value *big.Rat)
	WriteRawBigRat(value *big.Rat)
	WriteTextBigRatValue(value big.Rat)
	WriteRawBigRatValue(value big.Rat)
	WriteTextAny(value any)
	WriteRawAny(value any)
	WriteSpreadAttrs(attrs map[string]string)
}

Write Writer.

Next step

Continue with Generic middleware contract.

Middleware