requestHandler

package module
v0.0.0-...-00aac1f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2023 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Request Handler

Build Status

Request handler is a package extend from net/http. It provides HTTP client and server implementations easier.

  • Get, Head, Post, and PostForm make HTTP (or HTTPS) requests
  • Clients and Transports are safe for concurrent use by multiple goroutines and for efficiency should only be created once and re-used.
This project is deprecated. It has moved to github.com/onskycloud/request-handler

Getting Started!

Model input
type RequestModel struct {
  URL       string
  TokenType TokenType
  Token     string
  Username  string
  Password  string
  Body      string
}
Installation

Request handler requires Go v1.11+ to run.

Install the package.

$ go get github.com/nguyencatpham/request-handler
Kubernetes + Google Cloud

See KUBERNETES.md

Todos
  • Write MORE Tests
  • Add Night Mode

License

MIT

Documentation

Index

Constants

View Source
const (
	Basic = iota
	Bearer
)

const of token type

Variables

This section is empty.

Functions

func Base

func Base(requestModel RequestModel, result *interface{}) error

Base request

func Delete

func Delete(requestModel RequestModel, result *interface{}) error

Delete request

func Get

func Get(requestModel RequestModel, result *interface{}) error

Get request

func Patch

func Patch(requestModel RequestModel, result *interface{}) error

Patch request

func Post

func Post(requestModel RequestModel, result *interface{}) error

Post request

func Put

func Put(requestModel RequestModel, result *interface{}) error

Put request

Types

type RequestModel

type RequestModel struct {
	URL       string
	TokenType TokenType
	Token     string
	Username  string
	Password  string
	Body      string
	Type      string
}

RequestModel model

type TokenType

type TokenType int8

TokenType type of token

func (TokenType) String

func (s TokenType) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL