Documentation ¶
Index ¶
- Variables
- func ValidateComponentView(result *ComponentView) (err error)
- func ValidateStoredBottleCollection(result StoredBottleCollection) (err error)
- func ValidateStoredBottleCollectionView(result StoredBottleCollectionView) (err error)
- func ValidateStoredBottleCollectionViewTiny(result StoredBottleCollectionView) (err error)
- func ValidateStoredBottleView(result *StoredBottleView) (err error)
- func ValidateStoredBottleViewTiny(result *StoredBottleView) (err error)
- func ValidateWineryView(result *WineryView) (err error)
- func ValidateWineryViewTiny(result *WineryView) (err error)
- type ComponentView
- type StoredBottleCollection
- type StoredBottleCollectionView
- type StoredBottleView
- type WineryView
Constants ¶
This section is empty.
Variables ¶
var ( // StoredBottleCollectionMap is a map of attribute names in result type // StoredBottleCollection indexed by view name. StoredBottleCollectionMap = map[string][]string{ "default": []string{ "id", "name", "winery", "vintage", "composition", "description", "rating", }, "tiny": []string{ "id", "name", "winery", }, } // StoredBottleMap is a map of attribute names in result type StoredBottle // indexed by view name. StoredBottleMap = map[string][]string{ "default": []string{ "id", "name", "winery", "vintage", "composition", "description", "rating", }, "tiny": []string{ "id", "name", "winery", }, } // WineryMap is a map of attribute names in result type Winery indexed by view // name. WineryMap = map[string][]string{ "default": []string{ "name", "region", "country", "url", }, "tiny": []string{ "name", }, } )
Functions ¶
func ValidateComponentView ¶
func ValidateComponentView(result *ComponentView) (err error)
ValidateComponentView runs the validations defined on ComponentView.
func ValidateStoredBottleCollection ¶
func ValidateStoredBottleCollection(result StoredBottleCollection) (err error)
ValidateStoredBottleCollection runs the validations defined on the viewed result type StoredBottleCollection.
func ValidateStoredBottleCollectionView ¶
func ValidateStoredBottleCollectionView(result StoredBottleCollectionView) (err error)
ValidateStoredBottleCollectionView runs the validations defined on StoredBottleCollectionView using the "default" view.
func ValidateStoredBottleCollectionViewTiny ¶
func ValidateStoredBottleCollectionViewTiny(result StoredBottleCollectionView) (err error)
ValidateStoredBottleCollectionViewTiny runs the validations defined on StoredBottleCollectionView using the "tiny" view.
func ValidateStoredBottleView ¶
func ValidateStoredBottleView(result *StoredBottleView) (err error)
ValidateStoredBottleView runs the validations defined on StoredBottleView using the "default" view.
func ValidateStoredBottleViewTiny ¶
func ValidateStoredBottleViewTiny(result *StoredBottleView) (err error)
ValidateStoredBottleViewTiny runs the validations defined on StoredBottleView using the "tiny" view.
func ValidateWineryView ¶
func ValidateWineryView(result *WineryView) (err error)
ValidateWineryView runs the validations defined on WineryView using the "default" view.
func ValidateWineryViewTiny ¶
func ValidateWineryViewTiny(result *WineryView) (err error)
ValidateWineryViewTiny runs the validations defined on WineryView using the "tiny" view.
Types ¶
type ComponentView ¶
type ComponentView struct { // Grape varietal Varietal *string // Percentage of varietal in wine Percentage *uint32 }
ComponentView is a type that runs validations on a projected type.
type StoredBottleCollection ¶
type StoredBottleCollection struct { // Type to project Projected StoredBottleCollectionView // View to render View string }
StoredBottleCollection is the viewed result type that is projected based on a view.
type StoredBottleCollectionView ¶
type StoredBottleCollectionView []*StoredBottleView
StoredBottleCollectionView is a type that runs validations on a projected type.
type StoredBottleView ¶
type StoredBottleView struct { // ID is the unique id of the bottle. ID *string // Name of bottle Name *string // Winery that produces wine Winery *WineryView // Vintage of bottle Vintage *uint32 // Composition is the list of grape varietals and associated percentage. Composition []*ComponentView // Description of bottle Description *string // Rating of bottle from 1 (worst) to 5 (best) Rating *uint32 }
StoredBottleView is a type that runs validations on a projected type.