Documentation ¶
Overview ¶
Package status provides status values for models
Index ¶
- Constants
- func NotNull(q *query.Query) *query.Query
- func Null(q *query.Query) *query.Query
- func Order(q *query.Query) *query.Query
- func WhereDraft(q *query.Query) *query.Query
- func WhereFeatured(q *query.Query) *query.Query
- func WhereFinal(q *query.Query) *query.Query
- func WherePublished(q *query.Query) *query.Query
- func WhereSuspended(q *query.Query) *query.Query
- type ModelStatus
- func (m *ModelStatus) IsDraft() bool
- func (m *ModelStatus) IsFeatured() bool
- func (m *ModelStatus) IsFinal() bool
- func (m *ModelStatus) IsPublished() bool
- func (m *ModelStatus) IsSuspended() bool
- func (m *ModelStatus) IsUnavailable() bool
- func (m *ModelStatus) StatusDisplay() string
- func (m *ModelStatus) StatusOptions() []helpers.Option
Constants ¶
const ( Draft = 0 Final = 10 Suspended = 11 Published = 100 Featured = 101 )
Standard status values shared between models
Variables ¶
This section is empty.
Functions ¶
func WhereDraft ¶
WhereDraft modifies the given query to select status draft
func WhereFeatured ¶
WhereFeatured modifies the given query to select status Featured
func WhereFinal ¶
WhereFinal modifies the given query to select status Final
func WherePublished ¶
WherePublished modifies the given query to select status Published
Types ¶
type ModelStatus ¶
type ModelStatus struct {
Status int64
}
ModelStatus adds status to a model
func (*ModelStatus) IsDraft ¶
func (m *ModelStatus) IsDraft() bool
IsDraft returns true if the status is Draft
func (*ModelStatus) IsFeatured ¶
func (m *ModelStatus) IsFeatured() bool
IsFeatured returns true if the status is featured
func (*ModelStatus) IsFinal ¶
func (m *ModelStatus) IsFinal() bool
IsFinal returns true if the status is Final
func (*ModelStatus) IsPublished ¶
func (m *ModelStatus) IsPublished() bool
IsPublished returns true if the status is published *or over*
func (*ModelStatus) IsSuspended ¶
func (m *ModelStatus) IsSuspended() bool
IsSuspended returns true if the status is Suspended
func (*ModelStatus) IsUnavailable ¶
func (m *ModelStatus) IsUnavailable() bool
IsUnavailable returns true if the status is unavailable
func (*ModelStatus) StatusDisplay ¶
func (m *ModelStatus) StatusDisplay() string
StatusDisplay returns a string representation of the model status
func (*ModelStatus) StatusOptions ¶
func (m *ModelStatus) StatusOptions() []helpers.Option
StatusOptions returns an array of statuses for a status select