models

package
v2.1.1770+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type ArrayFields

type ArrayFields struct {
	IntArrayField    []int    `json:"int_array_field"`
	StringArrayField []string `json:"string_array_field"`
}

func (ArrayFields) MarshalJSON

func (obj ArrayFields) MarshalJSON() ([]byte, error)

func (*ArrayFields) UnmarshalJSON

func (obj *ArrayFields) UnmarshalJSON(data []byte) error

type Choice

type Choice string
const (
	ChoiceFirstChoice  Choice = "One"
	ChoiceSecondChoice Choice = "Two"
	ChoiceThirdChoice  Choice = "Three"
)

func (*Choice) UnmarshalJSON

func (self *Choice) UnmarshalJSON(b []byte) error

type EnumFields

type EnumFields struct {
	EnumField Choice `json:"enum_field"`
}

func (EnumFields) MarshalJSON

func (obj EnumFields) MarshalJSON() ([]byte, error)

func (*EnumFields) UnmarshalJSON

func (obj *EnumFields) UnmarshalJSON(data []byte) error

type MapFields

type MapFields struct {
	IntMapField    map[string]int    `json:"int_map_field"`
	StringMapField map[string]string `json:"string_map_field"`
}

func (MapFields) MarshalJSON

func (obj MapFields) MarshalJSON() ([]byte, error)

func (*MapFields) UnmarshalJSON

func (obj *MapFields) UnmarshalJSON(data []byte) error

type Message

type Message struct {
	Field int `json:"field"`
}

func (Message) MarshalJSON

func (obj Message) MarshalJSON() ([]byte, error)

func (*Message) UnmarshalJSON

func (obj *Message) UnmarshalJSON(data []byte) error

type MessageCases

type MessageCases struct {
	SnakeCase string `json:"snake_case"`
	CamelCase string `json:"camelCase"`
}

func (MessageCases) MarshalJSON

func (obj MessageCases) MarshalJSON() ([]byte, error)

func (*MessageCases) UnmarshalJSON

func (obj *MessageCases) UnmarshalJSON(data []byte) error

type NonNumericFields

type NonNumericFields struct {
	BooleanField  bool           `json:"boolean_field"`
	StringField   string         `json:"string_field"`
	UuidField     uuid.UUID      `json:"uuid_field"`
	DateField     civil.Date     `json:"date_field"`
	DatetimeField civil.DateTime `json:"datetime_field"`
}

func (NonNumericFields) MarshalJSON

func (obj NonNumericFields) MarshalJSON() ([]byte, error)

func (*NonNumericFields) UnmarshalJSON

func (obj *NonNumericFields) UnmarshalJSON(data []byte) error

type NumericFields

type NumericFields struct {
	IntField     int             `json:"int_field"`
	LongField    int64           `json:"long_field"`
	FloatField   float32         `json:"float_field"`
	DoubleField  float64         `json:"double_field"`
	DecimalField decimal.Decimal `json:"decimal_field"`
}

func (NumericFields) MarshalJSON

func (obj NumericFields) MarshalJSON() ([]byte, error)

func (*NumericFields) UnmarshalJSON

func (obj *NumericFields) UnmarshalJSON(data []byte) error

type OptionalFields

type OptionalFields struct {
	IntOptionField    *int    `json:"int_option_field,omitempty"`
	StringOptionField *string `json:"string_option_field,omitempty"`
}

func (OptionalFields) MarshalJSON

func (obj OptionalFields) MarshalJSON() ([]byte, error)

func (*OptionalFields) UnmarshalJSON

func (obj *OptionalFields) UnmarshalJSON(data []byte) error

type OrderCanceled

type OrderCanceled struct {
	Id uuid.UUID `json:"id"`
}

func (OrderCanceled) MarshalJSON

func (obj OrderCanceled) MarshalJSON() ([]byte, error)

func (*OrderCanceled) UnmarshalJSON

func (obj *OrderCanceled) UnmarshalJSON(data []byte) error

type OrderChanged

type OrderChanged struct {
	Id       uuid.UUID `json:"id"`
	Quantity int       `json:"quantity"`
}

func (OrderChanged) MarshalJSON

func (obj OrderChanged) MarshalJSON() ([]byte, error)

func (*OrderChanged) UnmarshalJSON

func (obj *OrderChanged) UnmarshalJSON(data []byte) error

type OrderCreated

type OrderCreated struct {
	Id       uuid.UUID `json:"id"`
	Sku      string    `json:"sku"`
	Quantity int       `json:"quantity"`
}

func (OrderCreated) MarshalJSON

func (obj OrderCreated) MarshalJSON() ([]byte, error)

func (*OrderCreated) UnmarshalJSON

func (obj *OrderCreated) UnmarshalJSON(data []byte) error

type OrderEventDiscriminator

type OrderEventDiscriminator struct {
	Created  *OrderCreated
	Changed  *OrderChanged
	Canceled *OrderCanceled
}

func (OrderEventDiscriminator) MarshalJSON

func (u OrderEventDiscriminator) MarshalJSON() ([]byte, error)

func (*OrderEventDiscriminator) UnmarshalJSON

func (u *OrderEventDiscriminator) UnmarshalJSON(data []byte) error

type OrderEventWrapper

type OrderEventWrapper struct {
	Created  *OrderCreated  `json:"created,omitempty"`
	Changed  *OrderChanged  `json:"changed,omitempty"`
	Canceled *OrderCanceled `json:"canceled,omitempty"`
}

func (OrderEventWrapper) MarshalJSON

func (u OrderEventWrapper) MarshalJSON() ([]byte, error)

func (*OrderEventWrapper) UnmarshalJSON

func (u *OrderEventWrapper) UnmarshalJSON(data []byte) error

type Parent

type Parent struct {
	Field  string  `json:"field"`
	Nested Message `json:"nested"`
}

func (Parent) MarshalJSON

func (obj Parent) MarshalJSON() ([]byte, error)

func (*Parent) UnmarshalJSON

func (obj *Parent) UnmarshalJSON(data []byte) error

type RawJsonField

type RawJsonField struct {
	JsonField json.RawMessage `json:"json_field"`
}

func (RawJsonField) MarshalJSON

func (obj RawJsonField) MarshalJSON() ([]byte, error)

func (*RawJsonField) UnmarshalJSON

func (obj *RawJsonField) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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