httpserver

package
v0.0.0-...-6a3b762 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: AGPL-3.0 Imports: 17 Imported by: 1

Documentation

Overview

package httpserver provides basic HTTP server with DSP handlers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct{}

Metrics of the HTTP server

type Option

type Option func(srv *Server)

Option type

func WithCustomHTTPServer

func WithCustomHTTPServer(server *fasthttp.Server) Option

WithCustomHTTPServer setup customly configured server

func WithCustomRouter

func WithCustomRouter(fouterFnk customRouterFnk) Option

WithCustomRouter registrator

func WithDebugMode

func WithDebugMode(debug bool) Option

WithDebugMode of the server

func WithExtensions

func WithExtensions(exts ...extensions.ServerExtension) Option

WithExtensions setup custom

func WithLogger

func WithLogger(logger *zap.Logger) Option

WithLogger interface

func WithServiceName

func WithServiceName(name string) Option

WithServiceName which represents the internal name of the service

type Server

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

Server implements basic HTTP infostructure and routing

func NewServer

func NewServer(options ...Option) (*Server, error)

NewServer http server object

func (*Server) IsShutdownMode

func (srv *Server) IsShutdownMode() bool

IsShutdownMode on or off

func (*Server) Listen

func (srv *Server) Listen(ctx context.Context, address string) (err error)

Listen server address

func (*Server) Shutdown

func (srv *Server) Shutdown()

Shutdown server gracefully

type Source

type Source interface {
	// Bid request for standart system filter
	Bid(request *adtype.BidRequest) adtype.Responser

	// ProcessResponse when need to fix the result and process all counters
	ProcessResponse(response adtype.Responser)
}

Source of advertisement

Directories

Path Synopsis
wrappers

Jump to

Keyboard shortcuts

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