http

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: MIT Imports: 14 Imported by: 7

Documentation

Index

Constants

View Source
const (
	OpenapiPath_GetToken = "/auth/v1/appToken"
)

Variables

This section is empty.

Functions

func AppTokenMiddleware

func AppTokenMiddleware(req *http.Request) error

func GetAppToken

func GetAppToken() (string, error)

func ServiceIDMiddleware added in v0.0.4

func ServiceIDMiddleware(req *http.Request) error

func TenantAndUserMiddleware added in v0.0.4

func TenantAndUserMiddleware(req *http.Request) error

Types

type HttpClient

type HttpClient struct {
	http.Client
	Url string
}

func GetOpenapiClient

func GetOpenapiClient() *HttpClient

func (*HttpClient) DeleteJson

func (c *HttpClient) DeleteJson(path string, headers map[string][]string, data interface{}, mids ...ReqMiddleWare) ([]byte, error)

func (*HttpClient) Get

func (c *HttpClient) Get(path string, headers map[string][]string, mids ...ReqMiddleWare) ([]byte, error)

func (*HttpClient) PatchJson

func (c *HttpClient) PatchJson(path string, headers map[string][]string, data interface{}, mids ...ReqMiddleWare) ([]byte, error)

func (*HttpClient) PostBson added in v0.0.4

func (c *HttpClient) PostBson(path string, headers map[string][]string, data interface{}, mids ...ReqMiddleWare) ([]byte, error)

func (*HttpClient) PostFormData

func (c *HttpClient) PostFormData(path string, headers map[string][]string, body *bytes.Buffer, mids ...ReqMiddleWare) ([]byte, error)

func (*HttpClient) PostJson

func (c *HttpClient) PostJson(path string, headers map[string][]string, data interface{}, mids ...ReqMiddleWare) ([]byte, error)

type ReqMiddleWare

type ReqMiddleWare func(req *http.Request) error

Jump to

Keyboard shortcuts

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