Documentation ¶
Index ¶
- Variables
- func NewJSONImageData(in []byte) (ImageData, error)
- type ImageDataImpl
- func (i *ImageDataImpl) AspectRatio() lib.AspectRatio
- func (i *ImageDataImpl) Close() error
- func (i *ImageDataImpl) Format() ImageFormat
- func (i *ImageDataImpl) Height() uint16
- func (i *ImageDataImpl) MarshalJSON() ([]byte, error)
- func (i *ImageDataImpl) String() (string, error)
- func (i *ImageDataImpl) UnmarshalJSON(in []byte) error
- func (i *ImageDataImpl) Width() uint16
- type NullContainer
- type NullableActivityAssets
- func (i NullableActivityAssets) Get() discord.ActivityAssets
- func (i NullableActivityAssets) IsNotNull() bool
- func (i NullableActivityAssets) IsNull() bool
- func (i *NullableActivityAssets) MarshalJSON() ([]byte, error)
- func (i *NullableActivityAssets) Set(val discord.ActivityAssets) NullableField
- func (i *NullableActivityAssets) SetNull() NullableField
- func (i *NullableActivityAssets) UnmarshalJSON(bytes []byte) error
- type NullableActivityEmoji
- func (i NullableActivityEmoji) Get() discord.ActivityEmoji
- func (i NullableActivityEmoji) IsNotNull() bool
- func (i NullableActivityEmoji) IsNull() bool
- func (i *NullableActivityEmoji) MarshalJSON() ([]byte, error)
- func (i *NullableActivityEmoji) Set(val discord.ActivityEmoji) NullableField
- func (i *NullableActivityEmoji) SetNull() NullableField
- func (i *NullableActivityEmoji) UnmarshalJSON(bytes []byte) error
- type NullableActivityParty
- func (i NullableActivityParty) Get() discord.ActivityParty
- func (i NullableActivityParty) IsNotNull() bool
- func (i NullableActivityParty) IsNull() bool
- func (i *NullableActivityParty) MarshalJSON() ([]byte, error)
- func (i *NullableActivityParty) Set(val discord.ActivityParty) NullableField
- func (i *NullableActivityParty) SetNull() NullableField
- func (i *NullableActivityParty) UnmarshalJSON(bytes []byte) error
- type NullableActivitySecrets
- func (i NullableActivitySecrets) Get() discord.ActivitySecrets
- func (i NullableActivitySecrets) IsNotNull() bool
- func (i NullableActivitySecrets) IsNull() bool
- func (i *NullableActivitySecrets) MarshalJSON() ([]byte, error)
- func (i *NullableActivitySecrets) Set(val discord.ActivitySecrets) NullableField
- func (i *NullableActivitySecrets) SetNull() NullableField
- func (i *NullableActivitySecrets) UnmarshalJSON(bytes []byte) error
- type NullableAny
- func (i NullableAny) Get() interface{}
- func (i NullableAny) IsNotNull() bool
- func (i NullableAny) IsNull() bool
- func (i *NullableAny) MarshalJSON() ([]byte, error)
- func (i *NullableAny) Set(val interface{}) NullableField
- func (i *NullableAny) SetNull() NullableField
- func (i *NullableAny) UnmarshalJSON(bytes []byte) error
- type NullableChannelTopic
- func (i NullableChannelTopic) Get() discord.ChannelTopic
- func (i NullableChannelTopic) IsNotNull() bool
- func (i NullableChannelTopic) IsNull() bool
- func (i *NullableChannelTopic) MarshalJSON() ([]byte, error)
- func (i *NullableChannelTopic) Set(val discord.ChannelTopic) NullableField
- func (i *NullableChannelTopic) SetNull() NullableField
- func (i *NullableChannelTopic) UnmarshalJSON(bytes []byte) error
- type NullableExplicitContentFilterLevel
- func (i NullableExplicitContentFilterLevel) Get() discord.ExplicitContentFilterLevel
- func (i NullableExplicitContentFilterLevel) IsNotNull() bool
- func (i NullableExplicitContentFilterLevel) IsNull() bool
- func (i *NullableExplicitContentFilterLevel) MarshalJSON() ([]byte, error)
- func (i *NullableExplicitContentFilterLevel) Set(val discord.ExplicitContentFilterLevel) NullableField
- func (i *NullableExplicitContentFilterLevel) SetNull() NullableField
- func (i *NullableExplicitContentFilterLevel) UnmarshalJSON(bytes []byte) error
- type NullableField
- type NullableMessageNotificationLevel
- func (i NullableMessageNotificationLevel) Get() discord.MessageNotificationLevel
- func (i NullableMessageNotificationLevel) IsNotNull() bool
- func (i NullableMessageNotificationLevel) IsNull() bool
- func (i *NullableMessageNotificationLevel) MarshalJSON() ([]byte, error)
- func (i *NullableMessageNotificationLevel) Set(val discord.MessageNotificationLevel) NullableField
- func (i *NullableMessageNotificationLevel) SetNull() NullableField
- func (i *NullableMessageNotificationLevel) UnmarshalJSON(bytes []byte) error
- type NullableSnowflake
- func (i NullableSnowflake) Get() discord.Snowflake
- func (i NullableSnowflake) IsNotNull() bool
- func (i NullableSnowflake) IsNull() bool
- func (i *NullableSnowflake) MarshalJSON() ([]byte, error)
- func (i *NullableSnowflake) Set(val discord.Snowflake) NullableField
- func (i *NullableSnowflake) SetNull() NullableField
- func (i *NullableSnowflake) UnmarshalJSON(bytes []byte) error
- type NullableString
- func (i NullableString) Get() string
- func (i NullableString) IsNotNull() bool
- func (i NullableString) IsNull() bool
- func (i *NullableString) MarshalJSON() ([]byte, error)
- func (i *NullableString) Set(val string) NullableField
- func (i *NullableString) SetNull() NullableField
- func (i *NullableString) UnmarshalJSON(bytes []byte) error
- type NullableTime
- func (i NullableTime) Get() time.Time
- func (i NullableTime) IsNotNull() bool
- func (i NullableTime) IsNull() bool
- func (i *NullableTime) MarshalJSON() ([]byte, error)
- func (i *NullableTime) Set(val time.Time) NullableField
- func (i *NullableTime) SetNull() NullableField
- func (i *NullableTime) UnmarshalJSON(bytes []byte) error
- type NullableVerificationLevel
- func (i NullableVerificationLevel) Get() discord.VerificationLevel
- func (i NullableVerificationLevel) IsNotNull() bool
- func (i NullableVerificationLevel) IsNull() bool
- func (i *NullableVerificationLevel) MarshalJSON() ([]byte, error)
- func (i *NullableVerificationLevel) Set(val discord.VerificationLevel) NullableField
- func (i *NullableVerificationLevel) SetNull() NullableField
- func (i *NullableVerificationLevel) UnmarshalJSON(bytes []byte) error
- type OptionContainer
- type OptionalAny
- func (i OptionalAny) Get() interface{}
- func (i OptionalAny) IsSet() bool
- func (i OptionalAny) IsUnset() bool
- func (i *OptionalAny) MarshalJSON() ([]byte, error)
- func (i *OptionalAny) Set(val interface{}) OptionalField
- func (i *OptionalAny) UnmarshalJSON(bytes []byte) error
- func (i *OptionalAny) Unset() OptionalField
- type OptionalBool
- func (i OptionalBool) Get() bool
- func (i OptionalBool) IsSet() bool
- func (i OptionalBool) IsUnset() bool
- func (i *OptionalBool) MarshalJSON() ([]byte, error)
- func (i *OptionalBool) Set(val bool) OptionalField
- func (i *OptionalBool) UnmarshalJSON(bytes []byte) error
- func (i *OptionalBool) Unset() OptionalField
- type OptionalField
- type OptionalSnowflake
- func (i OptionalSnowflake) Get() discord.Snowflake
- func (i OptionalSnowflake) IsSet() bool
- func (i OptionalSnowflake) IsUnset() bool
- func (i *OptionalSnowflake) MarshalJSON() ([]byte, error)
- func (i *OptionalSnowflake) Set(val discord.Snowflake) OptionalField
- func (i *OptionalSnowflake) UnmarshalJSON(bytes []byte) error
- func (i *OptionalSnowflake) Unset() OptionalField
- type OptionalString
- func (i OptionalString) Get() string
- func (i OptionalString) IsSet() bool
- func (i OptionalString) IsUnset() bool
- func (i *OptionalString) MarshalJSON() ([]byte, error)
- func (i *OptionalString) Set(val string) OptionalField
- func (i *OptionalString) UnmarshalJSON(bytes []byte) error
- func (i *OptionalString) Unset() OptionalField
- type OptionalUint16
- func (i OptionalUint16) Get() uint16
- func (i OptionalUint16) IsSet() bool
- func (i OptionalUint16) IsUnset() bool
- func (i *OptionalUint16) MarshalJSON() ([]byte, error)
- func (i *OptionalUint16) Set(val uint16) OptionalField
- func (i *OptionalUint16) UnmarshalJSON(bytes []byte) error
- func (i *OptionalUint16) Unset() OptionalField
- type OptionalUint64
- func (i OptionalUint64) Get() uint64
- func (i OptionalUint64) IsSet() bool
- func (i OptionalUint64) IsUnset() bool
- func (i *OptionalUint64) MarshalJSON() ([]byte, error)
- func (i *OptionalUint64) Set(val uint64) OptionalField
- func (i *OptionalUint64) UnmarshalJSON(bytes []byte) error
- func (i *OptionalUint64) Unset() OptionalField
- type OptionalUint8
- func (i OptionalUint8) Get() uint8
- func (i OptionalUint8) IsSet() bool
- func (i OptionalUint8) IsUnset() bool
- func (i *OptionalUint8) MarshalJSON() ([]byte, error)
- func (i *OptionalUint8) Set(val uint8) OptionalField
- func (i *OptionalUint8) UnmarshalJSON(bytes []byte) error
- func (i *OptionalUint8) Unset() OptionalField
- type OutBuilder
- func (o OutBuilder) AppendNullable(k serial.Key, v NullableField) OutBuilder
- func (o OutBuilder) AppendOptional(k serial.Key, v OptionalField) OutBuilder
- func (o OutBuilder) AppendRaw(k serial.Key, v interface{}) OutBuilder
- func (o OutBuilder) AppendTriState(k serial.Key, v TriStateField) OutBuilder
- type TriStateField
- type TriStateString
- func (i TriStateString) Get() string
- func (i TriStateString) IsNotNull() bool
- func (i TriStateString) IsNull() bool
- func (i TriStateString) IsReadable() bool
- func (i TriStateString) IsSet() bool
- func (i TriStateString) IsUnset() bool
- func (i TriStateString) MarshalJSON() ([]byte, error)
- func (i *TriStateString) Set(val string) TriStateField
- func (i *TriStateString) SetNull() TriStateField
- func (i TriStateString) UnmarshalJSON(bytes []byte) error
- func (i *TriStateString) Unset() TriStateField
- type TriStateUint8
- func (i TriStateUint8) Get() uint8
- func (i TriStateUint8) IsNotNull() bool
- func (i TriStateUint8) IsNull() bool
- func (i TriStateUint8) IsReadable() bool
- func (i TriStateUint8) IsSet() bool
- func (i TriStateUint8) IsUnset() bool
- func (i TriStateUint8) MarshalJSON() ([]byte, error)
- func (i *TriStateUint8) Set(val uint8) TriStateField
- func (i *TriStateUint8) SetNull() TriStateField
- func (i TriStateUint8) UnmarshalJSON(bytes []byte) error
- func (i *TriStateUint8) Unset() TriStateField
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnsetField = errors.New("cannot get a value from an absent field; " + "use the *IsSet method before attempting to unwrap a nullable field") ErrSerializeUnset = errors.New("cannot serialize an absent field") ErrSetNilOptionalVal = errors.New("attempted to set a nil value using an" + " OptionalField's Set method") )
var (
ErrNullField = errors.New("cannot get a value from a null field; use " +
"the *IsNull method before attempting to unwrap a nullable field")
)
var (
ErrSetNilTriStateVal = errors.New("attempted to set a nil value using a" +
" TriStateField's Set method")
)
Functions ¶
func NewJSONImageData ¶
NewJSONImageData constructs an ImageData instance from the given JSON byte slice.
This method is intended to allow creating a new ImageData instance without having a local copy of the image data.
Types ¶
type ImageDataImpl ¶
type ImageDataImpl struct { Input io.ReadSeeker Form ImageFormat X, Y uint16 }
func (*ImageDataImpl) AspectRatio ¶
func (i *ImageDataImpl) AspectRatio() lib.AspectRatio
func (*ImageDataImpl) Close ¶
func (i *ImageDataImpl) Close() error
Close will attempt to close the input io.ReadSeeker instance if it is also an instance of io.Closer.
If the input io.ReadSeeker is not also an instance of io.Closer, then this method will do nothing.
func (*ImageDataImpl) Format ¶
func (i *ImageDataImpl) Format() ImageFormat
func (*ImageDataImpl) Height ¶
func (i *ImageDataImpl) Height() uint16
func (*ImageDataImpl) MarshalJSON ¶
func (i *ImageDataImpl) MarshalJSON() ([]byte, error)
func (*ImageDataImpl) String ¶
func (i *ImageDataImpl) String() (string, error)
func (*ImageDataImpl) UnmarshalJSON ¶
func (i *ImageDataImpl) UnmarshalJSON(in []byte) error
UnmarshalJSON attempts to deserialize a string encoded image data value into the current ImageData instance.
This method may return one of the following library errors:
image.ErrBadImageDataSize = The base64 encoded image data is too small to be a valid image, it may have been truncated by the source. See image.MinPossibleImageString.
image.ErrBadImageDataJsonType = The value passed to this method was not a string.
image.ErrBadImageDataFormat = The given image data string is corrupt or malformed and contains no divider between the prefix and the actual image data.
image.ErrBadImageFormat = The input image data string is not of a type recognized by this library. See image.ImageFormat for the list of allowed types.
image.ErrTypeMismatch = The image format declared in the image data string's prefix does not match the actual type of the base64 encoded image.
In addition to the above errors, this method may return errors from the standard library's `image` or `base64` packages, or any error returned from attempting to close the previous image data held by this ImageData instance.
func (*ImageDataImpl) Width ¶
func (i *ImageDataImpl) Width() uint16
type NullContainer ¶
type NullableActivityAssets ¶
type NullableActivityAssets struct {
// contains filtered or unexported fields
}
func (NullableActivityAssets) Get ¶
func (i NullableActivityAssets) Get() discord.ActivityAssets
Value returns the raw wrapped field value.
This method panics if the field is marked as null.
func (NullableActivityAssets) IsNotNull ¶
func (i NullableActivityAssets) IsNotNull() bool
func (NullableActivityAssets) IsNull ¶
func (i NullableActivityAssets) IsNull() bool
func (*NullableActivityAssets) MarshalJSON ¶
func (i *NullableActivityAssets) MarshalJSON() ([]byte, error)
func (*NullableActivityAssets) Set ¶
func (i *NullableActivityAssets) Set(val discord.ActivityAssets) NullableField
func (*NullableActivityAssets) SetNull ¶
func (i *NullableActivityAssets) SetNull() NullableField
func (*NullableActivityAssets) UnmarshalJSON ¶
func (i *NullableActivityAssets) UnmarshalJSON(bytes []byte) error
type NullableActivityEmoji ¶
type NullableActivityEmoji struct {
// contains filtered or unexported fields
}
func (NullableActivityEmoji) Get ¶
func (i NullableActivityEmoji) Get() discord.ActivityEmoji
Value returns the raw wrapped field value.
This method panics if the field is marked as null.
func (NullableActivityEmoji) IsNotNull ¶
func (i NullableActivityEmoji) IsNotNull() bool
func (NullableActivityEmoji) IsNull ¶
func (i NullableActivityEmoji) IsNull() bool
func (*NullableActivityEmoji) MarshalJSON ¶
func (i *NullableActivityEmoji) MarshalJSON() ([]byte, error)
func (*NullableActivityEmoji) Set ¶
func (i *NullableActivityEmoji) Set(val discord.ActivityEmoji) NullableField
func (*NullableActivityEmoji) SetNull ¶
func (i *NullableActivityEmoji) SetNull() NullableField
func (*NullableActivityEmoji) UnmarshalJSON ¶
func (i *NullableActivityEmoji) UnmarshalJSON(bytes []byte) error
type NullableActivityParty ¶
type NullableActivityParty struct {
// contains filtered or unexported fields
}
func (NullableActivityParty) Get ¶
func (i NullableActivityParty) Get() discord.ActivityParty
Value returns the raw wrapped field value.
This method panics if the field is marked as null.
func (NullableActivityParty) IsNotNull ¶
func (i NullableActivityParty) IsNotNull() bool
func (NullableActivityParty) IsNull ¶
func (i NullableActivityParty) IsNull() bool
func (*NullableActivityParty) MarshalJSON ¶
func (i *NullableActivityParty) MarshalJSON() ([]byte, error)
func (*NullableActivityParty) Set ¶
func (i *NullableActivityParty) Set(val discord.ActivityParty) NullableField
func (*NullableActivityParty) SetNull ¶
func (i *NullableActivityParty) SetNull() NullableField
func (*NullableActivityParty) UnmarshalJSON ¶
func (i *NullableActivityParty) UnmarshalJSON(bytes []byte) error
type NullableActivitySecrets ¶
type NullableActivitySecrets struct {
// contains filtered or unexported fields
}
func (NullableActivitySecrets) Get ¶
func (i NullableActivitySecrets) Get() discord.ActivitySecrets
Value returns the raw wrapped field value.
This method panics if the field is marked as null.
func (NullableActivitySecrets) IsNotNull ¶
func (i NullableActivitySecrets) IsNotNull() bool
func (NullableActivitySecrets) IsNull ¶
func (i NullableActivitySecrets) IsNull() bool
func (*NullableActivitySecrets) MarshalJSON ¶
func (i *NullableActivitySecrets) MarshalJSON() ([]byte, error)
func (*NullableActivitySecrets) Set ¶
func (i *NullableActivitySecrets) Set(val discord.ActivitySecrets) NullableField
func (*NullableActivitySecrets) SetNull ¶
func (i *NullableActivitySecrets) SetNull() NullableField
func (*NullableActivitySecrets) UnmarshalJSON ¶
func (i *NullableActivitySecrets) UnmarshalJSON(bytes []byte) error
type NullableAny ¶
type NullableAny struct {
// contains filtered or unexported fields
}
func (NullableAny) Get ¶
func (i NullableAny) Get() interface{}
Value returns the raw wrapped field value.
This method panics if the field is marked as null.
func (NullableAny) IsNotNull ¶
func (i NullableAny) IsNotNull() bool
func (NullableAny) IsNull ¶
func (i NullableAny) IsNull() bool
func (*NullableAny) MarshalJSON ¶
func (i *NullableAny) MarshalJSON() ([]byte, error)
func (*NullableAny) Set ¶
func (i *NullableAny) Set(val interface{}) NullableField
func (*NullableAny) SetNull ¶
func (i *NullableAny) SetNull() NullableField
func (*NullableAny) UnmarshalJSON ¶
func (i *NullableAny) UnmarshalJSON(bytes []byte) error
type NullableChannelTopic ¶
type NullableChannelTopic struct {
// contains filtered or unexported fields
}
func (NullableChannelTopic) Get ¶
func (i NullableChannelTopic) Get() discord.ChannelTopic
Value returns the raw wrapped field value.
This method panics if the field is marked as null.
func (NullableChannelTopic) IsNotNull ¶
func (i NullableChannelTopic) IsNotNull() bool
func (NullableChannelTopic) IsNull ¶
func (i NullableChannelTopic) IsNull() bool
func (*NullableChannelTopic) MarshalJSON ¶
func (i *NullableChannelTopic) MarshalJSON() ([]byte, error)
func (*NullableChannelTopic) Set ¶
func (i *NullableChannelTopic) Set(val discord.ChannelTopic) NullableField
func (*NullableChannelTopic) SetNull ¶
func (i *NullableChannelTopic) SetNull() NullableField
func (*NullableChannelTopic) UnmarshalJSON ¶
func (i *NullableChannelTopic) UnmarshalJSON(bytes []byte) error
type NullableExplicitContentFilterLevel ¶
type NullableExplicitContentFilterLevel struct {
// contains filtered or unexported fields
}
func (NullableExplicitContentFilterLevel) Get ¶
func (i NullableExplicitContentFilterLevel) Get() discord.ExplicitContentFilterLevel
Value returns the raw wrapped field value.
This method panics if the field is marked as null.
func (NullableExplicitContentFilterLevel) IsNotNull ¶
func (i NullableExplicitContentFilterLevel) IsNotNull() bool
func (NullableExplicitContentFilterLevel) IsNull ¶
func (i NullableExplicitContentFilterLevel) IsNull() bool
func (*NullableExplicitContentFilterLevel) MarshalJSON ¶
func (i *NullableExplicitContentFilterLevel) MarshalJSON() ([]byte, error)
func (*NullableExplicitContentFilterLevel) Set ¶
func (i *NullableExplicitContentFilterLevel) Set(val discord.ExplicitContentFilterLevel) NullableField
func (*NullableExplicitContentFilterLevel) SetNull ¶
func (i *NullableExplicitContentFilterLevel) SetNull() NullableField
func (*NullableExplicitContentFilterLevel) UnmarshalJSON ¶
func (i *NullableExplicitContentFilterLevel) UnmarshalJSON(bytes []byte) error
type NullableField ¶
type NullableField interface { json.Marshaler json.Unmarshaler NullContainer // SetNull sets the current field to null. SetNull() NullableField }
type NullableMessageNotificationLevel ¶
type NullableMessageNotificationLevel struct {
// contains filtered or unexported fields
}
func (NullableMessageNotificationLevel) Get ¶
func (i NullableMessageNotificationLevel) Get() discord.MessageNotificationLevel
Value returns the raw wrapped field value.
This method panics if the field is marked as null.
func (NullableMessageNotificationLevel) IsNotNull ¶
func (i NullableMessageNotificationLevel) IsNotNull() bool
func (NullableMessageNotificationLevel) IsNull ¶
func (i NullableMessageNotificationLevel) IsNull() bool
func (*NullableMessageNotificationLevel) MarshalJSON ¶
func (i *NullableMessageNotificationLevel) MarshalJSON() ([]byte, error)
func (*NullableMessageNotificationLevel) Set ¶
func (i *NullableMessageNotificationLevel) Set(val discord.MessageNotificationLevel) NullableField
func (*NullableMessageNotificationLevel) SetNull ¶
func (i *NullableMessageNotificationLevel) SetNull() NullableField
func (*NullableMessageNotificationLevel) UnmarshalJSON ¶
func (i *NullableMessageNotificationLevel) UnmarshalJSON(bytes []byte) error
type NullableSnowflake ¶
type NullableSnowflake struct {
// contains filtered or unexported fields
}
func (NullableSnowflake) Get ¶
func (i NullableSnowflake) Get() discord.Snowflake
Value returns the raw wrapped field value.
This method panics if the field is marked as null.
func (NullableSnowflake) IsNotNull ¶
func (i NullableSnowflake) IsNotNull() bool
func (NullableSnowflake) IsNull ¶
func (i NullableSnowflake) IsNull() bool
func (*NullableSnowflake) MarshalJSON ¶
func (i *NullableSnowflake) MarshalJSON() ([]byte, error)
func (*NullableSnowflake) Set ¶
func (i *NullableSnowflake) Set(val discord.Snowflake) NullableField
func (*NullableSnowflake) SetNull ¶
func (i *NullableSnowflake) SetNull() NullableField
func (*NullableSnowflake) UnmarshalJSON ¶
func (i *NullableSnowflake) UnmarshalJSON(bytes []byte) error
type NullableString ¶
type NullableString struct {
// contains filtered or unexported fields
}
func (NullableString) Get ¶
func (i NullableString) Get() string
Value returns the raw wrapped field value.
This method panics if the field is marked as null.
func (NullableString) IsNotNull ¶
func (i NullableString) IsNotNull() bool
func (NullableString) IsNull ¶
func (i NullableString) IsNull() bool
func (*NullableString) MarshalJSON ¶
func (i *NullableString) MarshalJSON() ([]byte, error)
func (*NullableString) Set ¶
func (i *NullableString) Set(val string) NullableField
func (*NullableString) SetNull ¶
func (i *NullableString) SetNull() NullableField
func (*NullableString) UnmarshalJSON ¶
func (i *NullableString) UnmarshalJSON(bytes []byte) error
type NullableTime ¶
type NullableTime struct {
// contains filtered or unexported fields
}
func (NullableTime) Get ¶
func (i NullableTime) Get() time.Time
Value returns the raw wrapped field value.
This method panics if the field is marked as null.
func (NullableTime) IsNotNull ¶
func (i NullableTime) IsNotNull() bool
func (NullableTime) IsNull ¶
func (i NullableTime) IsNull() bool
func (*NullableTime) MarshalJSON ¶
func (i *NullableTime) MarshalJSON() ([]byte, error)
func (*NullableTime) Set ¶
func (i *NullableTime) Set(val time.Time) NullableField
func (*NullableTime) SetNull ¶
func (i *NullableTime) SetNull() NullableField
func (*NullableTime) UnmarshalJSON ¶
func (i *NullableTime) UnmarshalJSON(bytes []byte) error
type NullableVerificationLevel ¶
type NullableVerificationLevel struct {
// contains filtered or unexported fields
}
func (NullableVerificationLevel) Get ¶
func (i NullableVerificationLevel) Get() discord.VerificationLevel
Value returns the raw wrapped field value.
This method panics if the field is marked as null.
func (NullableVerificationLevel) IsNotNull ¶
func (i NullableVerificationLevel) IsNotNull() bool
func (NullableVerificationLevel) IsNull ¶
func (i NullableVerificationLevel) IsNull() bool
func (*NullableVerificationLevel) MarshalJSON ¶
func (i *NullableVerificationLevel) MarshalJSON() ([]byte, error)
func (*NullableVerificationLevel) Set ¶
func (i *NullableVerificationLevel) Set(val discord.VerificationLevel) NullableField
func (*NullableVerificationLevel) SetNull ¶
func (i *NullableVerificationLevel) SetNull() NullableField
func (*NullableVerificationLevel) UnmarshalJSON ¶
func (i *NullableVerificationLevel) UnmarshalJSON(bytes []byte) error
type OptionContainer ¶
type OptionalAny ¶
type OptionalAny struct {
// contains filtered or unexported fields
}
func (OptionalAny) Get ¶
func (i OptionalAny) Get() interface{}
Value returns the raw value contained by this field.
If this field is unset, this method will panic.
func (OptionalAny) IsSet ¶
func (i OptionalAny) IsSet() bool
func (OptionalAny) IsUnset ¶
func (i OptionalAny) IsUnset() bool
func (*OptionalAny) MarshalJSON ¶
func (i *OptionalAny) MarshalJSON() ([]byte, error)
func (*OptionalAny) Set ¶
func (i *OptionalAny) Set(val interface{}) OptionalField
func (*OptionalAny) UnmarshalJSON ¶
func (i *OptionalAny) UnmarshalJSON(bytes []byte) error
func (*OptionalAny) Unset ¶
func (i *OptionalAny) Unset() OptionalField
type OptionalBool ¶
type OptionalBool struct {
// contains filtered or unexported fields
}
func (OptionalBool) Get ¶
func (i OptionalBool) Get() bool
Value returns the raw value contained by this field.
If this field is unset, this method will panic.
func (OptionalBool) IsSet ¶
func (i OptionalBool) IsSet() bool
func (OptionalBool) IsUnset ¶
func (i OptionalBool) IsUnset() bool
func (*OptionalBool) MarshalJSON ¶
func (i *OptionalBool) MarshalJSON() ([]byte, error)
func (*OptionalBool) Set ¶
func (i *OptionalBool) Set(val bool) OptionalField
func (*OptionalBool) UnmarshalJSON ¶
func (i *OptionalBool) UnmarshalJSON(bytes []byte) error
func (*OptionalBool) Unset ¶
func (i *OptionalBool) Unset() OptionalField
type OptionalField ¶
type OptionalField interface { json.Marshaler json.Unmarshaler OptionContainer // Unset marks the field as absent. Unset() OptionalField }
type OptionalSnowflake ¶
type OptionalSnowflake struct {
// contains filtered or unexported fields
}
func (OptionalSnowflake) Get ¶
func (i OptionalSnowflake) Get() discord.Snowflake
Value returns the raw value contained by this field.
If this field is unset, this method will panic.
func (OptionalSnowflake) IsSet ¶
func (i OptionalSnowflake) IsSet() bool
func (OptionalSnowflake) IsUnset ¶
func (i OptionalSnowflake) IsUnset() bool
func (*OptionalSnowflake) MarshalJSON ¶
func (i *OptionalSnowflake) MarshalJSON() ([]byte, error)
func (*OptionalSnowflake) Set ¶
func (i *OptionalSnowflake) Set(val discord.Snowflake) OptionalField
func (*OptionalSnowflake) UnmarshalJSON ¶
func (i *OptionalSnowflake) UnmarshalJSON(bytes []byte) error
func (*OptionalSnowflake) Unset ¶
func (i *OptionalSnowflake) Unset() OptionalField
type OptionalString ¶
type OptionalString struct {
// contains filtered or unexported fields
}
func (OptionalString) Get ¶
func (i OptionalString) Get() string
Value returns the raw value contained by this field.
If this field is unset, this method will panic.
func (OptionalString) IsSet ¶
func (i OptionalString) IsSet() bool
func (OptionalString) IsUnset ¶
func (i OptionalString) IsUnset() bool
func (*OptionalString) MarshalJSON ¶
func (i *OptionalString) MarshalJSON() ([]byte, error)
func (*OptionalString) Set ¶
func (i *OptionalString) Set(val string) OptionalField
func (*OptionalString) UnmarshalJSON ¶
func (i *OptionalString) UnmarshalJSON(bytes []byte) error
func (*OptionalString) Unset ¶
func (i *OptionalString) Unset() OptionalField
type OptionalUint16 ¶
type OptionalUint16 struct {
// contains filtered or unexported fields
}
func (OptionalUint16) Get ¶
func (i OptionalUint16) Get() uint16
Value returns the raw value contained by this field.
If this field is unset, this method will panic.
func (OptionalUint16) IsSet ¶
func (i OptionalUint16) IsSet() bool
func (OptionalUint16) IsUnset ¶
func (i OptionalUint16) IsUnset() bool
func (*OptionalUint16) MarshalJSON ¶
func (i *OptionalUint16) MarshalJSON() ([]byte, error)
func (*OptionalUint16) Set ¶
func (i *OptionalUint16) Set(val uint16) OptionalField
func (*OptionalUint16) UnmarshalJSON ¶
func (i *OptionalUint16) UnmarshalJSON(bytes []byte) error
func (*OptionalUint16) Unset ¶
func (i *OptionalUint16) Unset() OptionalField
type OptionalUint64 ¶
type OptionalUint64 struct {
// contains filtered or unexported fields
}
func (OptionalUint64) Get ¶
func (i OptionalUint64) Get() uint64
Value returns the raw value contained by this field.
If this field is unset, this method will panic.
func (OptionalUint64) IsSet ¶
func (i OptionalUint64) IsSet() bool
func (OptionalUint64) IsUnset ¶
func (i OptionalUint64) IsUnset() bool
func (*OptionalUint64) MarshalJSON ¶
func (i *OptionalUint64) MarshalJSON() ([]byte, error)
func (*OptionalUint64) Set ¶
func (i *OptionalUint64) Set(val uint64) OptionalField
func (*OptionalUint64) UnmarshalJSON ¶
func (i *OptionalUint64) UnmarshalJSON(bytes []byte) error
func (*OptionalUint64) Unset ¶
func (i *OptionalUint64) Unset() OptionalField
type OptionalUint8 ¶
type OptionalUint8 struct {
// contains filtered or unexported fields
}
func (OptionalUint8) Get ¶
func (i OptionalUint8) Get() uint8
Value returns the raw value contained by this field.
If this field is unset, this method will panic.
func (OptionalUint8) IsSet ¶
func (i OptionalUint8) IsSet() bool
func (OptionalUint8) IsUnset ¶
func (i OptionalUint8) IsUnset() bool
func (*OptionalUint8) MarshalJSON ¶
func (i *OptionalUint8) MarshalJSON() ([]byte, error)
func (*OptionalUint8) Set ¶
func (i *OptionalUint8) Set(val uint8) OptionalField
func (*OptionalUint8) UnmarshalJSON ¶
func (i *OptionalUint8) UnmarshalJSON(bytes []byte) error
func (*OptionalUint8) Unset ¶
func (i *OptionalUint8) Unset() OptionalField
type OutBuilder ¶
func (OutBuilder) AppendNullable ¶
func (o OutBuilder) AppendNullable(k serial.Key, v NullableField) OutBuilder
func (OutBuilder) AppendOptional ¶
func (o OutBuilder) AppendOptional(k serial.Key, v OptionalField) OutBuilder
func (OutBuilder) AppendRaw ¶
func (o OutBuilder) AppendRaw(k serial.Key, v interface{}) OutBuilder
func (OutBuilder) AppendTriState ¶
func (o OutBuilder) AppendTriState(k serial.Key, v TriStateField) OutBuilder
type TriStateField ¶
type TriStateField interface { json.Marshaler json.Unmarshaler OptionContainer NullContainer // SetNull sets the current field value to null. SetNull() TriStateField // Unset marks the current field as absent. Unset() TriStateField // IsReadable returns true if the current field is set and non-null. IsReadable() bool }
TriStateField represents a field which may be absent, null, or containing a value.
type TriStateString ¶
type TriStateString struct {
// contains filtered or unexported fields
}
TriStateString represents a(n) string field which may be one of 3 states: filled, nil, or absent entirely.
func (TriStateString) Get ¶
func (i TriStateString) Get() string
Get returns the current field value.
If the current field is unset or is null, this method will panic. Check if this method is safe to call by using the IsReadable method.
func (TriStateString) IsNotNull ¶
func (i TriStateString) IsNotNull() bool
IsNotNull returns whether the value of the current field is not nil (JSON null).
This will return false if the field is null or is absent.
func (TriStateString) IsNull ¶
func (i TriStateString) IsNull() bool
IsNull returns whether the value of the current field is nil (JSON null).
This will return false if the field contains a value or is unset.
func (TriStateString) IsReadable ¶
func (i TriStateString) IsReadable() bool
IsReadable returns whether the field is present and readable.
Returns false if the field is unset or is null.
func (TriStateString) IsSet ¶
func (i TriStateString) IsSet() bool
IsSet returns whether the value of the current field is present.
Returns false if the field is absent or is null.
func (TriStateString) IsUnset ¶
func (i TriStateString) IsUnset() bool
IsUnset returns whether the value of the current field is absent/unset.
Returns false if the field contains a value or is null.
func (TriStateString) MarshalJSON ¶
func (i TriStateString) MarshalJSON() ([]byte, error)
MarshalJSON serializes the current field to JSON.
If this field is unset, this method will return an ErrSerializeUnset error.
func (*TriStateString) Set ¶
func (i *TriStateString) Set(val string) TriStateField
Set overwrites the current field value with the given value.
If the type is nillable and a nil value is passed here, this method will panic.
func (*TriStateString) SetNull ¶
func (i *TriStateString) SetNull() TriStateField
SetNull overwrites the current field value with JSON null.
func (TriStateString) UnmarshalJSON ¶
func (i TriStateString) UnmarshalJSON(bytes []byte) error
func (*TriStateString) Unset ¶
func (i *TriStateString) Unset() TriStateField
Unset removes the current field value entirely.
type TriStateUint8 ¶
type TriStateUint8 struct {
// contains filtered or unexported fields
}
TriStateUint8 represents a(n) uint8 field which may be one of 3 states: filled, nil, or absent entirely.
func (TriStateUint8) Get ¶
func (i TriStateUint8) Get() uint8
Get returns the current field value.
If the current field is unset or is null, this method will panic. Check if this method is safe to call by using the IsReadable method.
func (TriStateUint8) IsNotNull ¶
func (i TriStateUint8) IsNotNull() bool
IsNotNull returns whether the value of the current field is not nil (JSON null).
This will return false if the field is null or is absent.
func (TriStateUint8) IsNull ¶
func (i TriStateUint8) IsNull() bool
IsNull returns whether the value of the current field is nil (JSON null).
This will return false if the field contains a value or is unset.
func (TriStateUint8) IsReadable ¶
func (i TriStateUint8) IsReadable() bool
IsReadable returns whether the field is present and readable.
Returns false if the field is unset or is null.
func (TriStateUint8) IsSet ¶
func (i TriStateUint8) IsSet() bool
IsSet returns whether the value of the current field is present.
Returns false if the field is absent or is null.
func (TriStateUint8) IsUnset ¶
func (i TriStateUint8) IsUnset() bool
IsUnset returns whether the value of the current field is absent/unset.
Returns false if the field contains a value or is null.
func (TriStateUint8) MarshalJSON ¶
func (i TriStateUint8) MarshalJSON() ([]byte, error)
MarshalJSON serializes the current field to JSON.
If this field is unset, this method will return an ErrSerializeUnset error.
func (*TriStateUint8) Set ¶
func (i *TriStateUint8) Set(val uint8) TriStateField
Set overwrites the current field value with the given value.
If the type is nillable and a nil value is passed here, this method will panic.
func (*TriStateUint8) SetNull ¶
func (i *TriStateUint8) SetNull() TriStateField
SetNull overwrites the current field value with JSON null.
func (TriStateUint8) UnmarshalJSON ¶
func (i TriStateUint8) UnmarshalJSON(bytes []byte) error
func (*TriStateUint8) Unset ¶
func (i *TriStateUint8) Unset() TriStateField
Unset removes the current field value entirely.