Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

34 linhas
703B

  1. package template
  2. import (
  3. "errors"
  4. )
  5. var ErrPanelNotFound = errors.New("panel does not exist")
  6. // Panels contains a map with named panels.
  7. type Panels map[string]Panel
  8. // The Panel contains all the lines and extra points to draw a panel.
  9. type Panel struct {
  10. Points Points `yaml:"points"`
  11. Lines Lines `yaml:"lines"`
  12. Allowances Allowances `yaml:"allowances"`
  13. Name string `yaml:"name"`
  14. Information Information `yaml:"information"`
  15. }
  16. type Allowances struct {
  17. Hem string `yaml:"hem"`
  18. Seam string `yaml:"seam"`
  19. }
  20. func (t Template) Panel(name string) (Panel, error) {
  21. p, ok := t.Panels[name]
  22. if !ok {
  23. return Panel{}, ErrPanelNotFound
  24. }
  25. return p, nil
  26. }