Documentation
¶
Index ¶
- func DeDuplicateSlice[T any](array []T) []T
- func GetAllGetParams(c *gin.Context) string
- func GetAllPostParams(c *gin.Context) string
- func GetNodeID() string
- func HandleNotFound(c *gin.Context)
- func ReadStream(stream pb.RemoteShell_SessionClient, stdout, stderr io.WriteCloser) (*int, error)
- func Recover(c *gin.Context)
- func WriteStream(stream pb.RemoteShell_SessionClient, inc <-chan rune, sigc <-chan os.Signal)
- type CallFn
- type Client
- type Connection
- type ConnectionManager
- type ExecOptions
- type Result
- type ResultCont
- type ReverseClient
- type ReverseServer
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadStream ¶
func ReadStream(stream pb.RemoteShell_SessionClient, stdout, stderr io.WriteCloser) (*int, error)
func WriteStream ¶
func WriteStream(stream pb.RemoteShell_SessionClient, inc <-chan rune, sigc <-chan os.Signal)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the remote shell client.
func NewClientInsecure ¶
NewClientInsecure creates an insecure client.
func (*Client) Exec ¶
func (c *Client) Exec(opts *ExecOptions) (*int, error)
Exec executes a command in the server.
func (*Client) ExecContext ¶
ExecContext is like Exec, but with context.
type Connection ¶
type Connection struct {
*grpc.ClientConn
// contains filtered or unexported fields
}
func (*Connection) Close ¶
func (c *Connection) Close() error
type ConnectionManager ¶
type ConnectionManager struct {
// contains filtered or unexported fields
}
func NewConnectionManager ¶
func NewConnectionManager(tlscfg *tls.Config) *ConnectionManager
func (*ConnectionManager) Close ¶
func (m *ConnectionManager) Close()
func (*ConnectionManager) CloseConnection ¶
func (m *ConnectionManager) CloseConnection(address string) error
func (*ConnectionManager) Connect ¶
func (m *ConnectionManager) Connect(ctx context.Context, address string) (*Connection, error)
type ExecOptions ¶
ExecOptions are the options for Exec.
type ResultCont ¶
type ResultCont struct {
Status string `json:"status"` //提示状态
Code int `json:"code"` //提示代码
Msg string `json:"msg"` //提示信息
Data interface{} `json:"data"` //出错
}
返回的结果的内容:
type ReverseClient ¶
type ReverseClient struct {
// contains filtered or unexported fields
}
ReverseClient is the local shell server.
func NewReverseClient ¶
func NewReverseClient(address string, shell string, tlcfg *tls.Config, channelServer *grpctunnel.ReverseTunnelServer) *ReverseClient
NewReverseClient creates a new local shell client.
type ReverseServer ¶
type ReverseServer struct {
// contains filtered or unexported fields
}
func NewReverseServer ¶
Reverse client. 集成在客户端的反向 shell(用于 grpc server 端调用 agent 侧 shell)
func (*ReverseServer) GetClient ¶
func (s *ReverseServer) GetClient(id string) grpc.ClientConnInterface
func (*ReverseServer) RegisterHandlers ¶
func (s *ReverseServer) RegisterHandlers()
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
reverse-rsh/client
command
|
|
|
reverse-rsh/server
command
|
|
|
rsh/client
command
|
|
|
rsh/server
command
|
|
Click to show internal directories.
Click to hide internal directories.