persistence

package
v0.0.0-...-4caf56c Latest Latest
Warning

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

Go to latest
Published: May 2, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contact

type Contact struct {
	ID        int       `gorm:"AUTO_INCREMENT;column:contact_id"`
	Name      string    `gorm:"type:text;not_null"`
	Email     string    `gorm:"type:text;not_null"`
	BirthDate time.Time `gorm:"type:TIMESTAMP;not null;"`
}

func (Contact) GetBirthDate

func (c Contact) GetBirthDate() time.Time

func (Contact) GetEmail

func (c Contact) GetEmail() string

func (Contact) GetId

func (c Contact) GetId() int

func (Contact) GetName

func (c Contact) GetName() string

type ContactRepository

type ContactRepository interface {
	FindAll() ([]Contact, error)
	Get(id int) (Contact, error)
	Create(contact Contact) (int, error)
	Update(contact Contact) error
	Delete(id int) error
	FindByEmail(email string) (Contact, error)
}

func NewContactSqlRepository

func NewContactSqlRepository(conn string) (ContactRepository, error)

Jump to

Keyboard shortcuts

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