serialize

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttachedFile

type AttachedFile struct {
	Name string `json:"name"`
	Size int    `json:"size"`
	Url  string `json:"url"`
}

type Mail

type Mail struct {
	CreatedAt     time.Time           `json:"createdAt"`
	FromAddresses []MailAddress       `json:"fromAddresses"`
	ToAddresses   []MailAddress       `json:"toAddresses"`
	CcAddresses   []MailAddress       `json:"ccAddresses"`
	BccAddresses  []MailAddress       `json:"bccAddresses"`
	Subject       string              `json:"subject"`
	MessageID     string              `json:"messageId"`
	ContentType   string              `json:"contentType"`
	Text          string              `json:"text"`
	HTML          string              `json:"html"`
	ExtraHeaders  map[string][]string `json:"extraHeaders"`
	AttachedFiles []AttachedFile      `json:"attachedFiles"`
}

func NewMail

func NewMail(m model.Mail, baseUrl string) (mail Mail, err error)

type MailAddress

type MailAddress struct {
	Address string `json:"address"`
	Name    string `json:"name"`
}

type Metadata

type Metadata struct {
	Page Page `json:"page"`
}

type Page

type Page struct {
	Current    int   `json:"current"`
	Per        int   `json:"per"`
	Total      int64 `json:"total"`
	TotalPages int   `json:"totalPages"`
}

type Pagination

type Pagination[T any] struct {
	Metadata Metadata `json:"_metadata"`
	Records  []T      `json:"records"`
}

func NewPagination

func NewPagination[T any](records []T, page int, per int, total int64) (p Pagination[T])

Jump to

Keyboard shortcuts

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