dto

package
v0.0.2-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mapper

type Mapper struct{}

func NewMapper

func NewMapper() *Mapper

NewMapper constructs a new instance of type Mapper

func (Mapper) ShootNew

func (m Mapper) ShootNew()

ShootNew exists solely to fulfill the NewShooter interface contract

func (Mapper) TimeToDateTime

func (Mapper) TimeToDateTime(t time.Time) timex.DateTime

type Message

type Message struct {
	Mapper
	ID        string
	CreatedAt timex.DateTime
	Version   string
	Topic     string
	Group     string
	Status    enum.Status
	Headers   string
	Payload   string
	Retries   int
}

func NewMessage

func NewMessage(id string, createdAt timex.DateTime, version string, topic string, group string, status enum.Status, headers string, payload string, retries int) *Message

NewMessage constructs a new instance of type Message

func (*Message) FromEntity

func (m *Message) FromEntity(envelope_ *entity.Envelope) *Message

FromEntity reads from type entity.Envelope, then writes back to receiver and returns it

func (Message) MarshalJSON

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

MarshalJSON serializes type Message to json bytes

func (Message) ShootMap

func (m Message) ShootMap()

ShootMap exists solely to fulfill the MapShooter interface contract

func (Message) ShootNew

func (m Message) ShootNew()

ShootNew exists solely to fulfill the NewShooter interface contract

func (*Message) UnmarshalJSON

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

UnmarshalJSON deserializes json bytes to type Message

type Meta

type Meta struct {
	Typ     enum.MetaType `json:"type"`
	Plugin  enum.PluginType
	Version string
}

func NewMeta

func NewMeta(typ enum.MetaType, plugin enum.PluginType, version string) *Meta

NewMeta constructs a new instance of type Meta

func (Meta) MarshalJSON

func (m Meta) MarshalJSON() ([]byte, error)

MarshalJSON serializes type Meta to json bytes

func (Meta) ShootNew

func (m Meta) ShootNew()

ShootNew exists solely to fulfill the NewShooter interface contract

func (*Meta) UnmarshalJSON

func (m *Meta) UnmarshalJSON(data []byte) error

UnmarshalJSON deserializes json bytes to type Meta

type PagedResult

type PagedResult[T any] struct {
	Data       []T
	Pagination *entity.Pagination
}

func NewPagedResult

func NewPagedResult[T any](data []T, pagination *entity.Pagination) *PagedResult[T]

NewPagedResult[T any] constructs a new instance of type PagedResult[T]

func (PagedResult[T]) MarshalJSON

func (p PagedResult[T]) MarshalJSON() ([]byte, error)

MarshalJSON serializes type PagedResult[T] to json bytes

func (PagedResult[T]) ShootNew

func (p PagedResult[T]) ShootNew()

ShootNew exists solely to fulfill the NewShooter interface contract

func (*PagedResult[T]) UnmarshalJSON

func (p *PagedResult[T]) UnmarshalJSON(data []byte) error

UnmarshalJSON deserializes json bytes to type PagedResult[T]

Jump to

Keyboard shortcuts

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