Spaces:
Runtime error
Runtime error
Download services/service.go from lifedebugger/quzuu-api-dev: direct link, hf CLI and curl.
- Browser
- Download file 869 Bytes
-
https://huggingface.co/spaces/lifedebugger/quzuu-api-dev/resolve/main/services/service.go
- Command line
-
hf download hf://spaces/lifedebugger/quzuu-api-dev/services/service.go
-
curl -L -o service.go https://huggingface.co/spaces/lifedebugger/quzuu-api-dev/resolve/main/services/service.go
869 Bytes
| package services | |
| import ( | |
| "time" | |
| "godp.abdanhafidz.com/models" | |
| "godp.abdanhafidz.com/repositories" | |
| ) | |
| type ( | |
| Services interface { | |
| Retrieve() | |
| Update() | |
| Create() | |
| Delete() | |
| Validate() | |
| Authenticate() | |
| Authorize() | |
| } | |
| IService interface { | |
| Implements() | |
| } | |
| Service[TConstructor any, TResult any] struct { | |
| Constructor TConstructor | |
| Result TResult | |
| Exception models.Exception | |
| Error error | |
| MetaData repositories.PaginationMetadata | |
| } | |
| ) | |
| func Construct[TConstructor any, TResult any](constructor ...TConstructor) *Service[TConstructor, TResult] { | |
| if len(constructor) == 1 { | |
| return &Service[TConstructor, TResult]{} | |
| } | |
| return &Service[TConstructor, TResult]{ | |
| Constructor: constructor[0], | |
| } | |
| } | |
| func CalculateDueTime(duration time.Duration) time.Time { | |
| return time.Now().Add(duration) | |
| } | |