contact

package
v0.0.0-...-395d67b Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(d *gorm.DB) error

Init initiates the process

func PreDefinedIndustries

func PreDefinedIndustries() error

Types

type API

type API struct {
	DB *gorm.DB
}

API holds all related api handlers

func NewAPI

func NewAPI(d *gorm.DB) *API

NewAPI creates a new api and insert the database provided in it

func (*API) GetContact

func (a *API) GetContact(c echo.Context) error

GetContact handles get request to return existing contact

func (*API) PostContact

func (a *API) PostContact(c echo.Context) error

PostContact handles post request to create new contact

func (*API) PutContact

func (a *API) PutContact(c echo.Context) error

PutContact handles put request to update the existing contact

type CSInfo

type CSInfo struct {
	*Contact
	Site []site.Site
}

CSInfo struct to hold post request for contact

type Contact

type Contact struct {
	gorm.Model
	FirstName string `gorm:"first_name" json:"first_name,omitempty"`
	LastName  string `gorm:"last_name" json:"last_name,omitempty"`
	Image     string `gorm:"image" json:"image,omitempty"`
	Email     string `gorm:"email" json:"email,omitempty"`
	Phone     string `gorm:"phone" json:"phone,omitempty"`
	CompanyID uint   `gorm:"company_id" json:"company_id,omitempty"`
}

Contact holds api(s)

func NewContact

func NewContact() *Contact

NewContact creates a new model

type Contactinfo

type Contactinfo struct {
	FirstName string `json:"first_name,omitempty" valid:"alphanum,length(2|100),required"`
	LastName  string `json:"last_name,omitempty" valid:"alphanum,length(2|100),required"`
	Email     string `json:"email,omitempty" valid:"email,length(6|255),required"`
	Phone     string `json:"phone,omitempty" valid:"number,length(10|12),required"`
}

Contactinfo struct to hold post request for contact

Jump to

Keyboard shortcuts

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