controller

package
v0.0.0-...-bf7994e Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultController

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

func NewHTTPController

func NewHTTPController(config configpackage.Configuration, logger loggerpackage.Logger, res HTTPResponse) (defaultController *DefaultController)

func (*DefaultController) About

func (*DefaultController) CrawlpageList

func (u *DefaultController) CrawlpageList(w http.ResponseWriter, r *http.Request)

func (*DefaultController) CrawlpageListParsed

func (u *DefaultController) CrawlpageListParsed(w http.ResponseWriter, r *http.Request)

func (*DefaultController) DatabasePing

func (u *DefaultController) DatabasePing(w http.ResponseWriter, r *http.Request)

func (*DefaultController) NewCrawlerService

func (c *DefaultController) NewCrawlerService(service service.CrawlerService)

func (*DefaultController) Options

func (u *DefaultController) Options(w http.ResponseWriter, r *http.Request)

func (*DefaultController) Root

func (*DefaultController) ServeFile

func (u *DefaultController) ServeFile(w http.ResponseWriter, r *http.Request)

func (*DefaultController) StartCrawling

func (u *DefaultController) StartCrawling(w http.ResponseWriter, r *http.Request)

func (*DefaultController) StartMultipleCrawling

func (u *DefaultController) StartMultipleCrawling(w http.ResponseWriter, r *http.Request)

func (*DefaultController) StopCrawling

func (u *DefaultController) StopCrawling(w http.ResponseWriter, r *http.Request)

type DefaultHTTPResponse

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

func NewHTTPResponse

func NewHTTPResponse(logger logger.Logger) *DefaultHTTPResponse

func (*DefaultHTTPResponse) CustomResponse

func (res *DefaultHTTPResponse) CustomResponse(w http.ResponseWriter, r *http.Request, prefixLog string, msg string, any any)

func (*DefaultHTTPResponse) Default

func (res *DefaultHTTPResponse) Default(w http.ResponseWriter, httpStatus int, status bool, msg string)

func (*DefaultHTTPResponse) DefaultText

func (res *DefaultHTTPResponse) DefaultText(w http.ResponseWriter, httpStatus int, status bool, msg string)

func (*DefaultHTTPResponse) Error

func (res *DefaultHTTPResponse) Error(w http.ResponseWriter, r *http.Request, err error, prefixLog string, errMsg string)

func (*DefaultHTTPResponse) Forbidden

func (res *DefaultHTTPResponse) Forbidden(w http.ResponseWriter, r *http.Request, err error, prefixLog string, msg string)

func (*DefaultHTTPResponse) Panic

func (*DefaultHTTPResponse) StreamingResponse

func (res *DefaultHTTPResponse) StreamingResponse(w http.ResponseWriter, prefixLog string, response chan any)

type HTTPController

type HTTPController interface {
	Root(w http.ResponseWriter, r *http.Request)
	Options(w http.ResponseWriter, r *http.Request)
	About(w http.ResponseWriter, r *http.Request)
	ServeFile(w http.ResponseWriter, r *http.Request)
	DatabasePing(w http.ResponseWriter, r *http.Request)
	StartCrawling(w http.ResponseWriter, r *http.Request)
	StartMultipleCrawling(w http.ResponseWriter, r *http.Request)
	StopCrawling(w http.ResponseWriter, r *http.Request)
	CrawlpageList(w http.ResponseWriter, r *http.Request)
	CrawlpageListParsed(w http.ResponseWriter, r *http.Request)
}

type HTTPResponse

type HTTPResponse interface {
	Error(w http.ResponseWriter, r *http.Request, err error, prefixLog string, errMsg string)
	Panic(w http.ResponseWriter, r *http.Request)
	Default(w http.ResponseWriter, httpStatus int, status bool, msg string)
	DefaultText(w http.ResponseWriter, httpStatus int, status bool, msg string)
	Forbidden(w http.ResponseWriter, r *http.Request, err error, prefixLog, msg string)
	CustomResponse(w http.ResponseWriter, r *http.Request, prefixLog string, msg string, any any)
	StreamingResponse(w http.ResponseWriter, prefixLog string, response chan any)
}

type JsonRs

type JsonRs struct {
	Sc  int    `json:"sc"`
	St  bool   `json:"st"`
	Msg string `json:"msg"`
}

type JsonRsCustom

type JsonRsCustom struct {
	Sc   int    `json:"sc"`
	St   bool   `json:"st"`
	Msg  string `json:"msg"`
	Data any    `json:"data"`
}

Jump to

Keyboard shortcuts

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