attributes

package
v0.0.0-...-a6fc1d5 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2018 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RouterAttr

func RouterAttr(attrRepo Repository, router *httprouter.Router)

RouterAttr |

Types

type AttrController

type AttrController struct {
	// contains filtered or unexported fields
}

AttrController |

func NewAttrController

func NewAttrController(service *AttrService) *AttrController

NewAttrController |

func (*AttrController) Create

Create |

func (*AttrController) Delete

Delete |

func (*AttrController) Find

Find |

func (*AttrController) List

List |

func (*AttrController) Update

Update |

type AttrService

type AttrService struct {
	// contains filtered or unexported fields
}

AttrService |

func NewService

func NewService(r Repository) *AttrService

NewService |

func (*AttrService) AddAttr

func (s *AttrService) AddAttr(attr models.Attribute) error

AddAttr |

func (*AttrService) AttrExists

func (s *AttrService) AttrExists(name string) bool

AttrExists |

func (*AttrService) DeleteAttrByName

func (s *AttrService) DeleteAttrByName(name string) error

DeleteAttrByName |

func (*AttrService) GetAllAttrs

func (s *AttrService) GetAllAttrs() ([]models.Attribute, error)

GetAllAttrs |

func (*AttrService) GetAttrByName

func (s *AttrService) GetAttrByName(name string) (models.Attribute, error)

GetAttrByName |

func (*AttrService) IsValid

func (s *AttrService) IsValid(attr models.Attribute) (bool, string)

IsValid |

func (*AttrService) UpdateAttr

func (s *AttrService) UpdateAttr(attr models.Attribute) error

UpdateAttr |

type MongoRepository

type MongoRepository struct {
	// contains filtered or unexported fields
}

MongoRepository |

func NewMongoRepository

func NewMongoRepository(session *mgo.Session) *MongoRepository

NewMongoRepository |

func (*MongoRepository) AddAttr

func (r *MongoRepository) AddAttr(attr models.Attribute) error

AddAttr |

func (*MongoRepository) DeleteAttrByName

func (r *MongoRepository) DeleteAttrByName(name string) error

DeleteAttrByName |

func (*MongoRepository) GetAllAttrs

func (r *MongoRepository) GetAllAttrs() ([]models.Attribute, error)

GetAllAttrs |

func (*MongoRepository) GetAttrByName

func (r *MongoRepository) GetAttrByName(name string) (models.Attribute, error)

GetAttrByName |

func (*MongoRepository) UpdateAttr

func (r *MongoRepository) UpdateAttr(attr models.Attribute) error

UpdateAttr |

type Read

type Read interface {
	GetAllAttrs() ([]models.Attribute, error)
	GetAttrByName(name string) (models.Attribute, error)
}

Read |

type Repository

type Repository interface {
	Read
	Write
}

Repository |

type Service

type Service interface {
	IsValid(Attr models.Attribute) bool
	Read
	Write
}

Service |

type Write

type Write interface {
	AddAttr(attr models.Attribute) error
	UpdateAttr(attr models.Attribute) error
	DeleteAttrByName(name string) error
}

Write |

Jump to

Keyboard shortcuts

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