ads

package
v0.0.0-...-85f63e2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdClient

type AdClient struct {
	http.RoundTripper
	Cfg *conf.AdConfig

	ApiVersion string
	Client     *api.APIClient
	// contains filtered or unexported fields
}

func Init

func Init(debug bool) *AdClient

func (*AdClient) AppendMiddleware

func (c *AdClient) AppendMiddleware(middleware Middleware)

func (*AdClient) GenMiddlewareHandleFunc

func (c *AdClient) GenMiddlewareHandleFunc(middleware Middleware, beforeFunc func(req *http.Request) (rsp *http.Response, err error),
) func(req *http.Request) (rsp *http.Response, err error)

GenMiddlewareHandleFunc ...

func (*AdClient) IsDebug

func (c *AdClient) IsDebug() bool

func (*AdClient) RoundTrip

func (c *AdClient) RoundTrip(req *http.Request) (rsp *http.Response, err error)

func (*AdClient) SetDebug

func (c *AdClient) SetDebug(b bool)

func (*AdClient) SetHeader

func (c *AdClient) SetHeader(key string, value string)

func (*AdClient) SetHeaders

func (c *AdClient) SetHeaders(header http.Header)

func (*AdClient) SetHost

func (c *AdClient) SetHost(schema, host, apiVersion string)

func (*AdClient) UseProduction

func (c *AdClient) UseProduction()

func (*AdClient) UseSandbox

func (c *AdClient) UseSandbox()

type LogMiddleware

type LogMiddleware struct {
	// contains filtered or unexported fields
}

LogMiddleware ...

func NewLogMiddleware

func NewLogMiddleware(c *AdClient, f io.Writer) *LogMiddleware

func (*LogMiddleware) Handle

func (l *LogMiddleware) Handle(req *http.Request, next func(req *http.Request) (rsp *http.Response, err error)) (rsp *http.Response, err error)

Handle ...

type Middleware

type Middleware interface {
	Handle(req *http.Request, next func(req *http.Request) (rsp *http.Response, err error)) (rsp *http.Response, err error)
}

Jump to

Keyboard shortcuts

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