server

package
v0.0.0-...-0822660 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockDevice

type BlockDevice struct {
	RawSize   uint64
	Block     string
	Removable bool

	// filled by mountInfo
	Mount string
	Type  string

	// filled by sizeInfo
	All     uint64
	Used    uint64
	Free    uint64
	TInodes uint64
	FInodes uint64
	// contains filtered or unexported fields
}

type DBusAction

type DBusAction func(context.Context, string, string, chan<- string) (int, error)

type Server

type Server struct {
	Log          *logrus.Logger
	Router       *chi.Mux
	AssetHandler StaticHandler
	HTTP         *http.Server
	DB           *badger.DB
	DBus         *dbus.Conn
	Pod          podman.Conn
}

func New

func New(log *logrus.Logger, port int, sh StaticHandler, db *badger.DB, dc *dbus.Conn, pc podman.Conn, devMode bool) (*Server, error)

func (*Server) SetupRoutes

func (s *Server) SetupRoutes()

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

func (*Server) SvcHandlerAction

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

func (*Server) SvcHandlerCreate

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

func (*Server) SvcHandlerDelete

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

func (*Server) SvcHandlerGet

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

func (*Server) SvcHandlerList

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

func (*Server) SvcHandlerSearch

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

func (*Server) SystemGetDisk

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

func (*Server) SystemGetMemory

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

func (*Server) SystemGetVersions

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

func (*Server) SystemReloadSysD

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

func (*Server) WebsocketHandler

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

type StaticHandler

type StaticHandler http.Handler

type Svc

type Svc struct {
	Name      string `json:"name"`
	CreatedAt int64  `json:"created_at"`
}

Jump to

Keyboard shortcuts

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