barkserv

package
v0.0.0-...-74b8911 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//Package wide logger for logging bark errors etc.
	BarkLogger *log.Logger
)

Functions

func DataFromFakeJwt

func DataFromFakeJwt(authHead string) ([]byte, error)

Strips the fakestuff off the Auth header JWT. Pass the authheader data from a barkmessage and get back the encrypted access token as []byte.

func NewRoutes

func NewRoutes(xi *chi.Mux, rconf *RouterConf)

func SetWebLogger

func SetWebLogger(path string)

Specifies the path for the barkweblog, please include full path with filename e.g. /path/to/logfile.log and not /path/to/

Types

type RouterConf

type RouterConf struct {
	//URLS to register & their respective handlers
	Taskuris []string
	Taskfunc http.HandlerFunc
	Outuris  []string
	Outfunc  http.HandlerFunc
	Reguris  []string
	Regfunc  http.HandlerFunc
}

func NewBarkRouter

func NewBarkRouter(reguris, taskuris, outputuris []string) RouterConf

Create a new BarkServ router config with specified URIs. Handler funcs must be specified.

type Server

type Server struct {
	Server     *http.Server
	Routes     *RouterConf
	TLS        *TLSConf
	Xi         *chi.Mux
	QuicServer *http3.Server
	Quic       bool
	LogPath    string
}

func NewBarkServHTTP

func NewBarkServHTTP(rconf RouterConf) Server

Create a new BarkServ with HTTP Defaults

func NewBarkServHTTPS

func NewBarkServHTTPS(tlscert, tlskey string, rconf RouterConf) Server

Create a new BarkServ with HTTPS Defaults

func NewBarkServQUIC

func NewBarkServQUIC(tlscert, tlskey string, rconf RouterConf) Server

Create a new BarkServ with QUIC defaults

func (*Server) StartListener

func (l *Server) StartListener(address string)

func (*Server) StopListener

func (l *Server) StopListener()

Stop listeners

type TLSConf

type TLSConf struct {
	//TLS settings
	Certpub string
	Certkey string
}

Jump to

Keyboard shortcuts

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