8000 GitHub - lordvidex/x: eXtra utilities saving you from oVerbosity 😂
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/ x Public

eXtra utilities saving you from oVerbosity 😂

Notifications You must be signed in to change notification settings

lordvidex/x

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

x

Highly opinionated lib that contains utility functions.

Content

  • req/: HTTP request utility
  • res/: HTTP response utility
  • ptr/: Conversion of object from and to pointer values (one-liners without nil checks)
  • auth/: Passing tokens across app layers with context.Context

Motivation

Some verbose operations in Golang can distract and take one's mind off the business logic and to solve this, I create util functions to pkg/ to reduce repetition. This was okay, until I had to work on many HTTP projects.

I have created this package to reduce repetitive copying of my pkg/ helper functions from project to project.

Inspiration

Package Naming

  • I've named the package lordvidex/x because many of the functionalities that are either upgrades or that the Go (Golang) maintainers wish were in the standard library are typically placed in the golang.org/x package.
  • Package name lordvidex/x is relatively short, thereby easy to remember and import

API and Design Goals

err := req.I().Will().Bind(r, &v).Validate(v).Err()
  • Functions should be designed in a way that it feels as natural as speaking English language.
  • Functions should reduce boilerplate code required to parse and validate JSON.

Future Plans

Extensibility

  • Use interfaces where necessary for req/
  • More flexible response struct in res/
  • Add more functions that are often repeated.

About

eXtra utilities saving you from oVerbosity 😂

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

0