Documentation ¶
Index ¶
- type Interval
- func NewInterval(userID bson.ObjectId, start time.Time, stop time.Time) Interval
- func NewIntervalWithStart(userID bson.ObjectId, start time.Time) Interval
- func NewPersistedInterval(id bson.ObjectId, userID bson.ObjectId, start time.Time, stop time.Time) Interval
- func NewPersistedIntervalWithStart(id bson.ObjectId, userID bson.ObjectId, start time.Time) Interval
- type IntervalDao
- type IntervalDaoImpl
- func (dao *IntervalDaoImpl) FindByUserID(userID bson.ObjectId) ([]Interval, error)
- func (dao *IntervalDaoImpl) FindInRange(userID bson.ObjectId, begin time.Time, end time.Time) ([]Interval, error)
- func (dao *IntervalDaoImpl) FindOpenIntervals(userID bson.ObjectId) ([]Interval, error)
- func (dao *IntervalDaoImpl) IsUserWorking(userID bson.ObjectId) (bool, error)
- func (dao *IntervalDaoImpl) Save(interval Interval) error
- func (dao *IntervalDaoImpl) Start(userID bson.ObjectId) error
- func (dao *IntervalDaoImpl) Stop(userID bson.ObjectId) error
- type User
- func NewMinimalUser(name string, worktime time.Duration) User
- func NewPersistedMinimalUser(id bson.ObjectId, name string, worktime time.Duration) User
- func NewPersistedUser(id bson.ObjectId, name string, worktime time.Duration, ovetime time.Duration) User
- func NewUser(name string, worktime time.Duration, ovetime time.Duration) User
- type UserDao
- type UserDaoImpl
- func (dao *UserDaoImpl) AddPassword(id bson.ObjectId, password []byte) error
- func (dao *UserDaoImpl) AddPasswordByUser(username string, password []byte) error
- func (dao *UserDaoImpl) FindByID(id bson.ObjectId) (User, error)
- func (dao *UserDaoImpl) FindByName(name string) (User, error)
- func (dao *UserDaoImpl) GetPassword(id bson.ObjectId) ([]byte, error)
- func (dao *UserDaoImpl) GetPasswordByUser(username string) ([]byte, error)
- func (dao *UserDaoImpl) Save(user User) error
- func (dao *UserDaoImpl) SaveWithPassword(user UserWithPassword) error
- func (dao *UserDaoImpl) Update(user User) error
- type UserWithPassword
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interval ¶
type Interval struct { ID bson.ObjectId `bson:"_id,omitempty"` UserID bson.ObjectId Start time.Time Stop time.Time `bson:",omitempty"` }
Interval contains the Duration of a work from a user
func NewIntervalWithStart ¶
func NewPersistedInterval ¶
func (Interval) EqualsWithoutID ¶
type IntervalDao ¶
type IntervalDao interface { Save(interval Interval) error FindByUserID(userID bson.ObjectId) ([]Interval, error) IsUserWorking(userID bson.ObjectId) (bool, error) Start(userID bson.ObjectId) error Stop(userID bson.ObjectId) error FindOpenIntervals(userID bson.ObjectId) ([]Interval, error) FindInRange(userID bson.ObjectId, begin time.Time, end time.Time) ([]Interval, error) }
func NewIntervalDao ¶
func NewIntervalDao(session *mgo.Session, dbName string) IntervalDao
type IntervalDaoImpl ¶
type IntervalDaoImpl struct {
// contains filtered or unexported fields
}
func (*IntervalDaoImpl) FindByUserID ¶
func (dao *IntervalDaoImpl) FindByUserID(userID bson.ObjectId) ([]Interval, error)
func (*IntervalDaoImpl) FindInRange ¶
func (dao *IntervalDaoImpl) FindInRange(userID bson.ObjectId, begin time.Time, end time.Time) ([]Interval, error)
FindInRange returns all intervals where start is greater than or equals begin and less than end
func (*IntervalDaoImpl) FindOpenIntervals ¶
func (dao *IntervalDaoImpl) FindOpenIntervals(userID bson.ObjectId) ([]Interval, error)
FindOpenIntervals returns all intervals where stop is not set/zero value
func (*IntervalDaoImpl) IsUserWorking ¶
func (dao *IntervalDaoImpl) IsUserWorking(userID bson.ObjectId) (bool, error)
func (*IntervalDaoImpl) Save ¶
func (dao *IntervalDaoImpl) Save(interval Interval) error
type User ¶
type User struct { ID bson.ObjectId `bson:"_id,omitempty"` Name string Worktime time.Duration Overtime time.Duration }
func NewPersistedMinimalUser ¶
func NewPersistedUser ¶
func (User) EqualsWithoutID ¶
type UserDao ¶
type UserDao interface { Save(user User) error SaveWithPassword(user UserWithPassword) error FindByID(id bson.ObjectId) (User, error) FindByName(name string) (User, error) AddPassword(id bson.ObjectId, password []byte) error AddPasswordByUser(username string, password []byte) error GetPassword(id bson.ObjectId) ([]byte, error) GetPasswordByUser(username string) ([]byte, error) Update(user User) error }
func NewUserDao ¶
type UserDaoImpl ¶
type UserDaoImpl struct {
// contains filtered or unexported fields
}
func (*UserDaoImpl) AddPassword ¶
func (dao *UserDaoImpl) AddPassword(id bson.ObjectId, password []byte) error
func (*UserDaoImpl) AddPasswordByUser ¶
func (dao *UserDaoImpl) AddPasswordByUser(username string, password []byte) error
func (*UserDaoImpl) FindByName ¶
func (dao *UserDaoImpl) FindByName(name string) (User, error)
func (*UserDaoImpl) GetPassword ¶
func (dao *UserDaoImpl) GetPassword(id bson.ObjectId) ([]byte, error)
func (*UserDaoImpl) GetPasswordByUser ¶
func (dao *UserDaoImpl) GetPasswordByUser(username string) ([]byte, error)
func (*UserDaoImpl) Save ¶
func (dao *UserDaoImpl) Save(user User) error
func (*UserDaoImpl) SaveWithPassword ¶
func (dao *UserDaoImpl) SaveWithPassword(user UserWithPassword) error
func (*UserDaoImpl) Update ¶
func (dao *UserDaoImpl) Update(user User) error
type UserWithPassword ¶
type UserWithPassword struct { ID bson.ObjectId `bson:"_id,omitempty"` Name string Worktime time.Duration Overtime time.Duration Password string }
func NewMinimalUserWithPassword ¶
func NewMinimalUserWithPassword(name string, worktime time.Duration, password []byte) UserWithPassword
func (UserWithPassword) EqualsWithoutID ¶
func (user UserWithPassword) EqualsWithoutID(that UserWithPassword) bool
Click to show internal directories.
Click to hide internal directories.