service

package
v0.0.0-...-d933f62 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package service implement the services required by the rest package

Package service implement the services required by the rest package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(repo RepoInterface) *service

New return a new service instance

Types

type Entity

type Entity struct {
	gorm.Model
	PublicId          string `gorm:"UNIQUE;NOT NULL"`
	FirstName         string
	LastName          string
	ProfilePictureUrl string
	Birthday          *time.Time
	OrderAmount       uint
	UserID            uint
}

Entity is the model of a profile in the database

func (Entity) TableName

func (Entity) TableName() string

TableName allow to gives a specific name to the profile table

type RepoInterface

type RepoInterface interface {
	Create(profile Entity) bool
	FindByID(id uint) (profile Entity, err error)
	FindByPublicId(publicId string) (profile Entity, err error)
	Update(profile Entity) error
	Delete(profile Entity) error
}

RepoInterface is the model for the repo package of profile

Jump to

Keyboard shortcuts

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