gor_models_sample: github.com/railstack/gor_models_sample Index | Files

package models

import "github.com/railstack/gor_models_sample"

Package models includes the functions on the model Appointment.

Package models includes the functions on the model Patient.

Package models includes the functions on the model Physician.

Package models includes the functions on the model Picture.

Index

Package Files

db.go gor_appointment.go gor_patient.go gor_physician.go gor_picture.go utils.go

Variables

var DB *sqlx.DB

func AppointmentCount Uses

func AppointmentCount() (c int64, err error)

AppointmentCount get the count of all the Appointment records.

func AppointmentCountWhere Uses

func AppointmentCountWhere(where string, args ...interface{}) (c int64, err error)

AppointmentCountWhere get the count of all the Appointment records with a where clause.

func AppointmentIds Uses

func AppointmentIds() (ids []int64, err error)

AppointmentIds get all the IDs of Appointment records.

func AppointmentIdsWhere Uses

func AppointmentIdsWhere(where string, args ...interface{}) ([]int64, error)

AppointmentIdsWhere get all the IDs of Appointment records by where restriction.

func AppointmentIntCol Uses

func AppointmentIntCol(col, where string, args ...interface{}) (intColRecs []int64, err error)

AppointmentIntCol get some int64 typed column of Appointment by where restriction.

func AppointmentStrCol Uses

func AppointmentStrCol(col, where string, args ...interface{}) (strColRecs []string, err error)

AppointmentStrCol get some string typed column of Appointment by where restriction.

func CreateAppointment Uses

func CreateAppointment(am map[string]interface{}) (int64, error)

CreateAppointment use a named params to create a single Appointment record. A named params is key-value map like map[string]interface{}{"first_name": "John", "age": 23} .

func CreatePatient Uses

func CreatePatient(am map[string]interface{}) (int64, error)

CreatePatient use a named params to create a single Patient record. A named params is key-value map like map[string]interface{}{"first_name": "John", "age": 23} .

func CreatePhysician Uses

func CreatePhysician(am map[string]interface{}) (int64, error)

CreatePhysician use a named params to create a single Physician record. A named params is key-value map like map[string]interface{}{"first_name": "John", "age": 23} .

func CreatePicture Uses

func CreatePicture(am map[string]interface{}) (int64, error)

CreatePicture use a named params to create a single Picture record. A named params is key-value map like map[string]interface{}{"first_name": "John", "age": 23} .

func DestroyAppointment Uses

func DestroyAppointment(id int64) error

DestroyAppointment will destroy a Appointment record specified by the id parameter.

func DestroyAppointments Uses

func DestroyAppointments(ids ...int64) (int64, error)

DestroyAppointments will destroy Appointment records those specified by the ids parameters.

func DestroyAppointmentsWhere Uses

func DestroyAppointmentsWhere(where string, args ...interface{}) (int64, error)

DestroyAppointmentsWhere delete records by a where clause restriction. e.g. DestroyAppointmentsWhere("name = ?", "John") And this func will not call the association dependent action

func DestroyPatient Uses

func DestroyPatient(id int64) error

DestroyPatient will destroy a Patient record specified by the id parameter.

func DestroyPatients Uses

func DestroyPatients(ids ...int64) (int64, error)

DestroyPatients will destroy Patient records those specified by the ids parameters.

func DestroyPatientsWhere Uses

func DestroyPatientsWhere(where string, args ...interface{}) (int64, error)

DestroyPatientsWhere delete records by a where clause restriction. e.g. DestroyPatientsWhere("name = ?", "John") And this func will not call the association dependent action

func DestroyPhysician Uses

func DestroyPhysician(id int64) error

DestroyPhysician will destroy a Physician record specified by the id parameter.

func DestroyPhysicians Uses

func DestroyPhysicians(ids ...int64) (int64, error)

DestroyPhysicians will destroy Physician records those specified by the ids parameters.

func DestroyPhysiciansWhere Uses

func DestroyPhysiciansWhere(where string, args ...interface{}) (int64, error)

DestroyPhysiciansWhere delete records by a where clause restriction. e.g. DestroyPhysiciansWhere("name = ?", "John") And this func will not call the association dependent action

func DestroyPicture Uses

func DestroyPicture(id int64) error

DestroyPicture will destroy a Picture record specified by the id parameter.

func DestroyPictures Uses

func DestroyPictures(ids ...int64) (int64, error)

DestroyPictures will destroy Picture records those specified by the ids parameters.

func DestroyPicturesWhere Uses

func DestroyPicturesWhere(where string, args ...interface{}) (int64, error)

DestroyPicturesWhere delete records by a where clause restriction. e.g. DestroyPicturesWhere("name = ?", "John") And this func will not call the association dependent action

func PatientCount Uses

func PatientCount() (c int64, err error)

PatientCount get the count of all the Patient records.

func PatientCountWhere Uses

func PatientCountWhere(where string, args ...interface{}) (c int64, err error)

PatientCountWhere get the count of all the Patient records with a where clause.

func PatientIds Uses

func PatientIds() (ids []int64, err error)

PatientIds get all the IDs of Patient records.

func PatientIdsWhere Uses

func PatientIdsWhere(where string, args ...interface{}) ([]int64, error)

PatientIdsWhere get all the IDs of Patient records by where restriction.

func PatientIntCol Uses

func PatientIntCol(col, where string, args ...interface{}) (intColRecs []int64, err error)

PatientIntCol get some int64 typed column of Patient by where restriction.

func PatientStrCol Uses

func PatientStrCol(col, where string, args ...interface{}) (strColRecs []string, err error)

PatientStrCol get some string typed column of Patient by where restriction.

func PhysicianCount Uses

func PhysicianCount() (c int64, err error)

PhysicianCount get the count of all the Physician records.

func PhysicianCountWhere Uses

func PhysicianCountWhere(where string, args ...interface{}) (c int64, err error)

PhysicianCountWhere get the count of all the Physician records with a where clause.

func PhysicianIds Uses

func PhysicianIds() (ids []int64, err error)

PhysicianIds get all the IDs of Physician records.

func PhysicianIdsWhere Uses

func PhysicianIdsWhere(where string, args ...interface{}) ([]int64, error)

PhysicianIdsWhere get all the IDs of Physician records by where restriction.

func PhysicianIntCol Uses

func PhysicianIntCol(col, where string, args ...interface{}) (intColRecs []int64, err error)

PhysicianIntCol get some int64 typed column of Physician by where restriction.

func PhysicianStrCol Uses

func PhysicianStrCol(col, where string, args ...interface{}) (strColRecs []string, err error)

PhysicianStrCol get some string typed column of Physician by where restriction.

func PictureCount Uses

func PictureCount() (c int64, err error)

PictureCount get the count of all the Picture records.

func PictureCountWhere Uses

func PictureCountWhere(where string, args ...interface{}) (c int64, err error)

PictureCountWhere get the count of all the Picture records with a where clause.

func PictureIds Uses

func PictureIds() (ids []int64, err error)

PictureIds get all the IDs of Picture records.

func PictureIdsWhere Uses

func PictureIdsWhere(where string, args ...interface{}) ([]int64, error)

PictureIdsWhere get all the IDs of Picture records by where restriction.

func PictureIntCol Uses

func PictureIntCol(col, where string, args ...interface{}) (intColRecs []int64, err error)

PictureIntCol get some int64 typed column of Picture by where restriction.

func PictureStrCol Uses

func PictureStrCol(col, where string, args ...interface{}) (strColRecs []string, err error)

PictureStrCol get some string typed column of Picture by where restriction.

func UpdateAppointment Uses

func UpdateAppointment(id int64, am map[string]interface{}) error

UpdateAppointment is used to update a record with a id and map[string]interface{} typed key-value parameters.

func UpdateAppointmentsBySql Uses

func UpdateAppointmentsBySql(sql string, args ...interface{}) (int64, error)

UpdateAppointmentsBySql is used to update Appointment records by a SQL clause using the '?' binding syntax.

func UpdatePatient Uses

func UpdatePatient(id int64, am map[string]interface{}) error

UpdatePatient is used to update a record with a id and map[string]interface{} typed key-value parameters.

func UpdatePatientsBySql Uses

func UpdatePatientsBySql(sql string, args ...interface{}) (int64, error)

UpdatePatientsBySql is used to update Patient records by a SQL clause using the '?' binding syntax.

func UpdatePhysician Uses

func UpdatePhysician(id int64, am map[string]interface{}) error

UpdatePhysician is used to update a record with a id and map[string]interface{} typed key-value parameters.

func UpdatePhysiciansBySql Uses

func UpdatePhysiciansBySql(sql string, args ...interface{}) (int64, error)

UpdatePhysiciansBySql is used to update Physician records by a SQL clause using the '?' binding syntax.

func UpdatePicture Uses

func UpdatePicture(id int64, am map[string]interface{}) error

UpdatePicture is used to update a record with a id and map[string]interface{} typed key-value parameters.

func UpdatePicturesBySql Uses

func UpdatePicturesBySql(sql string, args ...interface{}) (int64, error)

UpdatePicturesBySql is used to update Picture records by a SQL clause using the '?' binding syntax.

type Appointment Uses

type Appointment struct {
    Id              int64     `json:"id,omitempty" db:"id" valid:"-"`
    AppointmentDate time.Time `json:"appointment_date,omitempty" db:"appointment_date" valid:"-"`
    PhysicianId     int64     `json:"physician_id,omitempty" db:"physician_id" valid:"-"`
    PatientId       int64     `json:"patient_id,omitempty" db:"patient_id" valid:"-"`
    CreatedAt       time.Time `json:"created_at,omitempty" db:"created_at" valid:"-"`
    UpdatedAt       time.Time `json:"updated_at,omitempty" db:"updated_at" valid:"-"`
    Physician       Physician `json:"physician,omitempty" db:"physician" valid:"-"`
    Patient         Patient   `json:"patient,omitempty" db:"patient" valid:"-"`
}

func AllAppointments Uses

func AllAppointments() (appointments []Appointment, err error)

AllAppointments get all the Appointment records.

func AppointmentIncludesWhere Uses

func AppointmentIncludesWhere(assocs []string, sql string, args ...interface{}) (_appointments []Appointment, err error)

AppointmentIncludesWhere get the Appointment associated models records, currently it's not same as the corresponding "includes" function but "preload" instead in Ruby on Rails. It means that the "sql" should be restricted on Appointment model.

func FindAppointment Uses

func FindAppointment(id int64) (*Appointment, error)

FindAppointment find a single appointment by an ID.

func FindAppointmentBy Uses

func FindAppointmentBy(field string, val interface{}) (*Appointment, error)

FindAppointmentBy find a single appointment by a field name and a value.

func FindAppointmentBySql Uses

func FindAppointmentBySql(sql string, args ...interface{}) (*Appointment, error)

FindAppointmentBySql query use a complete SQL clause with placeholders, eg: FindUserBySql("SELECT * FROM users WHERE first_name = ? AND age > ? ORDER BY DESC LIMIT 1", "John", 18) will return only One record in the table "users" whose first_name is "John" and age elder than 18.

func FindAppointments Uses

func FindAppointments(ids ...int64) ([]Appointment, error)

FindAppointments find one or more appointments by the given ID(s).

func FindAppointmentsBy Uses

func FindAppointmentsBy(field string, val interface{}) (_appointments []Appointment, err error)

FindAppointmentsBy find all appointments by a field name and a value.

func FindAppointmentsBySql Uses

func FindAppointmentsBySql(sql string, args ...interface{}) (appointments []Appointment, err error)

FindAppointmentsBySql query use a complete SQL clause with placeholders, eg: FindUsersBySql("SELECT * FROM users WHERE first_name = ? AND age > ?", "John", 18) will return those records in the table "users" whose first_name is "John" and age elder than 18.

func FindAppointmentsWhere Uses

func FindAppointmentsWhere(where string, args ...interface{}) (appointments []Appointment, err error)

FindAppointmentsWhere query use a partial SQL clause that usually following after WHERE with placeholders, eg: FindUsersWhere("first_name = ? AND age > ?", "John", 18) will return those records in the table "users" whose first_name is "John" and age elder than 18.

func FirstAppointment Uses

func FirstAppointment() (*Appointment, error)

FirstAppointment find the first one appointment by ID ASC order.

func FirstAppointments Uses

func FirstAppointments(n uint32) ([]Appointment, error)

FirstAppointments find the first N appointments by ID ASC order.

func LastAppointment Uses

func LastAppointment() (*Appointment, error)

LastAppointment find the last one appointment by ID DESC order.

func LastAppointments Uses

func LastAppointments(n uint32) ([]Appointment, error)

LastAppointments find the last N appointments by ID DESC order.

func PatientGetAppointments Uses

func PatientGetAppointments(id int64) ([]Appointment, error)

PatientGetAppointments a helper fuction used to get associated objects for PatientIncludesWhere().

func PhysicianGetAppointments Uses

func PhysicianGetAppointments(id int64) ([]Appointment, error)

PhysicianGetAppointments a helper fuction used to get associated objects for PhysicianIncludesWhere().

func (*Appointment) Create Uses

func (_appointment *Appointment) Create() (int64, error)

Create is a method for Appointment to create a record.

func (*Appointment) CreatePatient Uses

func (_appointment *Appointment) CreatePatient(am map[string]interface{}) error

CreatePatient is a method for a Appointment object to create an associated Patient record.

func (*Appointment) CreatePhysician Uses

func (_appointment *Appointment) CreatePhysician(am map[string]interface{}) error

CreatePhysician is a method for a Appointment object to create an associated Physician record.

func (*Appointment) Destroy Uses

func (_appointment *Appointment) Destroy() error

Destroy is method used for a Appointment object to be destroyed.

func (*Appointment) Save Uses

func (_appointment *Appointment) Save() error

Save method is used for a Appointment object to update an existed record mainly. If no id provided a new record will be created. FIXME: A UPSERT action will be implemented further.

func (*Appointment) Update Uses

func (_appointment *Appointment) Update(am map[string]interface{}) error

Update is a method used to update a Appointment record with the map[string]interface{} typed key-value parameters.

func (*Appointment) UpdateAttributes Uses

func (_appointment *Appointment) UpdateAttributes(am map[string]interface{}) error

UpdateAttributes method is supposed to be used to update Appointment records as corresponding update_attributes in Ruby on Rails.

func (*Appointment) UpdateColumns Uses

func (_appointment *Appointment) UpdateColumns(am map[string]interface{}) error

UpdateColumns method is supposed to be used to update Appointment records as corresponding update_columns in Ruby on Rails.

type AppointmentPage Uses

type AppointmentPage struct {
    WhereString string
    WhereParams []interface{}
    Order       map[string]string
    FirstId     int64
    LastId      int64
    PageNum     int
    PerPage     int
    TotalPages  int
    TotalItems  int64
    // contains filtered or unexported fields
}

DataStruct for the pagination

func (*AppointmentPage) Current Uses

func (_p *AppointmentPage) Current() ([]Appointment, error)

Current get the current page of AppointmentPage object for pagination.

func (*AppointmentPage) GetPage Uses

func (_p *AppointmentPage) GetPage(direction string) (ps []Appointment, err error)

GetPage is a helper function for the AppointmentPage object to return a corresponding page due to the parameter passed in, i.e. one of "previous, current or next".

func (*AppointmentPage) Next Uses

func (_p *AppointmentPage) Next() ([]Appointment, error)

Next get the next page of AppointmentPage object for pagination.

func (*AppointmentPage) Previous Uses

func (_p *AppointmentPage) Previous() ([]Appointment, error)

Previous get the previous page of AppointmentPage object for pagination.

type Patient Uses

type Patient struct {
    Id           int64         `json:"id,omitempty" db:"id" valid:"-"`
    Name         string        `json:"name,omitempty" db:"name" valid:"-"`
    CreatedAt    time.Time     `json:"created_at,omitempty" db:"created_at" valid:"-"`
    UpdatedAt    time.Time     `json:"updated_at,omitempty" db:"updated_at" valid:"-"`
    Appointments []Appointment `json:"appointments,omitempty" db:"appointments" valid:"-"`
    Physicians   []Physician   `json:"physicians,omitempty" db:"physicians" valid:"-"`
}

func AllPatients Uses

func AllPatients() (patients []Patient, err error)

AllPatients get all the Patient records.

func FindPatient Uses

func FindPatient(id int64) (*Patient, error)

FindPatient find a single patient by an ID.

func FindPatientBy Uses

func FindPatientBy(field string, val interface{}) (*Patient, error)

FindPatientBy find a single patient by a field name and a value.

func FindPatientBySql Uses

func FindPatientBySql(sql string, args ...interface{}) (*Patient, error)

FindPatientBySql query use a complete SQL clause with placeholders, eg: FindUserBySql("SELECT * FROM users WHERE first_name = ? AND age > ? ORDER BY DESC LIMIT 1", "John", 18) will return only One record in the table "users" whose first_name is "John" and age elder than 18.

func FindPatients Uses

func FindPatients(ids ...int64) ([]Patient, error)

FindPatients find one or more patients by the given ID(s).

func FindPatientsBy Uses

func FindPatientsBy(field string, val interface{}) (_patients []Patient, err error)

FindPatientsBy find all patients by a field name and a value.

func FindPatientsBySql Uses

func FindPatientsBySql(sql string, args ...interface{}) (patients []Patient, err error)

FindPatientsBySql query use a complete SQL clause with placeholders, eg: FindUsersBySql("SELECT * FROM users WHERE first_name = ? AND age > ?", "John", 18) will return those records in the table "users" whose first_name is "John" and age elder than 18.

func FindPatientsWhere Uses

func FindPatientsWhere(where string, args ...interface{}) (patients []Patient, err error)

FindPatientsWhere query use a partial SQL clause that usually following after WHERE with placeholders, eg: FindUsersWhere("first_name = ? AND age > ?", "John", 18) will return those records in the table "users" whose first_name is "John" and age elder than 18.

func FirstPatient Uses

func FirstPatient() (*Patient, error)

FirstPatient find the first one patient by ID ASC order.

func FirstPatients Uses

func FirstPatients(n uint32) ([]Patient, error)

FirstPatients find the first N patients by ID ASC order.

func LastPatient Uses

func LastPatient() (*Patient, error)

LastPatient find the last one patient by ID DESC order.

func LastPatients Uses

func LastPatients(n uint32) ([]Patient, error)

LastPatients find the last N patients by ID DESC order.

func PatientIncludesWhere Uses

func PatientIncludesWhere(assocs []string, sql string, args ...interface{}) (_patients []Patient, err error)

PatientIncludesWhere get the Patient associated models records, currently it's not same as the corresponding "includes" function but "preload" instead in Ruby on Rails. It means that the "sql" should be restricted on Patient model.

func PhysicianGetPatients Uses

func PhysicianGetPatients(id int64) ([]Patient, error)

PhysicianGetPatients a helper fuction used to get associated objects for PhysicianIncludesWhere().

func (*Patient) AppointmentsCreate Uses

func (_patient *Patient) AppointmentsCreate(am map[string]interface{}) error

AppointmentsCreate is used for Patient to create the associated objects Appointments

func (*Patient) Create Uses

func (_patient *Patient) Create() (int64, error)

Create is a method for Patient to create a record.

func (*Patient) Destroy Uses

func (_patient *Patient) Destroy() error

Destroy is method used for a Patient object to be destroyed.

func (*Patient) GetAppointments Uses

func (_patient *Patient) GetAppointments() error

GetAppointments is used for Patient to get associated objects Appointments Say you have a Patient object named patient, when you call patient.GetAppointments(), the object will get the associated Appointments attributes evaluated in the struct.

func (*Patient) GetPhysicians Uses

func (_patient *Patient) GetPhysicians() error

GetPhysicians is used for Patient to get associated objects Physicians Say you have a Patient object named patient, when you call patient.GetPhysicians(), the object will get the associated Physicians attributes evaluated in the struct.

func (*Patient) PhysiciansCreate Uses

func (_patient *Patient) PhysiciansCreate(am map[string]interface{}) error

PhysiciansCreate is used for Patient to create the associated objects Physicians

func (*Patient) Save Uses

func (_patient *Patient) Save() error

Save method is used for a Patient object to update an existed record mainly. If no id provided a new record will be created. FIXME: A UPSERT action will be implemented further.

func (*Patient) Update Uses

func (_patient *Patient) Update(am map[string]interface{}) error

Update is a method used to update a Patient record with the map[string]interface{} typed key-value parameters.

func (*Patient) UpdateAttributes Uses

func (_patient *Patient) UpdateAttributes(am map[string]interface{}) error

UpdateAttributes method is supposed to be used to update Patient records as corresponding update_attributes in Ruby on Rails.

func (*Patient) UpdateColumns Uses

func (_patient *Patient) UpdateColumns(am map[string]interface{}) error

UpdateColumns method is supposed to be used to update Patient records as corresponding update_columns in Ruby on Rails.

type PatientPage Uses

type PatientPage struct {
    WhereString string
    WhereParams []interface{}
    Order       map[string]string
    FirstId     int64
    LastId      int64
    PageNum     int
    PerPage     int
    TotalPages  int
    TotalItems  int64
    // contains filtered or unexported fields
}

DataStruct for the pagination

func (*PatientPage) Current Uses

func (_p *PatientPage) Current() ([]Patient, error)

Current get the current page of PatientPage object for pagination.

func (*PatientPage) GetPage Uses

func (_p *PatientPage) GetPage(direction string) (ps []Patient, err error)

GetPage is a helper function for the PatientPage object to return a corresponding page due to the parameter passed in, i.e. one of "previous, current or next".

func (*PatientPage) Next Uses

func (_p *PatientPage) Next() ([]Patient, error)

Next get the next page of PatientPage object for pagination.

func (*PatientPage) Previous Uses

func (_p *PatientPage) Previous() ([]Patient, error)

Previous get the previous page of PatientPage object for pagination.

type Physician Uses

type Physician struct {
    Id           int64         `json:"id,omitempty" db:"id" valid:"-"`
    Name         string        `json:"name,omitempty" db:"name" valid:"required,length(6|15)"`
    CreatedAt    time.Time     `json:"created_at,omitempty" db:"created_at" valid:"-"`
    UpdatedAt    time.Time     `json:"updated_at,omitempty" db:"updated_at" valid:"-"`
    Introduction string        `json:"introduction,omitempty" db:"introduction" valid:"required"`
    Appointments []Appointment `json:"appointments,omitempty" db:"appointments" valid:"-"`
    Patients     []Patient     `json:"patients,omitempty" db:"patients" valid:"-"`
    Pictures     []Picture     `json:"pictures,omitempty" db:"pictures" valid:"-"`
}

func AllPhysicians Uses

func AllPhysicians() (physicians []Physician, err error)

AllPhysicians get all the Physician records.

func FindPhysician Uses

func FindPhysician(id int64) (*Physician, error)

FindPhysician find a single physician by an ID.

func FindPhysicianBy Uses

func FindPhysicianBy(field string, val interface{}) (*Physician, error)

FindPhysicianBy find a single physician by a field name and a value.

func FindPhysicianBySql Uses

func FindPhysicianBySql(sql string, args ...interface{}) (*Physician, error)

FindPhysicianBySql query use a complete SQL clause with placeholders, eg: FindUserBySql("SELECT * FROM users WHERE first_name = ? AND age > ? ORDER BY DESC LIMIT 1", "John", 18) will return only One record in the table "users" whose first_name is "John" and age elder than 18.

func FindPhysicians Uses

func FindPhysicians(ids ...int64) ([]Physician, error)

FindPhysicians find one or more physicians by the given ID(s).

func FindPhysiciansBy Uses

func FindPhysiciansBy(field string, val interface{}) (_physicians []Physician, err error)

FindPhysiciansBy find all physicians by a field name and a value.

func FindPhysiciansBySql Uses

func FindPhysiciansBySql(sql string, args ...interface{}) (physicians []Physician, err error)

FindPhysiciansBySql query use a complete SQL clause with placeholders, eg: FindUsersBySql("SELECT * FROM users WHERE first_name = ? AND age > ?", "John", 18) will return those records in the table "users" whose first_name is "John" and age elder than 18.

func FindPhysiciansWhere Uses

func FindPhysiciansWhere(where string, args ...interface{}) (physicians []Physician, err error)

FindPhysiciansWhere query use a partial SQL clause that usually following after WHERE with placeholders, eg: FindUsersWhere("first_name = ? AND age > ?", "John", 18) will return those records in the table "users" whose first_name is "John" and age elder than 18.

func FirstPhysician Uses

func FirstPhysician() (*Physician, error)

FirstPhysician find the first one physician by ID ASC order.

func FirstPhysicians Uses

func FirstPhysicians(n uint32) ([]Physician, error)

FirstPhysicians find the first N physicians by ID ASC order.

func LastPhysician Uses

func LastPhysician() (*Physician, error)

LastPhysician find the last one physician by ID DESC order.

func LastPhysicians Uses

func LastPhysicians(n uint32) ([]Physician, error)

LastPhysicians find the last N physicians by ID DESC order.

func PatientGetPhysicians Uses

func PatientGetPhysicians(id int64) ([]Physician, error)

PatientGetPhysicians a helper fuction used to get associated objects for PatientIncludesWhere().

func PhysicianIncludesWhere Uses

func PhysicianIncludesWhere(assocs []string, sql string, args ...interface{}) (_physicians []Physician, err error)

PhysicianIncludesWhere get the Physician associated models records, currently it's not same as the corresponding "includes" function but "preload" instead in Ruby on Rails. It means that the "sql" should be restricted on Physician model.

func (*Physician) AppointmentsCreate Uses

func (_physician *Physician) AppointmentsCreate(am map[string]interface{}) error

AppointmentsCreate is used for Physician to create the associated objects Appointments

func (*Physician) Create Uses

func (_physician *Physician) Create() (int64, error)

Create is a method for Physician to create a record.

func (*Physician) Destroy Uses

func (_physician *Physician) Destroy() error

Destroy is method used for a Physician object to be destroyed.

func (*Physician) GetAppointments Uses

func (_physician *Physician) GetAppointments() error

GetAppointments is used for Physician to get associated objects Appointments Say you have a Physician object named physician, when you call physician.GetAppointments(), the object will get the associated Appointments attributes evaluated in the struct.

func (*Physician) GetPatients Uses

func (_physician *Physician) GetPatients() error

GetPatients is used for Physician to get associated objects Patients Say you have a Physician object named physician, when you call physician.GetPatients(), the object will get the associated Patients attributes evaluated in the struct.

func (*Physician) GetPictures Uses

func (_physician *Physician) GetPictures() error

GetPictures is used for Physician to get associated objects Pictures Say you have a Physician object named physician, when you call physician.GetPictures(), the object will get the associated Pictures attributes evaluated in the struct.

func (*Physician) PatientsCreate Uses

func (_physician *Physician) PatientsCreate(am map[string]interface{}) error

PatientsCreate is used for Physician to create the associated objects Patients

func (*Physician) PicturesCreate Uses

func (_physician *Physician) PicturesCreate(am map[string]interface{}) error

PicturesCreate is used for Physician to create the associated objects Pictures

func (*Physician) Save Uses

func (_physician *Physician) Save() error

Save method is used for a Physician object to update an existed record mainly. If no id provided a new record will be created. FIXME: A UPSERT action will be implemented further.

func (*Physician) Update Uses

func (_physician *Physician) Update(am map[string]interface{}) error

Update is a method used to update a Physician record with the map[string]interface{} typed key-value parameters.

func (*Physician) UpdateAttributes Uses

func (_physician *Physician) UpdateAttributes(am map[string]interface{}) error

UpdateAttributes method is supposed to be used to update Physician records as corresponding update_attributes in Ruby on Rails.

func (*Physician) UpdateColumns Uses

func (_physician *Physician) UpdateColumns(am map[string]interface{}) error

UpdateColumns method is supposed to be used to update Physician records as corresponding update_columns in Ruby on Rails.

type PhysicianPage Uses

type PhysicianPage struct {
    WhereString string
    WhereParams []interface{}
    Order       map[string]string
    FirstId     int64
    LastId      int64
    PageNum     int
    PerPage     int
    TotalPages  int
    TotalItems  int64
    // contains filtered or unexported fields
}

DataStruct for the pagination

func (*PhysicianPage) Current Uses

func (_p *PhysicianPage) Current() ([]Physician, error)

Current get the current page of PhysicianPage object for pagination.

func (*PhysicianPage) GetPage Uses

func (_p *PhysicianPage) GetPage(direction string) (ps []Physician, err error)

GetPage is a helper function for the PhysicianPage object to return a corresponding page due to the parameter passed in, i.e. one of "previous, current or next".

func (*PhysicianPage) Next Uses

func (_p *PhysicianPage) Next() ([]Physician, error)

Next get the next page of PhysicianPage object for pagination.

func (*PhysicianPage) Previous Uses

func (_p *PhysicianPage) Previous() ([]Physician, error)

Previous get the previous page of PhysicianPage object for pagination.

type Picture Uses

type Picture struct {
    Id            int64     `json:"id,omitempty" db:"id" valid:"-"`
    Name          string    `json:"name,omitempty" db:"name" valid:"-"`
    Url           string    `json:"url,omitempty" db:"url" valid:"-"`
    ImageableId   int64     `json:"imageable_id,omitempty" db:"imageable_id" valid:"-"`
    ImageableType string    `json:"imageable_type,omitempty" db:"imageable_type" valid:"-"`
    CreatedAt     time.Time `json:"created_at,omitempty" db:"created_at" valid:"-"`
    UpdatedAt     time.Time `json:"updated_at,omitempty" db:"updated_at" valid:"-"`
}

func AllPictures Uses

func AllPictures() (pictures []Picture, err error)

AllPictures get all the Picture records.

func FindPicture Uses

func FindPicture(id int64) (*Picture, error)

FindPicture find a single picture by an ID.

func FindPictureBy Uses

func FindPictureBy(field string, val interface{}) (*Picture, error)

FindPictureBy find a single picture by a field name and a value.

func FindPictureBySql Uses

func FindPictureBySql(sql string, args ...interface{}) (*Picture, error)

FindPictureBySql query use a complete SQL clause with placeholders, eg: FindUserBySql("SELECT * FROM users WHERE first_name = ? AND age > ? ORDER BY DESC LIMIT 1", "John", 18) will return only One record in the table "users" whose first_name is "John" and age elder than 18.

func FindPictures Uses

func FindPictures(ids ...int64) ([]Picture, error)

FindPictures find one or more pictures by the given ID(s).

func FindPicturesBy Uses

func FindPicturesBy(field string, val interface{}) (_pictures []Picture, err error)

FindPicturesBy find all pictures by a field name and a value.

func FindPicturesBySql Uses

func FindPicturesBySql(sql string, args ...interface{}) (pictures []Picture, err error)

FindPicturesBySql query use a complete SQL clause with placeholders, eg: FindUsersBySql("SELECT * FROM users WHERE first_name = ? AND age > ?", "John", 18) will return those records in the table "users" whose first_name is "John" and age elder than 18.

func FindPicturesWhere Uses

func FindPicturesWhere(where string, args ...interface{}) (pictures []Picture, err error)

FindPicturesWhere query use a partial SQL clause that usually following after WHERE with placeholders, eg: FindUsersWhere("first_name = ? AND age > ?", "John", 18) will return those records in the table "users" whose first_name is "John" and age elder than 18.

func FirstPicture Uses

func FirstPicture() (*Picture, error)

FirstPicture find the first one picture by ID ASC order.

func FirstPictures Uses

func FirstPictures(n uint32) ([]Picture, error)

FirstPictures find the first N pictures by ID ASC order.

func LastPicture Uses

func LastPicture() (*Picture, error)

LastPicture find the last one picture by ID DESC order.

func LastPictures Uses

func LastPictures(n uint32) ([]Picture, error)

LastPictures find the last N pictures by ID DESC order.

func PhysicianGetPictures Uses

func PhysicianGetPictures(id int64) ([]Picture, error)

PhysicianGetPictures a helper fuction used to get associated objects for PhysicianIncludesWhere().

func PictureIncludesWhere Uses

func PictureIncludesWhere(assocs []string, sql string, args ...interface{}) (_pictures []Picture, err error)

PictureIncludesWhere get the Picture associated models records, currently it's not same as the corresponding "includes" function but "preload" instead in Ruby on Rails. It means that the "sql" should be restricted on Picture model.

func (*Picture) Create Uses

func (_picture *Picture) Create() (int64, error)

Create is a method for Picture to create a record.

func (*Picture) Destroy Uses

func (_picture *Picture) Destroy() error

Destroy is method used for a Picture object to be destroyed.

func (*Picture) Save Uses

func (_picture *Picture) Save() error

Save method is used for a Picture object to update an existed record mainly. If no id provided a new record will be created. FIXME: A UPSERT action will be implemented further.

func (*Picture) Update Uses

func (_picture *Picture) Update(am map[string]interface{}) error

Update is a method used to update a Picture record with the map[string]interface{} typed key-value parameters.

func (*Picture) UpdateAttributes Uses

func (_picture *Picture) UpdateAttributes(am map[string]interface{}) error

UpdateAttributes method is supposed to be used to update Picture records as corresponding update_attributes in Ruby on Rails.

func (*Picture) UpdateColumns Uses

func (_picture *Picture) UpdateColumns(am map[string]interface{}) error

UpdateColumns method is supposed to be used to update Picture records as corresponding update_columns in Ruby on Rails.

type PicturePage Uses

type PicturePage struct {
    WhereString string
    WhereParams []interface{}
    Order       map[string]string
    FirstId     int64
    LastId      int64
    PageNum     int
    PerPage     int
    TotalPages  int
    TotalItems  int64
    // contains filtered or unexported fields
}

DataStruct for the pagination

func (*PicturePage) Current Uses

func (_p *PicturePage) Current() ([]Picture, error)

Current get the current page of PicturePage object for pagination.

func (*PicturePage) GetPage Uses

func (_p *PicturePage) GetPage(direction string) (ps []Picture, err error)

GetPage is a helper function for the PicturePage object to return a corresponding page due to the parameter passed in, i.e. one of "previous, current or next".

func (*PicturePage) Next Uses

func (_p *PicturePage) Next() ([]Picture, error)

Next get the next page of PicturePage object for pagination.

func (*PicturePage) Previous Uses

func (_p *PicturePage) Previous() ([]Picture, error)

Previous get the previous page of PicturePage object for pagination.

Package models imports 9 packages (graph). Updated 2018-08-21. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).