api

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: AGPL-3.0, Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ListenAddress string `toml:"listen_address"`
	TLS           TLSConfig
}

func (Config) IsValid

func (c Config) IsValid() error

type HandleFunc

type HandleFunc func(http.ResponseWriter, *http.Request)

type Server

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

func NewServer

func NewServer(cfg Config, log mlog.LoggerIFace) (*Server, error)

func (*Server) Addr

func (s *Server) Addr() string

func (*Server) RegisterHandleFunc

func (s *Server) RegisterHandleFunc(path string, hf HandleFunc)

func (*Server) RegisterHandler

func (s *Server) RegisterHandler(path string, handler http.Handler)

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop() error

type TLSConfig

type TLSConfig struct {
	Enable   bool
	CertFile string `toml:"cert_file"`
	CertKey  string `toml:"cert_key"`
}

func (TLSConfig) IsValid

func (c TLSConfig) IsValid() error

Jump to

Keyboard shortcuts

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