web

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPageNumber

func GetPageNumber(c *gin.Context) int

GetPageNumber : returns the page number from the request.

func HandleAPICallToPage

func HandleAPICallToPage(c *gin.Context, page *html.Page, result api.Result, ok bool) bool

HandleAPICallToPage : returns true if this function handles the result of the API call, else returns false.

func HandleAPICallToPartialPage

func HandleAPICallToPartialPage(c *gin.Context, result api.Result, ok bool) bool

HandleAPICallToPartialPage : returns true if this function handles the result of the API call, else returns false.

Types

type Handlers

type Handlers struct {
	RecurringTasks               func()
	APIMiddlewares               []api.ResponseHandlerFunc
	RouterConfigureDefaultRoutes route.ConfigureDefaultRoutes
}

Handlers : list of the functions of an API.

type Pagination

type Pagination struct {
	CountOfPages int
	Pages        []int
	TotalItems   int
	ItemsPerPage int
	CurrentPage  int
	PreviousPage int
	NextPage     int
}

Pagination : properties of a Pagination struct.

func GetPagination

func GetPagination(countOfItems, itemsPerPage, currentPage int) Pagination

GetPagination : returns an initialized Pagination struct.

type Server

type Server struct {
	RoutesFile string
	Functions  Handlers
	// contains filtered or unexported fields
}

Server : definition of an web server.

func NewServer

func NewServer() *Server

NewServer : returns a new struct 'Server'.

func (*Server) AddCustomRoutes

func (s *Server) AddCustomRoutes(configuration route.ConfigureCustomRoutes)

AddCustomRoutes : adds some suctom routes.

func (*Server) CreateKafkaConsumers

func (s *Server) CreateKafkaConsumers() []kafka.MessageConsumer

CreateKafkaConsumers return an array of kafka consumers.

func (*Server) Start

func (s *Server) Start()

Start start the worker.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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