tinyego

package module
v0.0.0-...-477ec8c Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WidgetSizeSmall  = "small"
	WidgetSizeMedium = "medium"
	WidgetSizeLarge  = "large"
)

Variables

This section is empty.

Functions

func IsValidWidgetSize

func IsValidWidgetSize(v string) bool

func SortWidgets

func SortWidgets(a []*Widget, fn WidgetLessFunc)

func WidgetLessName

func WidgetLessName(i, j *Widget) bool

func WidgetLessSize

func WidgetLessSize(i, j *Widget) bool

Types

type FindOptions

type FindOptions struct {
	SortBy string
}

type Widget

type Widget struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Size string `json:"size"`
}

func (*Widget) Match

func (w *Widget) Match(filter WidgetFilter) bool

type WidgetFilter

type WidgetFilter struct {
	Query *string `json:"name"`
	Size  *string `json:"size"`
}

type WidgetLessFunc

type WidgetLessFunc func(i, j *Widget) bool

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

type WidgetUpdate struct {
	Name *string `json:"name"`
	Size *string `json:"size"`
}

Directories

Path Synopsis
cmd
tiny-ego command

Jump to

Keyboard shortcuts

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