models

package
v0.0.0-...-0dd7324 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2012 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DATE_FORMAT = "Jan _2, 2006"

Variables

This section is empty.

Functions

func ValidatePassword

func ValidatePassword(v *rev.Validation, password string) *rev.ValidationResult

Types

type Booking

type Booking struct {
	BookingId    int
	UserId       int
	HotelId      int
	CheckInDate  time.Time
	CheckOutDate time.Time
	CardNumber   string
	NameOnCard   string
	CardExpMonth int
	CardExpYear  int
	Smoking      bool
	Beds         int

	User  *User
	Hotel *Hotel
}

func (Booking) Description

func (b Booking) Description() string

func (Booking) Nights

func (b Booking) Nights() int

func (Booking) String

func (b Booking) String() string

func (Booking) Total

func (b Booking) Total() int

func (Booking) Validate

func (booking Booking) Validate(v *rev.Validation)

TODO: Make an interface for Validate() and then validation can pass in the key prefix ("booking.")

type Hotel

type Hotel struct {
	HotelId          int
	Name, Address    string
	City, State, Zip string
	Country          string
	Price            int
}

func (*Hotel) Validate

func (hotel *Hotel) Validate(v *rev.Validation)

type User

type User struct {
	UserId                   int
	Username, Password, Name string
	HashedPassword           []byte
}

func (*User) String

func (u *User) String() string

func (*User) Validate

func (user *User) Validate(v *rev.Validation)

Jump to

Keyboard shortcuts

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