Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Endpoint ¶
type Endpoint struct { // ID uniquely identifies this endpoint ID *int64 // Code is a unique code for the Endpoint. Doesn't have to be globally unique, just unique per service. For example, // "POST /locations" or "GET /locations/:id" Code EndpointCode // Name is a friendly name for the Endpoint. For example, "Create location" or "Get location by id" Name EndpointName // Dependencies is a map of Dependencies for a given Endpoint. Keys are service codes, values are lists of endpoint codes Dependencies map[Code][]EndpointCode }
Endpoint represents an Endpoint of a Service
type EndpointCode ¶
type EndpointCode = string
EndpointCode is a code that uniquely identifies an Endpoint. It need not be globally unique, only unique within that one Service
type EndpointName ¶
type EndpointName = string
EndpointName is the human-readable/friedly name of an Endpoint
type Repository ¶
type Repository interface { // Save saves a Service Save(s *Service) error // FindByCode finds a Service by its Code FindByCode(code Code) (*Service, error) }
Repository is a Service repository. It is a classic "Domain Driven Design" repository - the mental model is that it represents a collection of models.Service instances
func NewRepository ¶
func NewRepository( dbURL *dburl.URL, db *sqlx.DB, logger *zap.SugaredLogger, ) Repository
type Service ¶
type Service struct { // ID uniquely identifies this service ID *int64 // Code is a unique code for the service. For example, "location_tracking" for a location tracking service Code Code // Name is a friendly name for the service. For example, "Location Tracking" for a location tracking service Name Name // Endpoints is a list of Endpoints that the Service has Endpoints []Endpoint }
Service represents a service
Click to show internal directories.
Click to hide internal directories.