initial commit

This commit is contained in:
2026-04-02 01:53:35 -04:00
commit 82bb5a6356
5 changed files with 123 additions and 0 deletions

19
apiresponse.go Normal file
View File

@@ -0,0 +1,19 @@
package libshared
import "time"
type APIResponse[T any] struct {
Timestamp int64 `json:"timestamp"`
Status string `json:"status"` // "success" or "fail"
Message string `json:"message"`
Content T `json:"content,omitempty"`
}
func NewAPIResponse[T any](status string, message string, response T) APIResponse[T] {
return APIResponse[T]{
Timestamp: time.Now().Unix(),
Status: status,
Message: message,
Content: response,
}
}