Source File
options.go
Belonging Package
github.com/gliderlabs/ssh
package sshimport (gossh)// PasswordAuth returns a functional option that sets PasswordHandler on the server.func ( PasswordHandler) Option {return func( *Server) error {.PasswordHandler =return nil}}// PublicKeyAuth returns a functional option that sets PublicKeyHandler on the server.func ( PublicKeyHandler) Option {return func( *Server) error {.PublicKeyHandler =return nil}}// HostKeyFile returns a functional option that adds HostSigners to the server// from a PEM file at filepath.func ( string) Option {return func( *Server) error {, := os.ReadFile()if != nil {return}, := gossh.ParsePrivateKey()if != nil {return}.AddHostKey()return nil}}func ( KeyboardInteractiveHandler) Option {return func( *Server) error {.KeyboardInteractiveHandler =return nil}}// HostKeyPEM returns a functional option that adds HostSigners to the server// from a PEM file as bytes.func ( []byte) Option {return func( *Server) error {, := gossh.ParsePrivateKey()if != nil {return}.AddHostKey()return nil}}// NoPty returns a functional option that sets PtyCallback to return false,// denying PTY requests.func () Option {return func( *Server) error {.PtyCallback = func( Context, Pty) bool {return false}return nil}}// WrapConn returns a functional option that sets ConnCallback on the server.func ( ConnCallback) Option {return func( *Server) error {.ConnCallback =return nil}}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |