server

package
v0.0.0-...-a6db137 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReloadFunc

type ReloadFunc func(cfg *configuration.Config, client *http.Client) (string, error)

type SendSIPMessage

type SendSIPMessage func(*data.SIPRequest) (*data.SIPResponse, error)

type Server

type Server struct {
	Version    *data.Version
	Config     *configuration.Config
	ConfigPath string // optional when using config file
	Client     *http.Client

	RuntimeInfo   *data.RuntimeInfo
	Records       *data.Records
	Updates       *data.Updates
	Exporters     map[string]exporter.Exporter
	RegisterCache *data.TTLCache[string, *data.SIPClient]

	ReloadFn       ReloadFunc
	SendSIPMessage SendSIPMessage

	Tmpls *template.Template
}

func NewServer

func NewServer(
	cfg *configuration.Config, cfgPath string, version *data.Version, records *data.Records, runtimeInfo *data.RuntimeInfo,
	exporters map[string]exporter.Exporter, updates *data.Updates, refreshRecords ReloadFunc, sendSIPMessage SendSIPMessage,
	registerCache *data.TTLCache[string, *data.SIPClient], tmpls *template.Template, client *http.Client) *Server

func (*Server) BasicAuth

func (s *Server) BasicAuth(next http.HandlerFunc) http.HandlerFunc

func (*Server) Index

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

func (*Server) Info

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

func (*Server) ReloadPhonebook

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

func (*Server) SendMessage

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

func (*Server) ServePhonebook

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

func (*Server) ShowConfig

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

func (*Server) UpdateConfig

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

Jump to

Keyboard shortcuts

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