contact

package
v0.0.0-...-fd9b9a1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity struct {
	UUID    string    `json:"uuid" bson:"_id,omitempty"`
	Subject string    `json:"subject" bson:"subject"`
	Email   string    `json:"email" bson:"email"`
	Message string    `json:"message" bson:"message"`
	IsRead  *bool     `json:"is_read" bson:"is_read"`
	Date    time.Time `json:"date" bson:"date"`
}

type Errors

type Errors interface {
	Failed(string) *i18np.Error
	InvalidUUID() *i18np.Error
}

type Factory

type Factory struct {
	Errors Errors
}

func NewFactory

func NewFactory() Factory

func (Factory) IsZero

func (f Factory) IsZero() bool

func (Factory) New

func (f Factory) New(cnf NewConfig) *Entity

type FilterEntity

type FilterEntity struct {
	Query string `query:"q,omitempty" validate:"omitempty,max=100"`
}

type NewConfig

type NewConfig struct {
	Subject string `json:"subject"`
	Email   string `json:"email"`
	Message string `json:"message"`
}

type Repository

type Repository interface {
	Create(ctx context.Context, entity *Entity) *i18np.Error
	Read(ctx context.Context, id string) *i18np.Error
	List(ctx context.Context, filter FilterEntity, listConfig list.Config) (*list.Result[*Entity], *i18np.Error)
}

func NewRepo

func NewRepo(collection *mongo.Collection, factory Factory) Repository

Jump to

Keyboard shortcuts

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