Skip to content

Commit

Permalink
♻️ refactor: refactor codebase #2
Browse files Browse the repository at this point in the history
  • Loading branch information
pnguyen215 committed Dec 14, 2024
1 parent e275e8e commit 733339e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions init.go
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,15 @@ func (w *wrapper) Respond() map[string]interface{} {
return m
}

// R represents a wrapper around the main `wrapper` struct. It is used as a high-level
// abstraction to provide a simplified interface for handling API responses.
// The `R` type allows for easier manipulation of the wrapped data, metadata, and other
// response components, while maintaining the flexibility of the underlying `wrapper` structure.
//
// Example usage:
//
// var response wrapify.R = wrapify.NewWrap().Reply()
// fmt.Println(response.Json()) // Prints the wrapped response details, including data, headers, and metadata.
func (w *wrapper) Reply() R {
return R{wrapper: w}
}
Expand Down
4 changes: 4 additions & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ package wrapify

import "time"

// R represents a wrapper around the main `wrapper` struct. It is used as a high-level
// abstraction to provide a simplified interface for handling API responses.
// The `R` type allows for easier manipulation of the wrapped data, metadata, and other
// response components, while maintaining the flexibility of the underlying `wrapper` structure.
type R struct {
*wrapper
}
Expand Down

0 comments on commit 733339e

Please sign in to comment.