Documentation
¶
Index ¶
- func NewRequestByContext(ctx context.Context, ectx *fasthttp.RequestCtx) (adtype.BidRequester, error)
- func NewRequestFor(ctx context.Context, app *admodels.Application, target adtype.Target, ...) adtype.BidRequester
- type Endpoint
- type Extension
- type Option
- func WithAdvertisementSource(source Source) Option
- func WithAppAccessor(appAccessor appAccessor) Option
- func WithFormatAccessor(formatAccessor types.FormatsAccessor) Option
- func WithHTTPHandlerWrapper(handlerWrapper *httphandler.HTTPHandlerWrapper) Option
- func WithSendpoints(endpoints ...Endpoint) Option
- func WithSpy(spy middleware.Spy) Option
- func WithURLQueryPattern(pattern string) Option
- func WithZoneAccessor(zoneAccessor zoneAccessor) Option
- type RequestOptions
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRequestByContext ¶
func NewRequestByContext(ctx context.Context, ectx *fasthttp.RequestCtx) (adtype.BidRequester, error)
NewRequestByContext from request
func NewRequestFor ¶
func NewRequestFor( ctx context.Context, app *admodels.Application, target adtype.Target, person personification.Person, opt *RequestOptions, formatAccessor types.FormatsAccessor, ) adtype.BidRequester
NewRequestFor specific person
Types ¶
type Endpoint ¶
type Endpoint interface {
// Codename of the endpoint
Codename() string
// Handle request and process response
Handle(source Source, bidRequest adtype.BidRequester) adtype.Response
}
Endpoint implementation
type Extension ¶
type Extension struct {
// URL query pattern like `/b/{endpoint}/{zone}` by default
URLQueryPattern string
// contains filtered or unexported fields
}
Extension of the server
func (*Extension) InitRouter ¶
func (ext *Extension) InitRouter(ctx context.Context, router *router.Router, tracer opentracing.Tracer)
InitRouter of the HTTP server
type Option ¶
type Option func(ext *Extension)
Option type
func WithAdvertisementSource ¶
WithAdvertisementSource accessor
func WithFormatAccessor ¶
func WithFormatAccessor(formatAccessor types.FormatsAccessor) Option
WithFormatAccessor setter
func WithHTTPHandlerWrapper ¶
func WithHTTPHandlerWrapper(handlerWrapper *httphandler.HTTPHandlerWrapper) Option
WithHTTPHandlerWrapper setter
func WithURLQueryPattern ¶
WithURLQueryPattern setter
func WithZoneAccessor ¶
func WithZoneAccessor(zoneAccessor zoneAccessor) Option
WithZoneAccessor setter
type RequestOptions ¶
type RequestOptions struct {
Debug bool
Request *fasthttp.RequestCtx
Count int
X, Y int
Width int
WidthMax int
Height int
HeightMax int
Page string
Keywords string
FormatCodes []string
FormatTypes []string
SubID1 string
SubID2 string
SubID3 string
SubID4 string
SubID5 string
}
RequestOptions prepare
func NewDirectRequestOptions ¶
func NewDirectRequestOptions(ctx *fasthttp.RequestCtx) *RequestOptions
NewDirectRequestOptions prepare
func NewRequestOptions ¶
func NewRequestOptions(ctx *fasthttp.RequestCtx) *RequestOptions
NewRequestOptions prepare
func (*RequestOptions) GetFormatTypes ¶
func (opt *RequestOptions) GetFormatTypes() types.FormatTypeBitset
GetFormatTypes prepare by request codes
Click to show internal directories.
Click to hide internal directories.