Documentation
¶
Index ¶
- func AbortError(handler ssh.Handler, session ssh.Session, err error)
- func Abortf(handler ssh.Handler, session ssh.Session, f string, args ...any)
- func ErrorHandler(handler ssh.Handler) ssh.Handler
- func NewCommandsHandler(params *CommandsHandlerParams) wish.Middleware
- func NewLoggerMiddleware(lg zerolog.Logger) wish.Middleware
- func PanicHandler(handler ssh.Handler) ssh.Handler
- type CommandsHandlerParams
- type Context
- type PublicKeyCmd
- type Server
- type ServerParams
- type WireGuardCmd
- func (cmd *WireGuardCmd) HandleAdd(ctx *Context) (err error)
- func (cmd *WireGuardCmd) HandleGet(ctx *Context) (err error)
- func (*WireGuardCmd) HandleLs(ctx *Context) (err error)
- func (*WireGuardCmd) HandleReload(ctx *Context) (err error)
- func (cmd *WireGuardCmd) HandleRm(ctx *Context) (err error)
- func (cmd *WireGuardCmd) Run(ctx *Context) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCommandsHandler ¶
func NewCommandsHandler(params *CommandsHandlerParams) wish.Middleware
func NewLoggerMiddleware ¶
func NewLoggerMiddleware(lg zerolog.Logger) wish.Middleware
Types ¶
type CommandsHandlerParams ¶
type CommandsHandlerParams struct {
Logger zerolog.Logger
PublicKeyService service.PublicKeyService
WireGuardService service.WireGuardService
}
type PublicKeyCmd ¶
type PublicKeyCmd struct {
Add struct {
Key string `arg:"" help:"Public key to be added."`
} `cmd:"" help:"Add public key."`
Rm struct {
Key string `arg:"" help:"Public key to be removed."`
} `cmd:"" help:"Remove public key."`
Ls struct{} `cmd:"" help:"List public keys."`
}
func (*PublicKeyCmd) HandleAdd ¶
func (cmd *PublicKeyCmd) HandleAdd(ctx *Context) (err error)
func (*PublicKeyCmd) HandleLs ¶
func (*PublicKeyCmd) HandleLs(ctx *Context) (err error)
func (*PublicKeyCmd) HandleRm ¶
func (cmd *PublicKeyCmd) HandleRm(ctx *Context) (err error)
func (*PublicKeyCmd) Run ¶
func (cmd *PublicKeyCmd) Run(ctx *Context) (err error)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func New ¶
func New(params *ServerParams) (srv *Server, err error)
type ServerParams ¶
type ServerParams struct {
Logger zerolog.Logger
Port int
HostKeyPath string
PublicKeyService service.PublicKeyService
WireGuardService service.WireGuardService
}
type WireGuardCmd ¶
type WireGuardCmd struct {
Add struct {
Name string `arg:"" help:"Client's name."`
Address null.String `optional:"" short:"a" placeholder:"ADDR" help:"Client's address."`
DNS []string `optional:"" short:"d" help:"Client's DNS list."`
AllowedIPs []string `optional:"" short:"i" name:"ips" placeholder:"IP" help:"Client's allowed IPs."`
PersistentKeepalive null.Int `optional:"" short:"k" name:"keepalive" placeholder:"SECONDS" help:"Client's persistent keepalive."`
QR bool `optional:"" name:"qr" help:"Print QR code."`
} `cmd:"" help:"Add client."`
Get struct {
Name string `arg:"" help:"Client's name."`
QR bool `optional:"" name:"qr" help:"Print QR code."`
} `cmd:"" help:"Get client config."`
Rm struct {
Name string `arg:"" help:"Client's name."`
} `cmd:"" help:"Remove client."`
Reload struct{} `cmd:"" help:"Reload server."`
Ls struct{} `cmd:"" help:"List clients."`
}
func (*WireGuardCmd) HandleAdd ¶
func (cmd *WireGuardCmd) HandleAdd(ctx *Context) (err error)
func (*WireGuardCmd) HandleGet ¶
func (cmd *WireGuardCmd) HandleGet(ctx *Context) (err error)
func (*WireGuardCmd) HandleLs ¶
func (*WireGuardCmd) HandleLs(ctx *Context) (err error)
func (*WireGuardCmd) HandleReload ¶
func (*WireGuardCmd) HandleReload(ctx *Context) (err error)
func (*WireGuardCmd) HandleRm ¶
func (cmd *WireGuardCmd) HandleRm(ctx *Context) (err error)
func (*WireGuardCmd) Run ¶
func (cmd *WireGuardCmd) Run(ctx *Context) (err error)
Click to show internal directories.
Click to hide internal directories.