app

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Server  *Server
	Handler *Handler
}

App is the application struct

func NewApp

func NewApp(c *Config, db *gorm.DB) (*App, error)

NewApp creates a new App

func (*App) Run

func (a *App) Run()

type Config

type Config struct {
	DBProvider string
	DBDSN      string
	DBMigrate  bool

	HttpListener   string
	BasicAuthUsers map[string]string

	EnableTracing bool
	TracingTarget string
}

Config type for config

type Handler

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

func NewHandler

func NewHandler(enableTracing bool, db *gorm.DB) *Handler

func (*Handler) HandleEvent

func (h *Handler) HandleEvent(data models.EventData) error

func (*Handler) HandleEvents

func (h *Handler) HandleEvents(eventChan chan models.EventData) error

HandleEvents blocks on the queue and handles events

type Server

type Server struct {
	EventChan chan<- models.EventData
	// contains filtered or unexported fields
}

Server is the main webserver struct

func NewServer

func NewServer(cfg *Config) *Server

NewServer creates a server that receives CloudEvents from the network

func (*Server) HandleHealthCheck added in v0.3.3

func (s *Server) HandleHealthCheck(w http.ResponseWriter, r *http.Request)

func (*Server) HandleWebhook added in v0.3.3

func (s *Server) HandleWebhook(w http.ResponseWriter, r *http.Request)

func (*Server) Start

func (s *Server) Start()

Start starts the server and listens for incoming events

func (*Server) WithEventChannel

func (s *Server) WithEventChannel(eventChan chan<- models.EventData) *Server

WithEventChannel sets the event channel for the server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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