Documentation ¶
Index ¶
- Constants
- Variables
- func ActiveHoursRangeString(from, to byte) string
- type Hours
- func (h Hours) Equal(h2 Hours) bool
- func (h Hours) IsAllActive() bool
- func (h Hours) IsNoActive() bool
- func (h Hours) MarshalJSON() ([]byte, error)
- func (h Hours) Merge(h2 Hours)
- func (h *Hours) Scan(value interface{}) (err error)
- func (h *Hours) SetHour(weekDay time.Weekday, hour byte, active bool)
- func (h Hours) String() string
- func (h Hours) TestHour(weekDay time.Weekday, hour byte) bool
- func (h Hours) TestTime(t time.Time) bool
- func (h *Hours) UnmarshalJSON(data []byte) error
- func (h Hours) Value() (driver.Value, error)
- type HoursJSON
- func (h HoursJSON) Equal(h2 Hours) bool
- func (h HoursJSON) IsAllActive() bool
- func (h HoursJSON) IsNoActive() bool
- func (h HoursJSON) MarshalJSON() ([]byte, error)
- func (h HoursJSON) Merge(h2 Hours)
- func (h *HoursJSON) Scan(value interface{}) (err error)
- func (h *HoursJSON) SetHour(weekDay time.Weekday, hour byte, active bool)
- func (h HoursJSON) String() string
- func (h HoursJSON) TestHour(weekDay time.Weekday, hour byte) bool
- func (h HoursJSON) TestTime(t time.Time) bool
- func (h *HoursJSON) UnmarshalJSON(data []byte) error
- func (h HoursJSON) Value() (driver.Value, error)
Constants ¶
View Source
const ( ActiveDayHoursString = "111111111111111111111111" DisabledDayHoursString = "000000000000000000000000" AllActiveHoursString = "*" // default value to save the space ActiveWeekHoursString = "" + ActiveDayHoursString + ActiveDayHoursString + ActiveDayHoursString + ActiveDayHoursString + ActiveDayHoursString + ActiveDayHoursString + ActiveDayHoursString // Saturday )
Default constants...
Variables ¶
View Source
var ErrTooMuchHoursForDecode = errors.New("[hours] too much hours for decode, mpre then 24*7")
ErrTooMuchHoursForDecode tells that hours more then for a week
Functions ¶
func ActiveHoursRangeString ¶
ActiveHoursRangeString returns preformatted string with marked active houts according to range
Types ¶
type Hours ¶
type Hours []byte
Hours type
func HoursByJSON ¶
HoursByJSON decodes JSON format of timetable
func HoursByString ¶
HoursByString returns hours value or error
func MustHoursByString ¶
MustHoursByString returns hours value or panic
func (Hours) MarshalJSON ¶
MarshalJSON implements the functionality of json.Marshaler interface
func (*Hours) UnmarshalJSON ¶
UnmarshalJSON implements the functionality of json.Unmarshaler interface
type HoursJSON ¶
type HoursJSON Hours
HoursJSON supports the JSON format of storing
func (HoursJSON) IsAllActive ¶
IsAllActive then return the true
func (HoursJSON) MarshalJSON ¶
MarshalJSON implements the functionality of json.Marshaler interface
func (*HoursJSON) UnmarshalJSON ¶
UnmarshalJSON implements the functionality of json.Unmarshaler interface
Click to show internal directories.
Click to hide internal directories.