Documentation
¶
Index ¶
Constants ¶
View Source
const ( WidgetSizeSmall = "small" WidgetSizeMedium = "medium" WidgetSizeLarge = "large" )
Variables ¶
This section is empty.
Functions ¶
func IsValidWidgetSize ¶
func SortWidgets ¶
func SortWidgets(a []*Widget, fn WidgetLessFunc)
func WidgetLessName ¶
func WidgetLessSize ¶
Types ¶
type FindOptions ¶
type FindOptions struct {
SortBy string
}
type WidgetFilter ¶
type WidgetLessFunc ¶
func WidgetLess ¶
func WidgetLess(sortBy string) WidgetLessFunc
type WidgetService ¶
type WidgetService interface {
FindWidget(ctx context.Context, id int) (*Widget, error)
FindWidgets(ctx context.Context, filter WidgetFilter, opt FindOptions) ([]*Widget, error)
CreateWidget(ctx context.Context, widget *Widget) error
UpdateWidget(ctx context.Context, id int, upd WidgetUpdate) (*Widget, error)
}
type WidgetUpdate ¶
Click to show internal directories.
Click to hide internal directories.