Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GrpcRouter ¶
type GrpcRouter struct {
// contains filtered or unexported fields
}
GrpcRouter represents the gRPC router.
func NewGrpcRouter ¶
func NewGrpcRouter(s Service, serviceName string) GrpcRouter
NewGrpcRouter creates a new gRPC router.
func (GrpcRouter) Start ¶
func (g GrpcRouter) Start(port string) error
type QuoteService ¶ added in v0.2.0
type QuoteService struct { Service Service Name string Port string mhttp.MoshaHttpService }
func (*QuoteService) GetName ¶ added in v0.2.0
func (qs *QuoteService) GetName() string
func (*QuoteService) GetPort ¶ added in v0.2.0
func (qs *QuoteService) GetPort() string
func (*QuoteService) MakeHandler ¶ added in v0.2.0
func (qs *QuoteService) MakeHandler() http.Handler
type Service ¶
type Service interface { // CreateQuote registers a new Quote in the database. CreateQuote(quote data.Quote) (string, error) // ListAll returns all quotes in the database. ListAll() []data.Quote // UpdateQuote updates a quote in the database. UpdateQuote(quote data.Quote) (data.Quote, error) // DeleteQuote deletes a quote from the database. DeleteQuote(id string) error // GetQuote returns a quote from the database. GetQuote(id string) (data.Quote, error) // GetAuthorQuotes returns all quotes from an author. GetAuthorQuotes(authorID string) []data.Quote // DeleteAuthorQuotes deletes all quotes from an author. DeleteAuthorQuotes(authorID string) error // GetRandomQuote returns a random quote from the database. GetRandomQuote() (data.Quote, error) }
Service represents the service interface.
func New ¶
func New(repo repository.Repository) Service
Click to show internal directories.
Click to hide internal directories.