ctrl

package
v0.0.0-...-55c0a6c Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIMEREGEX = ".*/json.*"
)

Variables

This section is empty.

Functions

func SetupHeader

func SetupHeader(w http.ResponseWriter)

func StartControllServer

func StartControllServer(cfg *ControllServerConfiguration) chan bool

Types

type AppHandle

type AppHandle struct {
	Help           map[string]string
	PortalIntalled bool
}

func (*AppHandle) HandleHttpState

func (h *AppHandle) HandleHttpState(r *Request, w http.ResponseWriter)

func (*AppHandle) HandlePortalState

func (h *AppHandle) HandlePortalState(r *Request, w http.ResponseWriter)

func (*AppHandle) LogCommand

func (h *AppHandle) LogCommand(r *Request)

func (*AppHandle) StartPortalParts

func (h *AppHandle) StartPortalParts()

type ControllServer

type ControllServer struct {
	Mux    *http.ServeMux
	Srv    *graceful.Server
	Cfg    *ControllServerConfiguration
	Portal *server_old.Portal
	Key    *rsa.PrivateKey
	CtrlLn net.Listener
	Logger *log.Logger
}

func (*ControllServer) SetupHandlers

func (c *ControllServer) SetupHandlers() *http.ServeMux

type ControllServerConfiguration

type ControllServerConfiguration struct {
	ListenPort           uint
	ServerKeyPath        string
	StorageConfiguration *data.InitialConfiguration
	CtrlServerLogFile    string
	CtrlServerConfig     string
	StaticHttpConfig     *serverold.HttpFrontendConfiguration
	HttpsConfig          *config.PortalHttpsConfiguration
	PkiConfig            *pki.PKIConfiguration
}

func GetControllServerDefaultConfig

func GetControllServerDefaultConfig() (*ControllServerConfiguration, error)

func (*ControllServerConfiguration) SetBasePath

func (cfg *ControllServerConfiguration) SetBasePath(path string) error

type CtrlHandle

type CtrlHandle struct {
}

func (CtrlHandle) Default

func (h CtrlHandle) Default(r *Request, w http.ResponseWriter)

type HandlerFunc

type HandlerFunc func(*Request, http.ResponseWriter)

type Request

type Request struct {
	Command   string
	Signature []byte
	Parameter map[string]string
	Date      time.Time
}

type StatusResponse

type StatusResponse struct {
	ListenPort    uint
	CfgPath       string
	KeyPath       string
	CtrlRunning   bool
	HttpRunning   bool
	AuthRunning   bool
	PortalRunning bool
}

type StorageHandle

type StorageHandle struct {
	StorageOnline bool
}

func NewStorageHandle

func NewStorageHandle() *StorageHandle

func (*StorageHandle) CheckStorage

func (s *StorageHandle) CheckStorage()

func (*StorageHandle) ControllStorage

func (h *StorageHandle) ControllStorage(r *Request, w http.ResponseWriter)

func (StorageHandle) ServeHTTP

func (h StorageHandle) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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