forked from go-goyave/goyave
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservice.go
More file actions
16 lines (15 loc) · 678 Bytes
/
Copy pathservice.go
File metadata and controls
16 lines (15 loc) · 678 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package goyave
// Service is the bridge between the REST layer of your application and
// the domain. It is responsible of the business logic.
// Services usually bundle a repository interface defining functions
// in which the database logic would be implemented.
//
// Services receive data that is expected to be validated and correctly formatted as
// a DTO (Data Transfer Object) structure. They in turn return DTOs or errors so
// controllers can format a clean HTTP response.
type Service interface {
// Name returns the unique name identifier for the service.
// The returned value should be a constant to make it easier
// to retrieve the service.
Name() string
}