Documentation ¶
Index ¶
- Constants
- func CheckClientFlags(cmd *cobra.Command, args []string) error
- func CheckCommonFlags(cmd *cobra.Command, args []string) error
- func CheckServerFlags(cmd *cobra.Command, args []string) (err error)
- func ClientHandler(ctx context.Context, rwc io.ReadWriteCloser) error
- func ClientMain(cmd *cobra.Command, args []string)
- func ClientStart(ctx context.Context, opts *ClientOpts) error
- func Connect(ctx context.Context, endpoint string, handler Handler, connInt time.Duration) error
- func InitClientFlags(cmd *cobra.Command)
- func InitCommonFlags(cmd *cobra.Command)
- func InitServerFlags(cmd *cobra.Command)
- func Listen(ctx context.Context, endpoint string, handler Handler, maxConn int) error
- func ServerHandler(ctx context.Context, rwc io.ReadWriteCloser) error
- func ServerMain(cmd *cobra.Command, args []string)
- func ServerStart(ctx context.Context, opts *ServerOpts) error
- type ClientOpts
- type CommonOpts
- type Handler
- type ServerOpts
Constants ¶
View Source
const ( CommonFlagConnect = "connect" CommonFlagConnectP = "c" CommonFlagListen = "listen" CommonFlagListenP = "l" CommonFlagMaxConn = "max-conn" CommonFlagMaxConnP = "C" CommonFlagConnDelay = "conn-delay" CommonFlagConnDelayP = "D" CommonFlagPassword = "passwd" CommonFlagPasswordP = "w" CommonFlagPasswordPrompt = "prompt-passwd" CommonFlagPasswordPromptP = "W" CommonFlagSecret = "secret" CommonFlagSecretP = "s" CommonFlagSecretPrompt = "prompt-secret" CommonFlagSecretPromptP = "S" CommonFlagTrustPubHex = "pub" CommonFlagTrustPubHexP = "p" CommonFlagTrustPubPath = "pub-path" CommonFlagTrustPubPathP = "P" CommonFlagKeyHex = "key" CommonFlagKeyHexP = "k" CommonFlagKeyPath = "key-path" CommonFlagKeyPathP = "K" CommonFlagUseRaw = "use-raw" CommonFlagUseRawP = "r" CommonFlagVerbose = "verbose" CommonFlagVerboseP = "v" )
View Source
const (
ClientFlagNoTTY = "notty"
)
Variables ¶
This section is empty.
Functions ¶
func ClientHandler ¶
func ClientHandler(ctx context.Context, rwc io.ReadWriteCloser) error
func ClientMain ¶
func ClientStart ¶
func ClientStart(ctx context.Context, opts *ClientOpts) error
func InitClientFlags ¶
func InitCommonFlags ¶
func InitServerFlags ¶
func ServerHandler ¶
func ServerHandler(ctx context.Context, rwc io.ReadWriteCloser) error
func ServerMain ¶
func ServerStart ¶
func ServerStart(ctx context.Context, opts *ServerOpts) error
Types ¶
type ClientOpts ¶
type ClientOpts struct { *CommonOpts IsTTY bool Args []string }
func GetClientOpts ¶
func GetClientOpts(cmd *cobra.Command, args []string) (*ClientOpts, error)
type CommonOpts ¶
type CommonOpts struct { Mode string Endpoint string MaxConnIfListen int ConnDelayIfConnect time.Duration PasswordHash []byte SecretHash []byte PrivateKey ed25519.PrivateKey TrustedPublicKeys []ed25519.PublicKey UseRaw bool }
func GetCommonOpts ¶
func GetCommonOpts(cmd *cobra.Command, args []string) (*CommonOpts, error)
type Handler ¶
type Handler = func(ctx context.Context, rwc io.ReadWriteCloser) error
func BindInitializers ¶
func BindInitializers(h Handler, inits ...initializer.Initializer) Handler
type ServerOpts ¶
type ServerOpts struct {
*CommonOpts
}
func GetServerOpts ¶
func GetServerOpts(cmd *cobra.Command, args []string) (*ServerOpts, error)
Click to show internal directories.
Click to hide internal directories.