entities

package
v0.0.0-...-664f0da Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2017 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MeetingService = MeetingServiceProvider{}
View Source
var UserService = UserServiceProvider{}

Functions

This section is empty.

Types

type DaoSource

type DaoSource struct {
	SQLExecer
}

type Date

type Date struct {
	Time time.Time
}

func StringToDate

func StringToDate(st string) Date

the example of string: 2017-10-20T19:00 2000-01-01T00:00

func (Date) DateToString

func (date Date) DateToString() string

output is like: 2017-10-20 19:00

func (Date) GetDay

func (date Date) GetDay() int

func (Date) GetHour

func (date Date) GetHour() int

func (Date) GetMinute

func (date Date) GetMinute() int

func (Date) GetMonth

func (date Date) GetMonth() string

month is like January, March and so on.

func (Date) GetYear

func (date Date) GetYear() int

func (*Date) Init

func (date *Date) Init(st string)

the example of st: 2017-10-20T19:00

func (Date) IsAfter

func (date Date) IsAfter(other Date) bool

func (Date) IsEqual

func (date Date) IsEqual(other Date) bool

type Meeting

type Meeting struct {
	Id            int      `json:"id"`
	Title         string   `json:"title"`
	Sponsor       string   `json:"sponsor"`
	Participators []string `json:"participators"`
	Start         string   `json:"start"`
	End           string   `json:"end"`
}

func (*Meeting) AddParticipator

func (meeting *Meeting) AddParticipator(username string) bool

func (*Meeting) DeleteParticipator

func (meeting *Meeting) DeleteParticipator(username string) bool

func (Meeting) GetEnd

func (meeting Meeting) GetEnd() string

func (Meeting) GetParticipators

func (meeting Meeting) GetParticipators() []string

func (Meeting) GetParticipatorsLength

func (meeting Meeting) GetParticipatorsLength() int

func (Meeting) GetSponsor

func (meeting Meeting) GetSponsor() string

func (Meeting) GetStart

func (meeting Meeting) GetStart() string

func (Meeting) GetTitle

func (meeting Meeting) GetTitle() string

func (*Meeting) Init

func (meeting *Meeting) Init(title string, sponsor string,
	participators []string, start string, end string)

the examples of start and end: 2017-10-20T19:00 2017-01-01T0:00

func (Meeting) IsParticipator

func (meeting Meeting) IsParticipator(username string) bool

func (Meeting) IsSponsor

func (meeting Meeting) IsSponsor(username string) bool

func (*Meeting) SetEnd

func (meeting *Meeting) SetEnd(end string)

func (*Meeting) SetParticipators

func (meeting *Meeting) SetParticipators(participators []string)

func (*Meeting) SetSponsor

func (meeting *Meeting) SetSponsor(sponsor string)

func (*Meeting) SetStart

func (meeting *Meeting) SetStart(start string)

func (*Meeting) SetTitle

func (meeting *Meeting) SetTitle(title string)

func (Meeting) String

func (meeting Meeting) String()

type MeetingServiceProvider

type MeetingServiceProvider struct{}

func (*MeetingServiceProvider) DeleteBySponsor

func (*MeetingServiceProvider) DeleteBySponsor(sponsor string) error

func (*MeetingServiceProvider) DeleteByTitle

func (*MeetingServiceProvider) DeleteByTitle(title string) error

func (*MeetingServiceProvider) Insert

func (*MeetingServiceProvider) Insert(meeting *Meeting) error

func (*MeetingServiceProvider) QueryAll

func (*MeetingServiceProvider) QueryAll() []Meeting

func (*MeetingServiceProvider) QueryBy

func (*MeetingServiceProvider) QueryBy(key string, val string) []Meeting

func (*MeetingServiceProvider) QueryByTitle

func (*MeetingServiceProvider) QueryByTitle(title string) Meeting

func (*MeetingServiceProvider) Update

func (*MeetingServiceProvider) Update(meeting Meeting) error

type SQLExecer

type SQLExecer interface {
	Exec(query string, args ...interface{}) (sql.Result, error)
	Prepare(query string) (*sql.Stmt, error)
	Query(query string, args ...interface{}) (*sql.Rows, error)
	QueryRow(query string, args ...interface{}) *sql.Row
}

type User

type User struct {
	Id       int    `json:"id"`
	Username string `json:"username"`
	Password string `json:"password"`
	Email    string `json:"email"`
	Phone    string `json:"phone"`
}

func (User) GetEmail

func (user User) GetEmail() string

func (User) GetPassword

func (user User) GetPassword() string

func (User) GetPhone

func (user User) GetPhone() string

func (User) GetUsername

func (user User) GetUsername() string

func (*User) Init

func (user *User) Init(name string, psw string, email string, phone string)

func (*User) SetEmail

func (user *User) SetEmail(email string)

func (*User) SetPassword

func (user *User) SetPassword(password string)

func (*User) SetPhone

func (user *User) SetPhone(phone string)

func (*User) SetUsername

func (user *User) SetUsername(username string)

func (User) String

func (user User) String()

type UserServiceProvider

type UserServiceProvider struct{}

func (*UserServiceProvider) DeleteByName

func (*UserServiceProvider) DeleteByName(name string) error

func (*UserServiceProvider) Insert

func (*UserServiceProvider) Insert(user *User) error

func (*UserServiceProvider) QueryAll

func (*UserServiceProvider) QueryAll() []User

func (*UserServiceProvider) QueryByName

func (*UserServiceProvider) QueryByName(name string) User

Jump to

Keyboard shortcuts

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