server

package
v0.0.0-...-157c9c8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TimeoutDuration = time.Second * 5

Functions

This section is empty.

Types

type AdminLockUserCreationReq

type AdminLockUserCreationReq struct {
	AdminLockUserCreation bool
}

type AdminLockUserCreationResp

type AdminLockUserCreationResp struct{}

type Config

type Config struct {
	SessionStore sessions.Store
	Templates    *template.Template
	UserStore    store.Factory
	TemplateNames
	Addr          string
	Socket        string
	ServiceSocket string
	Host          string
}

Config is used to create a Server. It holds all the configuration values. This follows the builder pattern instead of using a function that would take many arguments.

func (*Config) New

func (c *Config) New() (*Server, error)

New Server using the values from the Config.

type CreateUserReq

type CreateUserReq struct {
	Name, Password string
}

type CreateUserResp

type CreateUserResp struct {
	Error error
}

type GroupReq

type GroupReq struct {
	Name string
}

type GroupResp

type GroupResp struct {
	Error error
}

type ListGroupsReq

type ListGroupsReq struct{}

type ListGroupsResp

type ListGroupsResp []string

type ListUsersReq

type ListUsersReq struct{}

type ListUsersResp

type ListUsersResp []string

type Server

type Server struct {
	Router        *mux.Router
	Addr          string
	Users         *lusess.Store
	Settings      Settings
	Templates     *template.Template
	Socket        string
	ServiceSocket string
	TemplateNames

	lerr.ErrHandler
	// contains filtered or unexported fields
}

Server runs a webserver.

func (*Server) Cli

func (s *Server) Cli(ctx cli.Context, onExit func())

func (*Server) Close

func (s *Server) Close() error

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

func (*Server) Run

func (s *Server) Run()

Run the server. If Socket or ServiceSocket is defined, they will be run as well.

func (*Server) RunServiceSocket

func (s *Server) RunServiceSocket() error

func (*Server) RunSocket

func (s *Server) RunSocket()

RunSocket for the admin interface. This is not invoked by ListenAndServe and needs to be run seperately.

type SetPortReq

type SetPortReq struct {
	Port string
}

type SetPortResp

type SetPortResp struct{}

type Settings

type Settings struct {
	AdminLockUserCreation bool
}

type SettingsReq

type SettingsReq struct{}

type TemplateNames

type TemplateNames struct {
	SignIn       string
	Home         string
	HomeSignedIn string
}

type UserGroupReq

type UserGroupReq struct {
	User, Group string
}

type UserGroupResp

type UserGroupResp struct {
	Error error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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