model

package
v0.0.0-...-58191dd Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Customer

type Customer struct {
	Id        int64  `json:"id" bson:"_id"`
	Firstname string `json:"firstname" bson:"firstname"`
	Lastname  string `json:"lastname" bson:"lastname"`
	Email     string `json:"email" bson:"email"`
}

func (*Customer) Merge

func (c *Customer) Merge(updateCustomer UpdateCustomer)

func (*Customer) String

func (c *Customer) String() string

type CustomerRepository

type CustomerRepository interface {
	FindById(ctx context.Context, id int64) (*Customer, error)
	FindByEmail(ctx context.Context, email string) (*Customer, error)
	Create(ctx context.Context, customer Customer) (int64, error)
	Update(ctx context.Context, customer Customer) (bool, error)
	Delete(ctx context.Context, id int64) (bool, error)
}

type Logger

type Logger interface {
	WithFields(map[string]interface{}) Logger
	WithRequestId(context.Context) Logger
	Print(...interface{})
	Debug(...interface{})
	Info(...interface{})
	Warn(...interface{})
	Error(...interface{})
	Fatal(...interface{})
	Panic(...interface{})
	Printf(string, ...interface{})
	Debugf(string, ...interface{})
	Infof(string, ...interface{})
	Warnf(string, ...interface{})
	Errorf(string, ...interface{})
	Fatalf(string, ...interface{})
	Panicf(string, ...interface{})
}

type LoggerFields

type LoggerFields map[string]interface{}

type Seller

type Seller struct {
	Id    int64  `json:"id" bson:"_id" binding:"required"`
	Name  string `json:"name" bson:"name" binding:"required"`
	Email string `json:"email" bson:"email" binding:"required,email"`
}

func (*Seller) Merge

func (s *Seller) Merge(updateSeller UpdateSeller)

func (*Seller) String

func (s *Seller) String() string

type SellerRepository

type SellerRepository interface {
	FindById(ctx context.Context, id int64) (*Seller, error)
	FindByName(ctx context.Context, name string) (*Seller, error)
	Create(ctx context.Context, seller Seller) (int64, error)
	Update(ctx context.Context, seller Seller) (bool, error)
	Delete(ctx context.Context, id int64) (bool, error)
}

type UpdateCustomer

type UpdateCustomer struct {
	Lastname  string `json:"lastname" bson:"lastname" binding:"required"`
	Firstname string `json:"firstname" bson:"firstname" binding:"required"`
	Email     string `json:"email" bson:"email" binding:"required,email"`
}

type UpdateSeller

type UpdateSeller struct {
	Name  string `json:"name" bson:"name" binding:"required"`
	Email string `json:"email" bson:"email" binding:"required,email"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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