types

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomBool

type CustomBool bool

CustomBool allows a JSON boolean value to also be an integer.

func (CustomBool) MarshalJSON

func (r CustomBool) MarshalJSON() ([]byte, error)

MarshalJSON converts a boolean to a JSON value.

func (CustomBool) Pointer

func (r CustomBool) Pointer() *CustomBool

Pointer returns a pointers.

func (*CustomBool) PointerBool

func (r *CustomBool) PointerBool() *bool

PointerBool returns a pointer to a boolean.

func (*CustomBool) UnmarshalJSON

func (r *CustomBool) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a JSON value to a boolean.

type CustomCommaSeparatedList

type CustomCommaSeparatedList []string

CustomCommaSeparatedList allows a JSON string to also be a string array.

func (*CustomCommaSeparatedList) MarshalJSON

func (r *CustomCommaSeparatedList) MarshalJSON() ([]byte, error)

MarshalJSON converts a boolean to a JSON value.

func (*CustomCommaSeparatedList) UnmarshalJSON

func (r *CustomCommaSeparatedList) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a JSON value to a boolean.

type CustomInt

type CustomInt int

CustomInt allows a JSON integer value to also be a string.

func (*CustomInt) UnmarshalJSON

func (r *CustomInt) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a JSON value to an integer.

type CustomLineBreakSeparatedList

type CustomLineBreakSeparatedList []string

CustomLineBreakSeparatedList allows a multiline JSON string to also be a string array.

func (*CustomLineBreakSeparatedList) MarshalJSON

func (r *CustomLineBreakSeparatedList) MarshalJSON() ([]byte, error)

MarshalJSON converts a boolean to a JSON value.

func (*CustomLineBreakSeparatedList) UnmarshalJSON

func (r *CustomLineBreakSeparatedList) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a JSON value to a boolean.

type CustomPrivileges

type CustomPrivileges []string

CustomPrivileges allows a JSON object of privileges to also be a string array.

func (*CustomPrivileges) MarshalJSON

func (r *CustomPrivileges) MarshalJSON() ([]byte, error)

MarshalJSON converts a boolean to a JSON value.

func (*CustomPrivileges) UnmarshalJSON

func (r *CustomPrivileges) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a JSON value to a boolean.

type CustomTimestamp

type CustomTimestamp time.Time

CustomTimestamp allows a JSON boolean value to also be a unix timestamp.

func (CustomTimestamp) MarshalJSON

func (r CustomTimestamp) MarshalJSON() ([]byte, error)

MarshalJSON converts a timestamp to a JSON value.

func (*CustomTimestamp) UnmarshalJSON

func (r *CustomTimestamp) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a JSON value to a timestamp.

type IPAddrType

type IPAddrType struct {
	basetypes.StringType
}

IPAddrType is a type that represents an IP address.

func (IPAddrType) Equal

func (t IPAddrType) Equal(o attr.Type) bool

Equal returns true if the two types are equal.

func (IPAddrType) String

func (t IPAddrType) String() string

String returns a string representation of the type.

func (IPAddrType) Validate

func (t IPAddrType) Validate(_ context.Context, value tftypes.Value, valuePath path.Path) diag.Diagnostics

Validate ensures the value is valid IP address.

func (IPAddrType) ValueFromString

ValueFromString converts a string value to a StringValuable.

func (IPAddrType) ValueFromTerraform

func (t IPAddrType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

ValueFromTerraform converts a Terraform value to a StringValuable.

func (IPAddrType) ValueType

func (t IPAddrType) ValueType(_ context.Context) attr.Value

ValueType returns the underlying value type.

type IPAddrValue

type IPAddrValue struct {
	basetypes.StringValue
}

IPAddrValue is a type that represents an IP address value.

func NewIPAddrPointerValue

func NewIPAddrPointerValue(value *string) IPAddrValue

NewIPAddrPointerValue returns a new IPAddrValue from a string pointer.

func (IPAddrValue) Equal

func (v IPAddrValue) Equal(o attr.Value) bool

Equal returns true if the two values are equal.

func (IPAddrValue) Type

func (v IPAddrValue) Type(_ context.Context) attr.Type

Type returns the type of the value.

type IPCIDRType

type IPCIDRType struct {
	basetypes.StringType
}

IPCIDRType is a type that represents an IP address in CIDR notation.

func (IPCIDRType) Equal

func (t IPCIDRType) Equal(o attr.Type) bool

Equal returns true if the two types are equal.

func (IPCIDRType) String

func (t IPCIDRType) String() string

String returns a string representation of the type.

func (IPCIDRType) Validate

func (t IPCIDRType) Validate(_ context.Context, value tftypes.Value, valuePath path.Path) diag.Diagnostics

Validate ensures the value is valid IP address in CIDR notation.

func (IPCIDRType) ValueFromString

ValueFromString converts a string value to a StringValuable.

func (IPCIDRType) ValueFromTerraform

func (t IPCIDRType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

ValueFromTerraform converts a Terraform value to a StringValuable.

func (IPCIDRType) ValueType

func (t IPCIDRType) ValueType(_ context.Context) attr.Value

ValueType returns the underlying value type.

type IPCIDRValue

type IPCIDRValue struct {
	basetypes.StringValue
}

IPCIDRValue is a type that represents an IP address in CIDR notation.

func NewIPCIDRPointerValue

func NewIPCIDRPointerValue(value *string) IPCIDRValue

NewIPCIDRPointerValue returns a new IPCIDRValue from a string pointer.

func (IPCIDRValue) Equal

func (v IPCIDRValue) Equal(o attr.Value) bool

Equal returns true if the two values are equal.

func (IPCIDRValue) Type

func (v IPCIDRValue) Type(_ context.Context) attr.Type

Type returns the type of the value.

Jump to

Keyboard shortcuts

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