Documentation ¶
Index ¶
- Constants
- Variables
- func NewPickEndpoint(s Service) goa.Endpoint
- func NewViewedStoredBottleCollection(res StoredBottleCollection, view string) sommelierviews.StoredBottleCollection
- type Client
- type Component
- type Criteria
- type Endpoints
- type NoCriteria
- type NoMatch
- type Service
- type StoredBottle
- type StoredBottleCollection
- type Winery
Constants ¶
const ServiceName = "sommelier"
ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.
Variables ¶
var MethodNames = [1]string{"pick"}
MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.
Functions ¶
func NewPickEndpoint ¶
NewPickEndpoint returns an endpoint function that calls the method "pick" of service "sommelier".
func NewViewedStoredBottleCollection ¶
func NewViewedStoredBottleCollection(res StoredBottleCollection, view string) sommelierviews.StoredBottleCollection
NewViewedStoredBottleCollection initializes viewed result type StoredBottleCollection from result type StoredBottleCollection using the given view.
Types ¶
type Client ¶
Client is the "sommelier" service client.
type Criteria ¶
type Criteria struct { // Name of bottle to pick Name *string // Varietals in preference order Varietal []string // Winery of bottle to pick Winery *string }
Criteria is the payload type of the sommelier service pick method.
type Endpoints ¶
Endpoints wraps the "sommelier" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "sommelier" service with endpoints.
type NoCriteria ¶
type NoCriteria string
Missing criteria
func (NoCriteria) ErrorName ¶
func (e NoCriteria) ErrorName() string
ErrorName returns "no_criteria".
type Service ¶
type Service interface { // Pick implements pick. Pick(context.Context, *Criteria) (res StoredBottleCollection, err error) }
The sommelier service retrieves bottles given a set of criteria.
type StoredBottle ¶
type StoredBottle struct { // ID is the unique id of the bottle. ID string // Name of bottle Name string // Winery that produces wine Winery *Winery // Vintage of bottle Vintage uint32 // Composition is the list of grape varietals and associated percentage. Composition []*Component // Description of bottle Description *string // Rating of bottle from 1 (worst) to 5 (best) Rating *uint32 }
A StoredBottle describes a bottle retrieved by the storage service.
type StoredBottleCollection ¶
type StoredBottleCollection []*StoredBottle
StoredBottleCollection is the result type of the sommelier service pick method.
func NewStoredBottleCollection ¶
func NewStoredBottleCollection(vres sommelierviews.StoredBottleCollection) StoredBottleCollection
NewStoredBottleCollection initializes result type StoredBottleCollection from viewed result type StoredBottleCollection.